Here's a guide that will allow you to create a modified InterfaceMap as part of
your own custom ZenPack. This custom InterfaceMap will allow you to assign a
special "type" to port channel interfaces so you can create a performance
template specifically for them.
Create a ZenPack
Go to the ZenPacks tab of Settings
Choose "Create a ZenPack" from the menu
Name it PortChannelPack and fill in the other fields
Click OK to save it
Copy the Standard InterfaceMap
cp $ZENHOME/Products/DataCollector/plugins/zenoss/snmp/InterfaceMap.py
$ZENHOME/Products/PortChannelPack/modeler/plugins/PortChannelInterfaceMap.py
Edit the new PortChannelInterfaceMap.py file and replace all occurances
of "InterfaceMap" with "PortChannelInterfaceMap"
Change the the line that reads 'maptype = "PortChannelInterfaceMap"'
back to "maptype = "InterfaceMap"'
Find the following line that sets the type of the interface
Code:
om.type = self.ifTypes.get(str(om.type), "Unknown")
And replace it with these lines:
Code:
if om.id.startswith('PortChannel'):
om.type = 'PortChannel'
else:
om.type = self.ifTypes.get(str(om.type), "Unknown")
Restart Zope to load the new modeler plugin:
zopectl restart
Make Zenoss Use the New Map
Go to the zProperties of /Devices/Network
Edit the zCollectorPlugins
Remove zenoss.snmp.InterfaceMap
Add PortChannelInterfaceMap
Add PortChannel Template
Go to /Devices in your device class hierarchy
Click on the Templates tab
Select ethernetCsmac
Select Copy Templates from the menu
Choose / as the destination
Click on the new copy_of_ethernetCsmacd template
Change the name to PortChannel and create a description
Setup the rest of the template according to how you'd like to monitor
port channel interfaces
Click the menu and add this template to your PortChannelPack
Now remodel any of your devices with port channel interfaces. After doing this
you should see that their type is set to "PortChannel." This will cause the
PortChannel performance template to be applied to them.
Congratulations! You've created your first ZenPack. If you wish, you can share
this with other Zenoss community users.
------------------------
Chet Luther
-------------------- m2f --------------------
Read this topic online here:
http://community.zenoss.com/forums/viewtopic.php?p=8731#8731
-------------------- m2f --------------------
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users