Page 1 of 5
apc ups snmp check question
Posted: Thu Apr 17, 2014 3:44 pm
by benhank
boy I am a posting fool lately.
Code: Select all
COMMAND: /usr/local/nagios/libexec/check_snmp -H 172.22.73.199 -C public -o .1.3.6.1.4.1.318.1.1.1.3.2.5.0
thw command gets me a result but it looks like so:
Code: Select all
OUTPUT: SNMP OK - 9 | iso.3.6.1.4.1.318.1.1.1.3.2.5.0=9
The =9 result is actually
UPS self test
how do i write a check that will not display the oid and its code but just the text description, that is:
?
What complicates this is that there are 10 possible definitions:
Code: Select all
1 No events
2 High line voltage
3 Brownout
4 Loss of mains power
5 Small temporary power drop
6 Large temporary power drop
7 Small spike
8 Large spike
9 UPS self test
10 Excessive input voltage fluctuation
I know how to do the warning and crit definition types, but just listing results is beyond me.
Re: apc ups snmp check question
Posted: Thu Apr 17, 2014 3:48 pm
by BanditBBS
use the -s option to check for a specific string. Do a ./check_snmp --help and it'll explain the proper usage. The oid=9 part of what was return is performance data, so you won't actually see that part unless you go to the performance graph tab.
EDIT: I guess you can use the -w and -c options instead of -s since your result should always be an integer.
Re: apc ups snmp check question
Posted: Thu Apr 17, 2014 3:59 pm
by sreinhardt
You would not want to use -s, as that is actually checking for a string. However using -l will probably do the trick as it should replace the oid with a label of your choice.
Re: apc ups snmp check question
Posted: Thu Apr 17, 2014 5:46 pm
by benhank
thanks guys. I'll tell you how it goes.
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 9:13 am
by slansing
Sweet! Keep us up to date!
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 11:19 am
by benhank
so the check command would look like this?:
Code: Select all
$USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -l $ARG2$ $ARG3$ $ARG4$
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 11:31 am
by BanditBBS
Did you figure out on the command line what works for what you are wanting? If so, paste that here(blanking out the community string of course).
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 12:04 pm
by benhank
doh !
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 12:14 pm
by abrist
Spider Pig!
EDIT: Is it working? If not, post the full command your are attempting (from the cli first, right?) and we will take a look.
Re: apc ups snmp check question
Posted: Fri Apr 18, 2014 1:04 pm
by benhank
disclaimer: I am lost on this one. I am actually beggin for yall to write this command for me cause I am in teh land of the lost.

whats a spider pig?
whats everit is: yo mama!
Here is what I am working with:
Code: Select all
oid: .1.3.6.1.4.1.318.1.1.1.3.2.5.0
Parameters:
Code: Select all
1 No events
2 High line voltage
3 Brownout
4 Loss of mains power
5 Small temporary power drop
6 Large temporary power drop
7 Small spike
8 Large spike
9 UPS self test
10 Excessive input voltage fluctuation
the commands I have tried so far:
Code: Select all
$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$ -o $ARG$ -r
[code]$USER1$/check_snmp -H $HOSTADDRESS$ $ARG1$ -o $ARG$ -l
I woulnd go this cheesy suck up route but this was a lastminute "they need this now" type deal.
I have tried to look it up tho, I am not THAT cheesy