Check_SNMP question

Aaron Segura Aaron.Segura at cabelas.com
Tue Nov 7 21:58:31 CET 2006


I would just call 'snmpget' directly instead of going through
check_snmp.  You can modify the output so you just get the data you
want...

snmpget -Oquv -c <community> <host> <OID>

Will return JUST the value at the specified OID.  Should be pretty easy
to handle from there.

-----Original Message-----
From: Israel Brewster [mailto:israel at frontierflying.com] 
Sent: Tuesday, November 07, 2006 1:54 PM
To: Aaron Segura
Cc: Nagios Users mailinglist
Subject: Re: [Nagios-users] Check_SNMP question

The problem with that being that I would have to customize said  
script for each OID I want to query. It may end up being what I end  
up doing though. How would I parse the output of check_snmp? it looks  
like it returns a string similar to "SNMP OK - 2 | SNMPv2- 
SMI::mib-2.33.1.2.1.0=2;;;; ", - I suppose I could just look for the  
"=", take the next character, and go from there, though. I have some  
experience with basic scripting, essentially none with scripts for  
nagios, however. Thanks :)

-----------------------------------------------
Israel Brewster
Computer Support Technician
Frontier Flying Service INC.
5245 Airport Industrial Rd
Fairbanks, AK 99709
-----------------------------------------------


On Nov 7, 2006, at 11:15 AM, Aaron Segura wrote:

> Probably the best/easiest thing would be to write a small wrapper
> script.
>
> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net
> [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of  
> Israel
> Brewster
> Sent: Tuesday, November 07, 2006 12:25 PM
> To: Nagios Users mailinglist
> Subject: [Nagios-users] Check_SNMP question
>
> In the help for the check_snmp plugin, there are -w and -c switches
> which you can give ranges to "not return warning" and "not return
> critical". If I am reading the documentation correctly, you can also
> give a range as max:min to invert the meaning to something like
> "return warning only for this range". Is there any way to do non-
> contiguous ranges? My situation is as follows: the OID that I am
> querying returns the following list of possible integer values:
>      other(1),
>      none(2),
>      normal(3),
>      bypass(4),
>      battery(5),
>      booster(6),
>      reducer(7)
>
> Now what I want is an OK result if the return value is 3, critical if
> 5 or 2, and warning if anything else. Is this possible? On a related
> note, is there a way to append a specific status string depending on
> the return value? For example, if I get a 5 I want to set the info
> text in nagios to be something like "UPS on battery power". Thanks.
>
>
> -----------------------------------------------
> Israel Brewster
> Computer Support Technician
> Frontier Flying Service INC.
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> -----------------------------------------------
>
>
>
> ----------------------------------------------------------------------

> --
> -
> Using Tomcat but need to do more? Need to support web services,
> security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when
> reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list