Pavel,

No easy way to make a new tab. There are custom fields that can be added to a Device that you could populate from a collector plugin. This most likely won't help you as you want to add fields to a Software object, correct?

To add a new tab you must edit the class variable factory_type_information

    # Screen action bindings (and tab definitions)
    factory_type_information = (
    {
        'immediate_view' : 'viewRRDTemplate',
        'actions'        :
        (
            # I'M A TAB
            {
              'name'          : 'Performance Template',  # TAB NAME
'action' : 'viewRRDTemplate', # PAGE TEMPLATE NAME 'permissions' : ( Permissions.view, ), # PERMISSIONS FOR DISPLAY OF TAB
            },
        )
    },
    )

Then add a page template for your new tab. For extensions to a ZenModel class put it in $ZENHOME/Products/ZenModel/skins/zenmodel.

Then populate the properties you need in your plugin collector (you might also add them as class level attributes so that if the are missing there will be defaults). For extra points you can add them to the class variable _properties (which let's them show up in the zope ZMI).

Of course you have now changed the Zenoss model which means that an update might cause you problems. When you are done if they are generic enough we might add them to the model.

Clearly we need to have a better answer to this question. :)

-EAD

On Oct 23, 2006, at 4:51 PM, Chlupáček Pavel wrote:

nice catch-

How about the other -> making own tab?

P.

________________________________

Od: [EMAIL PROTECTED] za uživatele Erik A. Dahl
Odesláno: po 23.10.2006 22:45
Komu: General discussion of using zenoss system
Předmět: Re: [zenoss-users] DataCollector Docs



Pavel,

The problem is that "compname" is "compName".   You might change
mapType as well although I don't think its too important.

-EAD

On Oct 23, 2006, at 3:31 PM, Chlupáček Pavel wrote:

btw, there is my code


from CollectorPlugin import SnmpPlugin, GetTableMap

class bwSoftwareMap(SnmpPlugin):

"""Map Broadworks Software Installed """

mapType = "SoftwareMap"

modname = "Products.ZenModel.Software"

relname = "software"

compName = "os"

snmpGetTableMaps = (

GetTableMap ('bwSoftwarePatchTable', '1.3.6.1.4.1.6431.1.1.2.2.3.1',

{'.1':'bwSoftwarePatchIndex',

'.2':'bwSoftwarePatchVersionName',

'.3':'bwSoftwarePatchName',

'.4':'bwSoftwarePatchType',

'.5':'bwSoftwarePatchInstallDate',

'.6':'bwSoftwarePatchStatus',

'.7':'bwSoftwarePatchOperation'

}

),

GetTableMap
('bwSoftwareThirdPartyTable','1.3.6.1.4.1.6431.1.1.2.2.4.1',

{'.1':'bwSoftwareThirdPartyIndex',

'.2':'bwSoftwareThirdPartyName',

'.3':'bwSoftwareThirdPartyVersion',

'.4':'bwSoftwareThirdPartyStatus'

}

),

GetTableMap ('swTableOid','.1.3.6.1.4.1.6431.1.1.2.2.2.1',

{'.1':'snmpIndex',

'.2':'setProductKey',

'.3':'setInstallDate'

}

)

)

def process (self, device, results, log):

log.info('processing broadworks information for device %s' % device.id)

getdata, tabledata = results

log.info('fetching Software Versions')

swVersionTable = tabledata.get("swTableOid")

if not swVersionTable:

log.info('No Software versions found, exiting...')

return

rm = self.relMap()

log.debug('relmap is %s', rm)

for swVersion in swVersionTable.values():

log.info('found software %s' % swVersion['setProductKey'])

om = self.objectMap(swVersion)

om.id = self.prepId(om.setProductKey)

log.debug('om is %s',om.id)

if not om.id: continue

if hasattr(om,'setInstallDate'):

om.setInstallDate = self.asdate(om.setInstallDate)

rm.append(om)

log.debug('relmap is finally %s', rm)

return rm


________________________________

Od: [EMAIL PROTECTED] za uživatele Erik A. Dahl
Odesláno: po 23.10.2006 21:18
Komu: General discussion of using zenoss system
Předmět: Re: [zenoss-users] DataCollector Docs



Pavel,

Take a look a the plugins in $ZENHOME/Products/DataCollector/plugins/
zenoss/snmp/HRSWInstalledMap.py for and example.  Here are some high
level points though:

Define the type map you will be using the target class type the
relationship name and the component name. here we are populating the
relation dev.os.software with Sofware objects.  This is most likely
what you want.

     maptype = "YourSoftwareMap"
     modname = "Products.ZenModel.Software"
     relname = "software"
     compname = "os"


To get a table returned with named columns defined a tuple of
GetTableMap objects at the class level.

     snmpGetTableMaps = (
         GetTableMap('swTableOid', '.1.3.6.1.2.1.25.6.3.1',
                 {'.1': 'snmpindex',
                  '.2': 'setProductKey',
                  #'.4': 'type',
                  '.5': 'setInstallDate',
                  }
         ),
     )

In the method process you will be building a list of ObjectMaps that
go into a RelMap.  One confusing thing in this method is the way a
software instance is stored.  Most of the data (ie the name) goes
into the class object.  This is found by the zenoss backend using the
setProductKey method.  This key is used to find the software product
for the instance you have collected (the product is under a
manufacturer in the /Manufacturers root).  If none is found a new one
is created in the /Unknown manufacturer.

-EAD



On Oct 21, 2006, at 1:49 PM, Chlupáček Pavel wrote:

I need to write custom data collector plugin.

I found that doc on wiki si in fact just skeleton. Can you at least
provide some high-level steps? I just need to query the system for
software installed (i.e. patches, versions etc) which are populated
over enterprise mib. Therefore need to use custom one.

I tried to undestand code, but maybe providing some guidance with
reference to code will help.

Thx. p.

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users


<winmail.dat>
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users


<winmail.dat>
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to