apc ups snmp check question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

apc ups snmp check question

Post 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:

Code: Select all

OUTPUT: SNMP OK UPS self test 
?
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.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: apc ups snmp check question

Post 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.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: apc ups snmp check question

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: apc ups snmp check question

Post by benhank »

thanks guys. I'll tell you how it goes.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: apc ups snmp check question

Post by slansing »

Sweet! Keep us up to date!
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: apc ups snmp check question

Post by benhank »

so the check command would look like this?:

Code: Select all

$USER1$/check_snmp -H $HOSTADDRESS$ -C $ARG1$ -l $ARG2$ $ARG3$ $ARG4$
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: apc ups snmp check question

Post 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).
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: apc ups snmp check question

Post by benhank »

doh !
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: apc ups snmp check question

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: apc ups snmp check question

Post 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
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked