changed:
-
<h1>Model 3Com Switch Data</h1>
<p>Many manufacturer specific data is supported by default, but 3Com was left out. This page will show you how to retrieve the switch serial number, product number, and software version.</p>
<h2>Create Python script</h2>
<p>Log in as 'zenoss' and create the file 'ThreeComDeviceMap.py' in the folder: '/usr/local/zenoss/Products/DataCollector/plugins/zenoss/snmp/' The content of the file is below.</p>
<pre>
__doc__="""ThreeComDeviceMap
ThreeComDeviceMap maps 3Com product information"""
from CollectorPlugin import SnmpPlugin, GetMap
class ThreeComDeviceMap(SnmpPlugin):
maptype = "ThreeComDeviceMap"
snmpGetMap = GetMap({
'.1.3.6.1.4.1.43.10.27.1.1.1.13.1' : 'setHWSerialNumber',
# Some older devices provide the serial number at '.1.3.6.1.4.1.43.10.27.1.1.1.13.2'
# This line gets the 3Com product number
#'.1.3.6.1.4.1.43.10.27.1.1.1.19.1' : 'setHWProductKey',
# This line gets the firmware version
#'.1.3.6.1.4.1.43.10.27.1.1.1.12.1': 'setOSProductKey',
})
def condition(self, device, log):
"""does device meet the proper conditions for this collector to run"""
return device.snmpOid.startswith('.1.3.6.1.4.1.43')
def process(self, device, results, log):
"""collect snmp information from this device"""
log.info('processing %s for device %s', self.name(), device.id)
getdata, tabledata = results
return self.objectMap(getdata)
</pre>
<h2>Restart Zope</h2>
<p>You can do this through the ZMI (http://[zenoss]:8080/manage) or the Zenoss service '$/etc/init.d/zenoss restart'</p>
<h2>Add the collector</h2>
<p>In order for this script to be used, you should dedicate a device class to the 3Com products. This is how you define a collector to apply to all devices within the class:</p>
<ul><li>Navigate to the device class</li>
<li>Click the main menu arrow -> More -> Collector Plugins</li>
<li>Click the 'Add Fields' link</li>
<li>Drag 'zenoss.snmp.ThreeComDeviceMap' to the left box</li>
<li>Click the 'Save' button</li>
</ul>
<h2>Complete</h2>
<p>You are now finished. Once the devices are remodeled, you will see the new information.</p>