本文整理汇总了Python中Products.ZenModel.ZenPack.ZenPackBase.upgrade方法的典型用法代码示例。如果您正苦于以下问题:Python ZenPackBase.upgrade方法的具体用法?Python ZenPackBase.upgrade怎么用?Python ZenPackBase.upgrade使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products.ZenModel.ZenPack.ZenPackBase
的用法示例。
在下文中一共展示了ZenPackBase.upgrade方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if hasattr(self.dmd.zenMenus, "Database"):
self.dmd.zenMenus._delObject("Database")
self.dmd.zenMenus.manage_addZenMenu("Database")
ZenPackBase.upgrade(self, app)
for d in self.dmd.Devices.getSubDevices():
d.os.buildRelations()
示例2: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
""" Upgrading the ZenPack procedures """
self._add_events()
ZenPackBase.upgrade(self, app)
self._registerPortlet(app)
示例3: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
for devClass, properties in self.dcProperties.iteritems():
self.addDeviceClass(app, devClass, properties)
ZenPackBase.upgrade(self, app)
for d in self.dmd.Devices.getSubDevices():
d.hw.buildRelations()
d.os.buildRelations()
示例4: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if hasattr(self.dmd.Reports, 'Device Reports'):
devReports = self.dmd.Reports['Device Reports']
rClass = devReports.getReportClass()
if not hasattr(devReports, 'Dell PowerEdge Reports'):
dc = rClass('Dell PowerEdge Reports', None)
devReports._setObject('Dell PowerEdge Reports', dc)
ZenPackBase.upgrade(self, app)
示例5: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
from ZenPacks.community.deviceAdvDetail.thresholds.StatusThreshold import StatusThreshold
for t in dmd.Devices.getAllRRDTemplates():
for gt in t.thresholds():
if isinstance(gt, StatusThreshold): continue
if gt.id != '%s status'%t.id: continue
template.thresholds.removeRelation(gt)
ZenPackBase.upgrade(self, app)
示例6: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if hasattr(self.dmd.Reports, 'Device Reports'):
devReports = self.dmd.Reports['Device Reports']
rClass = devReports.getReportClass()
if not hasattr(devReports, 'SMI-S Reports'):
dc = rClass('SMI-S Reports', None)
devReports._setObject('SMI-S Reports', dc)
for devClass, properties in self.dcProperties.iteritems():
self.addDeviceClass(app, devClass, properties)
ZenPackBase.upgrade(self, app)
示例7: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
"""
Delete and re-create the top-level menu.
"""
if hasattr(self.dmd.zenMenus, 'MessageQueues'):
self.dmd.zenMenus._delObject('MessageQueues')
self.dmd.zenMenus.manage_addZenMenu('MessageQueues')
ZenPackBase.upgrade(self, app)
for d in self.dmd.Devices.getSubDevices():
d.os.buildRelations()
示例8: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if hasattr(self.dmd.Reports, 'Device Reports'):
devReports = self.dmd.Reports['Device Reports']
rClass = devReports.getReportClass()
if not hasattr(devReports, 'Snmp Reports'):
dc = rClass('Snmp Reports', None)
devReports._setObject('Snmp Reports', dc)
self.dmd.Events.createOrganizer("/Change/Set/Status")
ZenPackBase.upgrade(self, app)
for d in self.dmd.Devices.getSubDevices():
d.os.buildRelations()
示例9: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
# Device - Storage organizer
if not hasattr(app.zport.dmd.Devices, 'Storage'):
manage_addDeviceClass(app.zport.dmd.Devices, 'Storage')
dc = app.zport.dmd.Devices.getOrganizer('Storage')
dc.description = ''
# MIB - Storage organizer
if not hasattr(app.zport.dmd.Mibs, 'Storage'):
manage_addDeviceClass(app.zport.dmd.Mibs, 'Storage')
mg = app.zport.dmd.Mibs.getOrganizer('Storage')
mg.description = ''
ZenPackBase.upgrade(self, app)
示例10: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if hasattr(self.dmd.Reports, 'Device Reports'):
devReports = self.dmd.Reports['Device Reports']
rClass = devReports.getReportClass()
if not hasattr(devReports, 'Cisco Reports'):
dc = rClass('Cisco Reports', None)
devReports._setObject('Cisco Reports', dc)
ZenPackBase.upgrade(self, app)
dc = app.zport.dmd.Devices.getOrganizer('Network/Router/Cisco')
cpl = list(getattr(dc, 'zCollectorPlugins'))
for plugin in self.newplugins:
if not plugin in cpl: cpl.append(plugin)
dc.zCollectorPlugins = list(cpl)
示例11: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
from ZenPacks.community.deviceAdvDetail.thresholds.StatusThreshold import StatusThreshold
for t in self.dmd.Devices.getAllRRDTemplates():
for gt in t.thresholds():
if isinstance(gt, StatusThreshold): continue
if gt.id != '%s status'%t.id: continue
template.thresholds.removeRelation(gt)
if hasattr(self.dmd.Reports, 'Device Reports'):
devReports = self.dmd.Reports['Device Reports']
rClass = devReports.getReportClass()
if not hasattr(devReports, 'HP ProLiant Reports'):
dc = rClass('HP ProLiant Reports', None)
devReports._setObject('HP ProLiant Reports', dc)
ZenPackBase.upgrade(self, app)
示例12: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
if not hasattr(app.zport.dmd.Events.Status, 'PyDBAPI'):
app.zport.dmd.Events.createOrganizer("/Status/PyDBAPI")
pct = app.zport.dmd.Monitors.rrdTemplates.PerformanceConf
if hasattr(pct.datasources, 'zenperfsql'):
pct.manage_deleteRRDDataSources(['zenperfsql'])
ds = pct.manage_addRRDDataSource('zenperfsql', 'BuiltInDS.Built-In')
for gdn, dpn, stacked, format in self._gdmap:
dp = ds.manage_addRRDDataPoint(dpn)
if dpn in ['dataPoints']:
dp.rrdtype = 'DERIVE'
dp.rrdmin = 0
gd = getattr(pct.graphDefs, gdn, None)
if not gd: continue
if hasattr(gd.graphPoints, 'zenperfsql'): continue
gdp = gd.createGraphPoint(DataPointGraphPoint, 'zenperfsql')
gdp.dpName = 'zenperfsql_%s'%dpn
gdp.format = format
gdp.stacked = stacked
ZenPackBase.upgrade(self, app)
示例13: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
ZenPackBase.upgrade(self, app)
self.addProfilerTab(app)
self.installMenus(app.zport.dmd)
示例14: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
ZenPackBase.upgrade(self, app)
示例15: upgrade
# 需要导入模块: from Products.ZenModel.ZenPack import ZenPackBase [as 别名]
# 或者: from Products.ZenModel.ZenPack.ZenPackBase import upgrade [as 别名]
def upgrade(self, app):
ZenPackBase.upgrade(self, app)
self._buildRelations()
self._setupCollectorPlugins(app.zport.dmd)