Perf graph for snmp output

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Perf graph for snmp output

Post 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
User avatar
lmiltchev
Former Nagios Staff
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Perf graph for snmp output

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Perf graph for snmp output

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises

Re: Perf graph for snmp output

Post by scottwilkerson »

You cannot get performance data if the output is a string...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Perf graph for snmp output

Post 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
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Perf graph for snmp output

Post 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.
Nicholas Scott
Former Nagios employee
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Perf graph for snmp output

Post 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
User avatar
nscott
Posts: 1040
Joined: Wed May 11, 2011 8:54 am

Re: Perf graph for snmp output

Post 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.
Nicholas Scott
Former Nagios employee
westernuniv
Posts: 120
Joined: Tue Aug 21, 2012 9:29 am

Re: Perf graph for snmp output

Post by westernuniv »

it makes sense. Thanks alot