Page 1 of 1

Perf graph for snmp output

Posted: Fri Dec 21, 2012 11:42 am
by westernuniv
Hi,
I'm using SNMP Monitoing wizard to get the IDP login stats in nagios XI, how can i get the perf graphs for any snmp output?
eg:

# snmpwalk -m ALL -v 2c -c <snmp-string> <idp-server> extOutput.1
UCD-SNMP-MIB::extOutput.1 = STRING: rp:2 l:4 u:4


Thanks

Re: Perf graph for snmp output

Posted: Fri Dec 21, 2012 3:54 pm
by lmiltchev
Your check returns a string, so you cannot have a perfdata. Our wizards (Linux SNMP & Windows SNMP), set a "-f" flag for returning perfdata. For example:

Code: Select all

[root@testbox libexec]# /usr/local/nagios/libexec/check_snmp_storage_wizard.pl -H 192.168.5.83  -C public --v2c -m "^/$" -w 80 -c 95 -f
/: 64%used(3546MB/5583MB) (<80%) : OK | '/'=3546MB;4466;5304;0;5583
Have you tried running one of our wizards?

Re: Perf graph for snmp output

Posted: Fri Dec 21, 2012 4:43 pm
by westernuniv
This is a solaris 10 server and I'm using scripts to get the IDP login stats and extended snmp config in the idp server to run and get the script output using snmp query, the output is String

Thanks

Re: Perf graph for snmp output

Posted: Wed Dec 26, 2012 9:46 am
by scottwilkerson
You cannot get performance data if the output is a string...

Re: Perf graph for snmp output

Posted: Wed Jan 02, 2013 1:01 pm
by westernuniv
Ok, I've modified the exec script to return an integer output as below
In the remote machine
# /usr/sfw/bin/snmpwalk -m ALL -v 2c -c <snmp-string> localhost .1.3.6.1.4.1.2021.50
UCD-SNMP-MIB::ucdavis.50.1.1 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1 = STRING: "idp"
UCD-SNMP-MIB::ucdavis.50.3.1 = STRING: "/bin/bash /usr/local/bin/idp.sh"
UCD-SNMP-MIB::ucdavis.50.100.1 = INTEGER: 1 <-----------------------
UCD-SNMP-MIB::ucdavis.50.102.1 = INTEGER: 0

In the nagios host,
# /usr/local/nagios/libexec/check_snmp -H <remote-host>-C <snmp-string> -P 2c -o .1.3.6.1.4.1.2021.50.100.1
SNMP OK - 1 | iso.3.6.1.4.1.2021.50.100.1=1

Now, how can I get the perf graph?

Thanks

Re: Perf graph for snmp output

Posted: Wed Jan 02, 2013 2:10 pm
by nscott
First you'll need to confirm that it is logging data to an RRD. Check to see if

/usr/local/nagios/share/perfdata/<hostname>/<servicename>.rrd

exists. If it does, we can move on to the next step.

Now check to see if that RRD contains any information:

Code: Select all

rrdtool fetch <path/to/rrd> AVERAGE -s '-1d'
That should return some numbers and not be all -nan

If that suceeds, then we can move on to the next step. However, I would like to take this one step at a time, as it should be creating the RRD, however, it may have gotten messed up due to the service being created and no perfdata was being returned, then the perfdata being added back. Because if it is returning perfdata data, it *should* be getting picked up by the default.php graph template. However, let us make sure the perfdata is in existence.

Re: Perf graph for snmp output

Posted: Wed Jan 02, 2013 3:28 pm
by westernuniv
Hi,
Yes I can see the rrd file exist and XI has started plotting the perf graphs. SNMP queries scheduled to run every 5 mins and scripts return the total no. of logins in the past 5 mins. Do I need to return the avg values in this case?
Thanks

Re: Perf graph for snmp output

Posted: Wed Jan 02, 2013 3:41 pm
by nscott
No, that is taken care of by the RRD. The whole 'AVERAGE' directive put in there is that if you report more then 1 result in the course of 5 minutes, the RRD will return the AVERAGE if given the AVERAGE directive and the max number seen if given the MAX directive, etc. Since the RRA default is the record the AVERAGE, thats why you must use AVERAGE, and since it is setup to run the check every 5 minutes anyways, you are more or less getting the only value the RRD has seen in that time period.

I hope that makes sense, please ask any further questions if there is still confusion on the topic.

Re: Perf graph for snmp output

Posted: Wed Jan 02, 2013 4:24 pm
by westernuniv
it makes sense. Thanks alot