示例#1
0
 def install(self, app):
     if hasattr(self.dmd.zenMenus, "Database"):
         self.dmd.zenMenus._delObject("Database")
     self.dmd.zenMenus.manage_addZenMenu("Database")
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
    def install(self, zport):
        """
        Set the collector plugin
        """
        ZenPackBase.install(self, zport)

	setuphandlers.install(zport, self)
    def install(self, app):
        ZenPackBase.install(self, app)
        log.info("Starting installation of ZenPacks.TwoNMS.Rancid (rancid v" + self.RANCID_VERSION + ")")
        self.install_rancid(app)

        for d in self.dmd.Devices.getSubDevices():
            d.os.buildRelations()
示例#4
0
    def install(self, app):
        if not hasattr(self.dmd.Devices.Server, 'NetWare'):
            manage_addDeviceClass(self.dmd.Devices.Server, 'NetWare')
        dc = self.dmd.Devices.Server.NetWare
        dc.description = 'Novell NetWare Servers'
#        dc.devtypes = ['SNMP',]
        dc.zIcon = '/zport/dmd/server-netware.png'
        dc.zLinks = "<a href='https://${here/manageIp}:8009' target='_'>Novell Remote Manager</a> <a href='https://${here/manageIp}/nps' target='_'>iManager</a>"
        dc.zCollectorPlugins = tuple(self.dmd.Devices.Server.zCollectorPlugins) + (
                                                            'community.snmp.NWDeviceMap',
                                                            'community.snmp.NWFileSystemMap')
        if not hasattr(self.dmd.Devices.Server.NetWare, 'NCS'):
            manage_addDeviceClass(self.dmd.Devices.Server.NetWare, 'NCS')
        nwcs = self.dmd.Devices.Server.NetWare.NCS
        nwcs.description = 'Novell Cluster Virtual Resources'
#        nwcs.devtypes = ['SNMP',]
        nwcs.zCollectorPlugins = ('zenoss.snmp.NewDeviceMap',
                                'zenoss.snmp.DeviceMap',
                                'zenoss.snmp.IpServiceMap',
                                'zenoss.snmp.HRSWRunMap',
                                'community.snmp.Interface2IPMap',
                                'community.snmp.NWFileSystemMap',
                                )
        ZenPackBase.install(self, app)
        dc.zNWFileSystemMapIncludeNames = '^SYS'
        nwcs.zNWFileSystemMapIncludeNames = '^VOLUME_NAME'
 def install(self, app):
     pcache = []
     xmldoc = minidom.parse(objxmlPath)
     for o in xmldoc.getElementsByTagName('object'):
         lend = {
             'Report': -1,
             'RRDTemplate': -2
         }.get(o.getAttribute('class'), 0)
         cpath = o.getAttribute('id').split('/')[3:lend]
         if (cpath in pcache) or (lend == 0):
             continue
         co = self.dmd
         for id in cpath:
             if not hasattr(co, id):
                 newc = co.__class__(str(id))
                 co._setObject(str(id), newc)
             co = getattr(co, id)
         pcache.append(cpath)
     ZenPackBase.install(self, app)
     cpl = list(co.zCollectorPlugins)
     for plugin in self.newplugins:
         if not plugin in cpl:
             cpl.append(plugin)
     if isinstance(co.zCollectorPlugins, tuple):
         cpl = tuple(cpl)
     co._setProperty('zCollectorPlugins', cpl)
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux.
        """
        linux = app.dmd.Devices.createOrganizer('/Server/SSH/Linux')
        linux.setZenProperty( 'zCollectorPlugins', 
                              ['zenoss.cmd.uname',
                               'zenoss.cmd.uname_a',
                               'zenoss.cmd.linux.cpuinfo', 
                               'zenoss.cmd.linux.memory', 
                               'community.cmd.linux.ip', 
                               'community.cmd.linux.netstat_an', 
                               'zenoss.cmd.linux.netstat_rn', 
                               'zenoss.cmd.linux.process',
                               'community.cmd.linux.df',
                               'community.cmd.linux.lsb_release',
                               'community.cmd.linux.dmidecode',
                               'community.cmd.linux.sys_block',
                               'community.cmd.linux.mdstat',
                               'community.cmd.linux.lspci',
                               'community.cmd.linux.sw.dpkg',
                               'community.cmd.linux.sw.rpm' ] ) 
        
        linux.register_devtype('Linux Server', 'SSH')

        # fix zHardDiskMapMatch for /Server/SSH/Linux
        hdProp = linux.getProperty('zHardDiskMapMatch')
        if not hdProp or hdProp == ZHD_OLD:
            linux.setZenProperty('zHardDiskMapMatch', ZHD_NEW)

        ZenPackBase.install(self, app)
 def install(self, app):
     for devClass, properties in self.dcProperties.iteritems():
         self.addDeviceClass(app, devClass, properties)
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.hw.buildRelations()
         d.os.buildRelations()
    def install(self, app):
        """Initial installation of the ZenPack """

        self._add_events()

        ZenPackBase.install(self, app)
        self._registerPortlet(app)
示例#9
0
    def install(self, app):
        ZenPackBase.install(self, app)
        log.info("Starting installation of ZenPacks.TwoNMS.Rancid (rancid v" +
                 self.RANCID_VERSION + ")")
        self.install_rancid(app)

        for d in self.dmd.Devices.getSubDevices():
            d.os.buildRelations()
示例#10
0
 def install(self, app):
     ZenPackBase.install(self, app)
     dc = app.dmd.Devices.createOrganizer('/AWS/EC2')
     dc.setZenProperty('zCollectorPlugins', ('zenoss.aws.EC2InstanceMap', ))
     dc.setZenProperty('zPythonClass', 'ZenPacks.zenoss.ZenAWS.EC2Manager')
     if dc.devices._getOb('EC2Manager', None): return
     ec2m = dc.createInstance('EC2Manager')
     ec2m.setPerformanceMonitor('localhost')
    def install(self, app):
        ZenPackBase.install(self, app)

        super(ZenPack, self).install(app)
        log.info("Adding ZenPacks.community.CiscoEnvmonE"
                 " relationships to existing devices")

        self._buildHWRelations()
    def install(self, app):
        ZenPackBase.install(self, app)

        super(ZenPack, self).install(app)
        log.info("Adding ZenPacks.community.CiscoEnvmonE"
                 " relationships to existing devices")

        self._buildHWRelations()
示例#13
0
    def install(self, app):
        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.install(self, app)
 def install(self, app):
     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.install(self, app)
 def install(self, app):
     self.replaceString(zenPath('bin/zenoss'), '	#C="$C zenrender"',
                        '	C="$C zenrender"')
     if os.path.exists(zenPath('etc/DAEMONS_TXT_ONLY')) and os.path.exists(
             zenPath('etc/daemons.txt')):
         self.replaceString(zenPath('etc/daemons.txt'), '', 'zenrender')
     ZenPackBase.install(self, app)
     self.installMenuItems(app.zport.dmd)
示例#16
0
 def install(self, app):
     self._removeMenu('Database')
     self._addMenu('Database', 'Database')
     self._removeMenu('DBSrvInst')
     self._addMenu('DBSrvInst', 'Database Server Instance')
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
示例#17
0
    def install(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.install(self, app)
 def install(self, app):
     if not hasattr(app.zport.dmd.Events.Status, 'VMware'):
         app.zport.dmd.Events.createOrganizer("/Status/VMware")
     app.zport.dmd.Reports.createOrganizer('/VMware Reports')
     ZenPackBase.install(self, app)
     log.info('Linking icon into $ZENHOME/Products/ZenWidgets/skins/zenui/img/icons')
     os.system('ln -sf %s %s' % (self.path('resources/img/icons/server-vmware.png'), zenPath('Products/ZenWidgets/skins/zenui/img/icons', 'server-vmware.png')))
     os.system('chmod 0644 %s' % (zenPath('Products/ZenWidgets/skins/zenui/img/icons', 'server-vmware.png')))
示例#19
0
 def install(self, app):
     self._removeMenu('Database')
     self._addMenu('Database', 'Database')
     self._removeMenu('DBSrvInst')
     self._addMenu('DBSrvInst', 'Database Server Instance')
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
示例#20
0
 def install(self, app):
     ZenPackBase.install(self, app)
     dc = app.dmd.Devices.createOrganizer('/AWS/EC2')
     dc.setZenProperty('zCollectorPlugins', 
                         ('zenoss.aws.EC2InstanceMap',))
     dc.setZenProperty('zPythonClass', 'ZenPacks.zenoss.ZenAWS.EC2Manager')
     if dc.devices._getOb('EC2Manager', None): return
     ec2m = dc.createInstance('EC2Manager')
     ec2m.setPerformanceMonitor('localhost')
示例#21
0
 def install(self, app):
     """
     Create the top-level menu.
     """
     if hasattr(self.dmd.zenMenus, 'MessageQueues'):
         self.dmd.zenMenus._delObject('MessageQueues')
     self.dmd.zenMenus.manage_addZenMenu('MessageQueues')
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
示例#22
0
 def install(self, app):
     if hasattr(self.dmd.Reports, 'Device Reports'):
         devReports = self.dmd.Reports['Device Reports']
         rClass = devReports.getReportClass()
         if not hasattr(devReports, 'HP EVA Reports'):
             dc = rClass('HP EVA Reports', None)
             devReports._setObject('HP EVA Reports', dc)
     for devClass, properties in self.dcProperties.iteritems():
         self.addDeviceClass(app, devClass, properties)
     ZenPackBase.install(self, app)
 def install(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.install(self, app)
示例#24
0
 def install(self, app):
     """
     Create the top-level menu.
     """
     if hasattr(self.dmd.zenMenus, 'MessageQueues'):
         self.dmd.zenMenus._delObject('MessageQueues')
     self.dmd.zenMenus.manage_addZenMenu('MessageQueues')
     ZenPackBase.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
示例#25
0
 def install(self, app):
     ZenPackBase.install(self, app)
     configFileName = zenPath("etc", "zeneval.conf")
     if not os.path.exists(configFileName):
         configFile = open(configFileName, "w")
         configFile.write("")
         configFile.close()
     self.dmd.zport.__setattr__("eval_expired", "false")
     self.modifyLoginForm(
         "tal:attributes=\"onload string:if (${here/eval_expired}) alert('Evaluation period is expired. Please, contact your distributor.');;"
     )
 def install(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.install(self, app)
     for d in self.dmd.Devices.getSubDevices():
         d.os.buildRelations()
    def install(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.install(self, app)
示例#28
0
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/OSX.
        """
        ZenPackBase.install(self, app)
        osx = app.dmd.Devices.createOrganizer('/Server/SSH/OSX')

        plugins=[]
        plugins.append('zenoss.cmd.osx.uname_a')
        plugins.append('zenoss.cmd.osx.memory')
        plugins.append('zenoss.cmd.osx.cpu')
        plugins.append('zenoss.cmd.osx.software')
        osx.setZenProperty( 'zCollectorPlugins', plugins )
示例#29
0
 def install(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.install(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)
示例#30
0
 def install(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.install(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)
示例#31
0
 def install(self, app):
     if not hasattr(app.zport.dmd.Events.Status, 'VMware'):
         app.zport.dmd.Events.createOrganizer("/Status/VMware")
     app.zport.dmd.Reports.createOrganizer('/VMware Reports')
     ZenPackBase.install(self, app)
     log.info(
         'Linking icon into $ZENHOME/Products/ZenWidgets/skins/zenui/img/icons'
     )
     os.system('ln -sf %s %s' %
               (self.path('resources/img/icons/server-vmware.png'),
                zenPath('Products/ZenWidgets/skins/zenui/img/icons',
                        'server-vmware.png')))
     os.system('chmod 0644 %s' % (zenPath(
         'Products/ZenWidgets/skins/zenui/img/icons', 'server-vmware.png')))
示例#32
0
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux.
        """
        linux = app.dmd.Devices.createOrganizer('/Server/SSH/Linux')
        linux.setZenProperty('zCollectorPlugins', [
            'zenoss.cmd.uname', 'zenoss.cmd.uname_a', 'zenoss.cmd.df',
            'zenoss.cmd.linux.cpuinfo', 'zenoss.cmd.linux.memory',
            'zenoss.cmd.linux.ifconfig', 'zenoss.cmd.linux.netstat_an',
            'zenoss.cmd.linux.netstat_rn', 'zenoss.cmd.linux.process'
        ])

        linux.register_devtype('Linux Server', 'SSH')
        ZenPackBase.install(self, app)
 def install(self, app):
     log.warn( "CBCiscoQOS install start")
     ZenPackBase.install(self, app)
     for dev in self.dmd.Devices.getSubDevices():
         for int in dev.os.interfaces():
             int.buildRelations()
     ZenPackBase.install(self, app)
     #Add new Plugin in time instalation
     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)
     
     '''
示例#34
0
class ZenPack(ZenPackBase):
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux/Gentoo.
        """
        try:
            gentoo = findGentoo(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception(
                'Device class Server/SSH/Linux/Gentoo does not exist. '
                'Cannot install Gentoo ZenPack.')
        ZenPackBase.install(self, app)

        plugins = []
        for plugin in gentoo.zCollectorPlugins:
            if plugin != "zenoss.cmd.uname_a":
                plugins.append(plugin)
            else:
                plugins.append('zenoss.cmd.linux.gentoo_uname_a')

        plugins.append('zenoss.cmd.linux.eix')

        gentoo.setZenProperty('zCollectorPlugins', plugins)

        gentoo.register_devtype('Gentoo Server', 'SSH')
示例#35
0
class ZenPack(ZenPackBase):
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Solaris.
        """
        try:
            solaris = findSolaris(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception('Device class Server/SSH/Solaris does not exist. '
                            'Cannot install Solaris ZenPack.')
        ZenPackBase.install(self, app)

        plugins=[]
        for plugin in solaris.zCollectorPlugins:
            plugins.append(plugin)

        plugins.append('zenoss.cmd.solaris.opensolaris_uname_a')
        plugins.append('zenoss.cmd.solaris.cpu')
        plugins.append('zenoss.cmd.solaris.memory')
        plugins.append('zenoss.cmd.solaris.ifconfig')
        plugins.append('zenoss.cmd.solaris.netstat_an')
        plugins.append('zenoss.cmd.solaris.netstat_r_vn')
        plugins.append('zenoss.cmd.solaris.process')
        plugins.append('zenoss.cmd.solaris.pkginfo')
        plugins.append('zenoss.cmd.solaris.df')

        solaris.setZenProperty( 'zCollectorPlugins', plugins )
示例#36
0
class ZenPack(ZenPackBase):

    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux/Mandriva
        """
        try:
            mandriva = findMandriva(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception('Device class Server/SSH/Linux/Mandriva does not exist. '
                            'Cannot install Mandriva ZenPack.')
        ZenPackBase.install(self, app)

        plugins=[]
        for plugin in mandriva.zCollectorPlugins:
            if plugin != "zenoss.cmd.uname_a":
                plugins.append(plugin)
            else:
                plugins.append('zenoss.cmd.linux.mandriva_uname_a')

        plugins.append('zenoss.cmd.linux.mandriva_rpm')

        mandriva.setZenProperty( 'zCollectorPlugins', plugins )

        mandriva.register_devtype('Mandriva Server', 'SSH')
示例#37
0
    def install(self, app):
        """ 
        Cfengine device class, file location and modeling plugins
        """
        ZenPackBase.install(self, app)
        cfengine = app.dmd.Devices.createOrganizer('/Server/Cfengine')
        
        plugins=[]
        server = app.dmd.findChild('Devices/Server')
        for plugin in server.zCollectorPlugins:
            plugins.append(plugin)

        plugins.append('community.cfenginemodeler')

        cfengine.setZenProperty( 'zCollectorPlugins', plugins )
        cfengine.setZenProperty( 'zPythonClass', 'ZenPacks.community.Cfengine.CfengineDevice' )
示例#38
0
class ZenPack(ZenPackBase):
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux/SUSE
        """
        try:
            suse = findSuSE(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception(
                'Device class Server/SSH/Linux/SUSE does not exist. '
                'Cannot install SUSE ZenPack.')
        ZenPackBase.install(self, app)

        plugins = []
        for plugin in suse.zCollectorPlugins:
            if plugin != "zenoss.cmd.uname_a":
                plugins.append(plugin)
            else:
                plugins.append('zenoss.cmd.linux.suse_uname_a')

        plugins.append('zenoss.cmd.linux.suse_rpm')

        suse.setZenProperty('zCollectorPlugins', plugins)

        suse.register_devtype('SuSE Server', 'SSH')
示例#39
0
class ZenPack(ZenPackBase):

    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux/Ubuntu
        """
        try:
            ubuntu = findUbuntu(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception('Device class Server/SSH/Linux/Ubuntu does not exist. '
                            'Cannot install Ubuntu ZenPack.')
        ZenPackBase.install(self, app)

        plugins=[]
        for plugin in ubuntu.zCollectorPlugins:
            if plugin != "zenoss.cmd.uname_a":
                plugins.append(plugin)
            else:
                plugins.append('zenoss.cmd.linux.ubuntu_uname_a')

        plugins.append('zenoss.cmd.linux.ubuntu_aptitude')

        ubuntu.setZenProperty( 'zCollectorPlugins', plugins )

        ubuntu.register_devtype('Ubuntu Server', 'SSH')
示例#40
0
class ZenPack(ZenPackBase):
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux.
        """
        try:
            linux = findLinux(app.dmd)
        except Exception, e:
            import traceback
            log.debug(traceback.format_exc())
            raise Exception('Device class Server/SSH/Linux does not exist. '
                            'Cannot install LinuxMonitor ZenPack.')
        ZenPackBase.install(self, app)

        plugins = []
        for plugin in linux.zCollectorPlugins:
            plugins.append(plugin)

        plugins.append('zenoss.cmd.linux.cpuinfo')
        plugins.append('zenoss.cmd.linux.memory')
        plugins.append('zenoss.cmd.linux.ifconfig')
        plugins.append('zenoss.cmd.linux.netstat_an')
        plugins.append('zenoss.cmd.linux.netstat_rn')
        plugins.append('zenoss.cmd.linux.process')

        linux.setZenProperty('zCollectorPlugins', plugins)
示例#41
0
    def install(self, app):
        """ 
        Cfengine device class, file location and modeling plugins
        """
        ZenPackBase.install(self, app)
        cfengine = app.dmd.Devices.createOrganizer('/Server/Cfengine')

        plugins = []
        server = app.dmd.findChild('Devices/Server')
        for plugin in server.zCollectorPlugins:
            plugins.append(plugin)

        plugins.append('community.cfenginemodeler')

        cfengine.setZenProperty('zCollectorPlugins', plugins)
        cfengine.setZenProperty('zPythonClass',
                                'ZenPacks.community.Cfengine.CfengineDevice')
示例#42
0
 def install(self, app):
     ZenPackBase.install(self, app)
     configFileName = zenPath('etc', 'xmppBot.conf')
     if not os.path.exists(configFileName):
         configFile = open(configFileName, 'w')
         configFile.write('# populate this file by running $ZENHOME/bin/xmppBot genconf > $ZENHOME/etc/xmppBot.conf\n')
         configFile.close()
     # add the JabberId property to existing users
     for user in app.dmd.ZenUsers.getAllUserSettings():
         if not user.hasProperty('JabberId'):
             user.manage_addProperty('JabberId', '', 'string')
             user._setProperty('JabberId', '', 'string')
         try:
             user.getProperty('JabberId')
         except AttributeError:
             user.manage_addProperty('JabberId', '', 'string')
     transaction.commit()
 def install(self, app):
     """
     F5 BigIP device class, plugins, etc
     """
     f5 = app.dmd.Devices.createOrganizer('/Network/f5')
     # Set snmp version to 2c
     f5.setZenProperty('zSnmpVer', 'v2c')
     
     # Build a list of modeler plugins that we want to apply to our new device class
     plugins=['BigipLtmVirtualServerMap', 'BigipDeviceMap']
     
     # Apply the list of plugins to the device class. This will overwrite whats there, not append
     f5.setZenProperty('zCollectorPlugins', plugins)
     
     # Register our device class file, with the new device class
     f5.setZenProperty('zPythonClass', 'ZenPacks.community.f5.BigipLtm')
     ZenPackBase.install(self, app)
示例#44
0
    def install(self, app):
        """
        F5 BigIP device class, plugins, etc
        """
        f5 = app.dmd.Devices.createOrganizer('/Network/f5')
        # Set snmp version to 2c
        f5.setZenProperty('zSnmpVer', 'v2c')

        # Build a list of modeler plugins that we want to apply to our new device class
        plugins = ['BigipLtmVirtualServerMap', 'BigipDeviceMap']

        # Apply the list of plugins to the device class. This will overwrite whats there, not append
        f5.setZenProperty('zCollectorPlugins', plugins)

        # Register our device class file, with the new device class
        f5.setZenProperty('zPythonClass', 'ZenPacks.community.f5.BigipLtm')
        ZenPackBase.install(self, app)
 def install(self, app):
     """
     Set the collector plugins for Server/SSH/Linux.
     """
     linux = app.dmd.Devices.createOrganizer('/Server/SSH/Linux')
     linux.setZenProperty( 'zCollectorPlugins', 
                           ['zenoss.cmd.uname',
                            'zenoss.cmd.uname_a',
                            'zenoss.cmd.df',
                            'zenoss.cmd.linux.cpuinfo', 
                            'zenoss.cmd.linux.memory', 
                            'zenoss.cmd.linux.ifconfig', 
                            'zenoss.cmd.linux.netstat_an', 
                            'zenoss.cmd.linux.netstat_rn', 
                            'zenoss.cmd.linux.process' ] ) 
     
     linux.register_devtype('Linux Server', 'SSH')
     ZenPackBase.install(self, app)
示例#46
0
    def install(self, app):
        qsan = app.dmd.Devices.createOrganizer('/Storage/Qsan')
        qsan.setZenProperty(
            'zCollectorPlugins',[
                'CERIT_SC.snmp.QsanDeviceMapMib',
                'CERIT_SC.snmp.QsanPDMib',
                'CERIT_SC.snmp.QsanVDMib'])

        # SNMP requests/modelling can take veeeeery long time
        qsan.setZenProperty('zSnmpTimeout','60')
        qsan.setZenProperty('zCommandCommandTimeout','120') #TODO: snmptimeout*tries
        qsan.setZenProperty('zCollectorClientTimeout','3600')

        # MIB organizers /Storage
        if not hasattr(app.zport.dmd.Mibs, 'Storage'):
            manage_addDeviceClass(app.zport.dmd.Mibs, 'Storage')

        ZenPackBase.install(self, app)
示例#47
0
    def install(self, app):
        """
        Initial installation of the ZenPack
        """
        try:
            # zSSHTimeout zproperty is added as part of this zenpack
            if app.dmd.Devices.getProperty('zSSHTimeout') is None:
                app.dmd.Devices.manage_addProperty('zSSHTimeout', 10, 'int')
            app.dmd.Devices.createOrganizer('/BBC')
            app.dmd.Events.createOrganizer('/BBCApplication')
            app.dmd.Events.createOrganizer('/BBCApplication/Zenoss')
            app.dmd.Events.createOrganizer('/Status/SSH')
        except:
            pass

        ZenPackBase.install(self, app)
        self._registerBBCAppPortlet(app)
        self._patchCollectionEdit()
        #self._registerDaemon()
        self._updateZenossDaemonsPerfStats()
示例#48
0
    def install(self, app):
        ZenPackBase.install(self, app)
        configFileName = zenPath('etc', 'xmppBot.conf')
        if not os.path.exists(configFileName):
            configFile = open(configFileName, 'w')
            configFile.write(
                '# populate this file by running $ZENHOME/bin/xmppBot genconf > $ZENHOME/etc/xmppBot.conf\n'
            )
            configFile.close()

        # add the JabberId property to existing users
        for user in app.dmd.ZenUsers.getAllUserSettings():
            if not user.hasProperty('JabberId'):
                user.manage_addProperty('JabberId', '', 'string')
                user._setProperty('JabberId', '', 'string')
            try:
                user.getProperty('JabberId')
            except AttributeError:
                user.manage_addProperty('JabberId', '', 'string')
        transaction.commit()
示例#49
0
 def install(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.install(self, app)
 def install(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.install(self, app)
示例#51
0
    def install(self, app):
        """
        Add transforms to mutate add/change events from the modeler to
        migration events between esx servers.
        """
        ZenPackBase.install(self, app)

        add = app.dmd.Events.createOrganizer('/Change/Add')
        if add.transform.find('VMWARE TRANSFORM') < 0:
            add.transform = add.transform + """
#START VMWARE TRANSFORM
if evt.message.find('guestDevices') > -1:
    evt._action = 'status'
    evt.severity = 3
    evt.eventClass = '/VMware/MigrateAcquire'
    evt.summary = 'Acquire vm %s' % evt.component
#END VMWARE TRANSFORM
"""
        remove = app.dmd.Events.createOrganizer('/Change/Remove')
        if remove.transform.find('VMWARE TRANSFORM') < 0:
            remove.transform = remove.transform + """
示例#52
0
    def install(self, app):
        """
        Add transforms to mutate add/change events from the modeler to
        migration events between esx servers.
        """
        ZenPackBase.install(self, app)

        add = app.dmd.Events.createOrganizer('/Change/Add')
        if add.transform.find('VMWARE TRANSFORM') < 0:
            add.transform = add.transform + """
#START VMWARE TRANSFORM
if evt.message.find('guestDevices') > -1:
    evt._action = 'status'
    evt.severity = 3
    evt.eventClass = '/VMware/MigrateAcquire'
    evt.summary = 'Acquire vm %s' % evt.component
#END VMWARE TRANSFORM
"""
        remove = app.dmd.Events.createOrganizer('/Change/Remove')
        if remove.transform.find('VMWARE TRANSFORM') < 0:
            remove.transform = remove.transform + """
    def install(self, app):
        """
        Set the collector plugins for Server/SSH/Linux/Fedora
        """

        # Our objects.xml assumes that this device class exists.
        fedora = app.zport.dmd.Devices.createOrganizer("Server/SSH/Linux/Fedora")

        ZenPackBase.install(self, app)

        plugins = []
        for plugin in fedora.zCollectorPlugins:
            if plugin != "zenoss.cmd.uname_a":
                plugins.append(plugin)
            else:
                plugins.append("zenoss.cmd.linux.fedora_uname_a")

        plugins.append("zenoss.cmd.linux.fedora_rpm")

        fedora.setZenProperty("zCollectorPlugins", plugins)

        fedora.register_devtype("Fedora Server", "SSH")
 def install(self, app):
     ZenPackBase.install(self, app)
     self._registerReportListPortlet(app)
示例#55
0
    def install(self, app):
        # objects.xml assumes /Server/Windows/WMI exists.
        app.zport.dmd.Devices.createOrganizer('/Server/Windows/WMI')

        ZenPackBase.install(self, app)
        self.enableDefaultServiceMonitoring(app.zport.dmd)
示例#56
0
    def install(self, app):
        if not hasattr(self.dmd.Events.HW.Backup, 'Tape Library'):
            manage_addEventClass(self.dmd.Events.HW.Backup, 'Tape Library')

        ZenPackBase.install(self, app)
示例#57
0
 def install(self, app):
     ZenPackBase.install(self, app)
     dc = app.zport.dmd.Devices.getOrganizer('Devices/Printer/Laser')
     dc._setProperty('zPythonClass',
                     'ZenPacks.community.PrinterToner.PrinterTonerDevice')
     self.modifyPlugins(app.zport.dmd.Devices.Printer.Laser, "add")