Recently I had to input quite a few OID’s into Zenoss. This meant I had to create a Data Source for each OID I wanted to monitor as well as one Data Point.
Now I knew this was going to be a hassle!!! So I decided to write a custom Python script that uses pysnmp to essentially do a snmpwalk (nextCmd)
on a Branch of OID’s. This means that I can create one Data Source and Mutiple Data Points.
Which drops the amount of time that I have to input into the Zenoss GUI.
Please Post any questions about this script here http://www.linuxdynasty.org/forums/Scripting/scripting/snmp_branch_help
You can download the script snmp_branch.py
- Update 1.0.10
- Fixed labeling bug, (Thanks Stephan26 for finding this)
- Added –fsearch option
Thanks Stephan26 for suggesting to add a way to find OID’s by their begining Digits on their last Octect
- Added –length option
This will allow you to search for an Index on the final Octect of the OID, when the final octect is not just the index.
Example…. You want the index OID of 100 but the entire last octect of the OID is .6534389100)
So here is an example below of what the data looks like from SNMP..
UCD-SNMP-MIB::ssIndex.0 = INTEGER: 1UCD-SNMP-MIB::ssSwapIn.0 = INTEGER: 0UCD-SNMP-MIB::ssSwapOut.0 = INTEGER: 0UCD-SNMP-MIB::ssIOSent.0 = INTEGER: 0UCD-SNMP-MIB::ssIOReceive.0 = INTEGER: 1UCD-SNMP-MIB::ssSysInterrupts.0 = INTEGER: 3|UCD-SNMP-MIB::ssSysContext.0 = INTEGER: 19UCD-SNMP-MIB::ssCpuUser.0 = INTEGER: 7UCD-SNMP-MIB::ssCpuSystem.0 = INTEGER: 7UCD-SNMP-MIB::ssCpuIdle.0 = INTEGER: 84