Ian,
That looks like the right idea. Its zenmodeler that you need to run
to kick of a collection. To debug your plugin do this:
zenmodeler run -d YOURBOX --collect UCDHardDiskMap
You can put break points in the code to see what's going on. It
would be nice to get the drive name (like /dev/hda). When I walk
that oid on my boxes I get nothing back. :(
-EAD
On Jan 22, 2007, at 3:40 AM, Ian Chen wrote:
Erik,
You mean something like this:
Products/DataCollector/plugins/zenoss/snmp/UCDHardDiskMap.py
----
from CollectorPlugin import SnmpPlugin, GetTableMap
#from string import find
class UCDHardDiskMap(SnmpPlugin):
"""Map SNMP UCD-DISKIO-MIB sub-agent to HardDisk"""
maptype = "HardDiskMap"
modname = "Products.ZenModel.HardDisk"
relname = "harddisks"
compname = "hw"
snmpGetTableMaps = (
GetTableMap('diskIOEntry',
'.1.3.6.1.4.1.2021.13.15.1.1',
{
'.2': 'id',
}
),
)
def process(self, device, results, log):
return
"""collect snmp information from this device"""
log.info('processing UCD hard disks for device %s' %
device.id)
getdata, tabledata = results
dtable = tabledata.get("diskIOEntry")
if not dtable: return
rm = self.relMap()
for oid, disk in dtable.items():
om = self.objectMap(disk)
#if om.id == "_Total": continue
#if find( om.id,"hd") != 0 and find(om.id ,"sd") != 0 :
continue
om.id = self.prepId( om.id)
om.snmpindex = oid
rm.append(om)
return rm
----
I managed to manually created a hda disk in ZMI. And I get the hda
in Hardware tab.
After I restarted zenperfsnmp from /About, the graph shows nan. And
some time later,
I see the graphic. But I can not get the harddisks added to
Hardware page of a device
automaitcally.
Ian
On 1/22/07, Erik A. Dahl <[EMAIL PROTECTED]> wrote: Not to easy to
do. You need to write a collector plugin to get the
list of disks. There are examples of this in the $ZENHOME/Products/
DataCollector/plugins directory.
-EAD
On Jan 21, 2007, at 8:32 AM, Ian Chen wrote:
> Hi Erik,
>
> I'm passing the SNMP request to external script to handle the data.
> Is there any way to add the hard disks automatically?
>
> I tried the Zenoss-Plugins, but it shows no plugin is suported?
> I'm running RHEL 4 ES x86 and Zenoss-Plugins 1.0.2 RPM for python
2.3
>
> Ian
>
> On 1/19/07, Erik A. Dahl <[EMAIL PROTECTED]> wrote: Net-SNMP disk io
> mib is totally broken on every machine I have ever
> tried :(
>
> -EAD
>
> On Jan 18, 2007, at 10:35 PM, Ian Chen wrote:
>
> > Hi Zenoss users,
> >
> > I'm hoping to get Linux disk IO graphed with SNMP just like for
the
> > Windows systems.
> >
> > I add a performacne template of HardDisk in /Device/Server/Linux
> > just like in /Device/Server/Windows
> > diskIONRead .1.3.6.1.4.1.2021.13.15.1.1.3
> > diskIONWrite .1.3.6.1.4.1.2021.13.15.1.1.4
> > diskIOReads .1.3.6.1.4.1.2021.13.15.1.1.5
> > diskIOWrites .1.3.6.1.4.1.2021.13.15.1.1.6
> >
> > And Graphs:
> > IO Bytes: diskIONRead_diskIONRead, diskIONWrite_diskIONWrite
> > IO Counts: diskIOReads_diskIOReads, diskIOWrites_diskIOWrites
> >
> > Nothing show up, for the snmp index of the disks must be modeled.
> >
> > I copied the InformantHardDiskMap.py to UCDHardDiskMap.py in
> > Products/DataCollector/plugins/zenoss/snmp/
> > and make some modification, which look like:
> > ----
> > from CollectorPlugin import SnmpPlugin, GetTableMap
> > #from string import find
> >
> > class UCDHardDiskMap(SnmpPlugin):
> > """Map SNMP UCD-DISKIO-MIB sub-agent to HardDisk"""
> >
> > maptype = "HardDiskMap"
> > modname = "Products.ZenModel.HardDisk"
> > relname = "harddisks"
> > compname = "hw"
> >
> > snmpGetTableMaps = (
> > GetTableMap('diskIOEntry',
> > '.1.3.6.1.4.1.2021.13.15.1.1',
> > {
> > '.2': 'id',
> > }
> > ),
> > )
> >
> > def process(self, device, results, log):
> > return
> > """collect snmp information from this device"""
> > log.info('processing UCD hard disks for device %s' %
> > device.id)
> > getdata, tabledata = results
> > dtable = tabledata.get ("diskIOEntry")
> > if not dtable: return
> > rm = self.relMap()
> > for oid, disk in dtable.items():
> > om = self.objectMap(disk)
> > #if om.id == "_Total": continue
> > #if find(om.id,"hd") != 0 and find(om.id ,"sd") != 0 :
> > continue
> > om.id = self.prepId(om.id)
> > om.snmpindex = oid
> > rm.append(om)
> > return rm
> > ----
> >
> > If I have Zenoss-Plugins installed in the same system, this plugin
> > won't load.
> > After I removed Zenoss-Plugins, the plugin loaed without problem.
> > But nothing show in the target device's Hardware tab.
> >
> > I managed to manually created a hda disk in ZMI. And I get the hda
> > in Hardware tab.
> > After I restarted zenperfsnmp from /About, the graph shows nan.
And
> > some time later,
> > I see the graphic.
> >
> > How can I make the modeler add the harddisks automatically? I
can't
> > add do them all
> > manually?
> > I know very little about Python/Zope.
> >
> > Thanks!
> >
> > Ian
> >
> >
> > _______________________________________________
> > 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
>
> _______________________________________________
> 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
_______________________________________________
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