Ingest multi-value SNMP string into Cacti?

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
NightMonkey
Posts: 4
Joined: Thu Jul 14, 2005 10:14 pm

Ingest multi-value SNMP string into Cacti?

Post by NightMonkey »

Howdy. I'm trying my hand at creating a graph to monitor several values from my UPS. Yes, there's already a post on how, but there are some values it doesn't return, and I want to learn how to do this, too.

I'd like to avoid doing the XML component, as it is a bit obtuse to me. I've created an SNMP object via extend like so:

/etc/snmpd.conf:

Code: Select all

extend upsCheck /usr/local/bin/apcupsd-snmp.php
The script referenced above makes output that when ingested by snmp, looks like this:

Code: Select all

homeserver-02 bin # snmpwalk -Os -c xxx -v 1 localhost NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"upsCheck\"      
nsExtendOutputFull."upsCheck" = STRING: time_left:23.8 load_pct:35 temperature:29.2 batt_volt:27.8 batt_charge:100 line_volt:119 line_freq:60 time_on_batt:0 cum_time_on_batt:0 
homeserver-02 bin #
Can this data as formatted be directly imported into Cacti? Or, does it need to have the one OID -> one value mapping with snmp?

Thanks in advance for your help.
d0nni3q
Posts: 19
Joined: Mon Feb 16, 2009 2:26 pm
Location: Pittsburgh, PA

Post by d0nni3q »

The format will work. You can configure a Data Input Method of Script/Command to grab the data. For example:

- Input Type: Script/Commnad
- Input String:

Code: Select all

snmpget -Os -c xxx -v 1 localhost NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"upsCheck\" | cut -d ': ' | -f 2
(I'd probably make a small script file out of that, which would accept input values)
- Input Fields: hostIP, snmpString, etc.
- Output Fields: time_left, load_pct, temperature, batt_volt, batt_charge, line_volt, line_freq, time_on_batt, cum_time_on_batt

The configure a data template and graph template for each set of statistics you want to see.


Don Q.
NightMonkey
Posts: 4
Joined: Thu Jul 14, 2005 10:14 pm

Post by NightMonkey »

d0nni3q wrote:The format will work. You can configure a Data Input Method of Script/Command to grab the data. For example:

- Input Type: Script/Commnad
- Input String:

Code: Select all

snmpget -Os -c xxx -v 1 localhost NET-SNMP-EXTEND-MIB::nsExtendOutputFull."upsCheck" | cut -d ': ' | -f 2
(I'd probably make a small script file out of that, which would accept input values)
- Input Fields: hostIP, snmpString, etc.
- Output Fields: time_left, load_pct, temperature, batt_volt, batt_charge, line_volt, line_freq, time_on_batt, cum_time_on_batt

The configure a data template and graph template for each set of statistics you want to see.


Don Q.
Thank you, Don! Those were just the hints I was looking for. :D I think I will make a full script to pass arguments to.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests