We got a new Synaccess NetBooter networked power switch. Not only does this device do SNMP, but it supposedly reports on temperature and power utilization via SNMP. These are useful things to alarm on, and even to graph. So, I’m creating Cacti templates for them.
First, do a snmpwalk on the device. I’m specifically interested in the device-specific SNMP mibs, the “enterprise” tree.
# snmpwalk -v 1 -c community hostname .1.3.6.1.4.1SNMPv2-SMI::enterprises.21728.2.4.1.1.1.0 = STRING: “NP-1601D ”
SNMPv2-SMI::enterprises.21728.2.4.1.1.2.0 = STRING: “power1”
SNMPv2-SMI::enterprises.21728.2.4.1.1.3.0 = INTEGER: 16
SNMPv2-SMI::enterprises.21728.2.4.1.1.4.0 = INTEGER: 1
SNMPv2-SMI::enterprises.21728.2.4.1.1.5.0 = INTEGER: 583002
SNMPv2-SMI::enterprises.21728.2.4.1.1.6.0 = STRING: “6.10”
…
OK, so I’m getting SNMP, but no interpretation of the SNMP values. This particular device includes an option to download the SNMP MIB file in the device Web interface (a very nice little feature that I sincerely wish more vendors would implement!) Grab the MIB file, dump in in $MIBDIRS. At my next snmpwalk I get:
SYNACCESS-MIB::systemModel.0 = STRING: NP-1601D
SYNACCESS-MIB::systemName.0 = STRING: ham-power1
SYNACCESS-MIB::powerOutletNum.0 = INTEGER: 16
SYNACCESS-MIB::serialPortNum.0 = INTEGER: 1
SYNACCESS-MIB::systemUpTime.0 = INTEGER: 583603
SYNACCESS-MIB::swVersion.0 = STRING: 6.10
…
Much better. Browsing the results, I see some things that look interesting:
SYNACCESS-MIB::currentDrawStatus1 = INTEGER: 0
SYNACCESS-MIB::currentDrawStatus2 = INTEGER: 0
SYNACCESS-MIB::currentDrawMax1 = INTEGER: 0
SYNACCESS-MIB::currentDrawMax2 = INTEGER: 1
SYNACCESS-MIB::temperatureReading = INTEGER: 73
First, let’s verify that these what they appear to be.
# snmptranslate -Td SYNACCESS-MIB::temperatureReading
SYNACCESS-MIB::currentDrawStatus1
currentDrawStatus1 OBJECT-TYPE
— FROM SYNACCESS-MIB
SYNTAX Integer32 (0..35)
MAX-ACCESS read-only
STATUS current
DESCRIPTION “Total AC current draw in amps for the first AC power bank sensor. This object is valid only if the current sensor module is installed.
AC power draw is monitored on each power cord or bank. ”
::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) synaccess(21728) nm(2) subsystem(4) synSys(1) enviroOpTables(3) enviroTable(1) enviroEntry(1) 3 }
Yes, this OID is actually what it looks like. I want to graph the OID .1.3.6.1.4.1.21728.2.4.1.3.1.1.3.
Open Cacti. Browse to “Data Templates.”
Cacti is complicated, in part because RRD is complicated, which is because SNMP is complicated. (Words other than “complicated” come to mind, but I’m trying to avoid that kind of language.) Common sense tells me that the best way to create new Cacti templates is to copy an existing template that’s fairly close to what I want. Many Cacti graphs have multiple values in a single graph, or are based on OID counters (traffic), or are based on indexed values (space on disk partitions).
So, find an existing data template for an OID that behaves like the graph you want to create. In this case, I want to graph a single integer value. My closest existing Cacti data template is “Host MIB – Processes.” Go to Data Templates and select your model, then browse to the bottom. At “Choose an Action,” select “Duplicate” and click Go. You’ll get a page with a field to change the name of your data template. I change this one to “netBooter Temperature.”
Open your copied data template. I changed the Data Source name to |host_description| – Temperature. The internal data source name I change to “temp.” The maximum value of 1000 we inherited from the process count template would work, but if the sever room gets anywhere near that temperature our problem space will change drastically. I set the maximum value to 150. Finally, I change the OID to .1.3.6.1.4.1.21728.2.4.1.3.1.1.8. That’s one complete data source. Double-check your work; changing data templates that are in use is a pain.
Now for a matching graph template. Again, start with a graph template that’s close to what you want and modify it. The processes graph template will work for us. Go to Graph Templates, select “Host MIB – Processes,” and duplicate it. Change the name to “netBooter Temperature” for consistency.
Edit the graph template and systematically change everything that says “Processes” to “Temperature.” In every Graph Template Item, change the Data Source to the “netBooter Temperature.” Leave all of the RRD graph construction values alone; graph templates can easily be changed after you start collecting data.
Now go to the device. Add the “netBooter Temperature” data source. Create a graph for the device, using the “netBooter Temperature” graph template.
Now walk away for a while. If you did everything correctly, then a graph should start to appear.
Why do I call this my fourth Cacti template? Because I tried to create this graph four times today. The first three times, it didn’t work. I’ve endured RRD’s cruel lash for over a decade worked with RRD for many years, and so I thought I could create a template from scratch. Once again, I had to learn the most vital lesson in systems administration: steal from what works. Sigh.