apc ups snmp check question
Re: apc ups snmp check question
Ben,
I am doing checks against a bunch of APC UPS in my environment, let me boot up my laptop and vpn(home working on a staircase) and see what I am doing.
Also, what is the end result you are looking for? Depending on what is returned this will be critical/warning/ok, right?
I am doing checks against a bunch of APC UPS in my environment, let me boot up my laptop and vpn(home working on a staircase) and see what I am doing.
Also, what is the end result you are looking for? Depending on what is returned this will be critical/warning/ok, right?
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
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
Re: apc ups snmp check question
I'm using a plugin called check_snmp_apcups that I can't seem to find online anywhere. I can always post here in code brackets if you want it. Nice thing is, I have a service check for all my APC UPS called "Health" and this script running against all of them and it returns everything I want.
Sample Output
Sample Output
Status is OK - Smart-UPS 1500 - BATTERY:(capacity 100%, temperature 24 C, runtime 59 minutes, 00.00) INPUT:(voltage 118 V, frequency 60 Hz) OUTPUT:(voltage 118 V, frequency 60 Hz, load 22%) SELF TEST:(Unknown on 05/18/2013) LAST EVENT:(Small spike)
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
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
Re: apc ups snmp check question
the end result I am lookin for is to have the results that are displayed show in regular english instead nof the oid and the code number.
whould you happen to have that "health plugin available?
oh here is the one you cant find.
whould you happen to have that "health plugin available?
oh here is the one you cant find.
You do not have the required permissions to view the files attached to this post.
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
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
Re: apc ups snmp check question
That doesn't give you everything you need? Isn't it best to give them more than they askedbenhank wrote:the end result I am lookin for is to have the results that are displayed show in regular english instead nof the oid and the code number.
whould you happen to have that "health plugin available?
oh here is the one you cant find.
If not, and you want just that on oid, I'l probably write a real quick perl script that does the check_snmp and returns in english what you want. It wouldn't take long at all to write that.
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
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
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: apc ups snmp check question
Yeah all you would really need to do is write a wrapper to go around the current script and strip things you don't need, or convert them to something you do need. We're using a plugin similar to the one bandit mentioned in house for our UPS monitoring and it works a treat.
Re: apc ups snmp check question
dude asking me to write a perl script is like asking a brotha from down south to make kosher chinese food.... LOL BUT Ill look it up and try it. and trust me, I appreciate the help.
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
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
I think what Bandit was saying is that he might write one up, if you ask really nicely.
It should be silly simple to create one that will do what you need, so I don't think it would be difficult to try and do it yourself either.
Edit: Looks like sreinhardt is building an example for you.
Edit: Looks like sreinhardt is building an example for you.
Re: apc ups snmp check question
LOL, Kosher chinese food...guess I know where I'm going in a few minutes!
If Spenser's example doesn't help you out just let me know and I'll write the complete thing up for you....for now I am going to finish my word work.
If Spenser's example doesn't help you out just let me know and I'll write the complete thing up for you....for now I am going to finish my word work.
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
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
There is certainly no need to go the route of perl, save your self the headache. Bash would work just fine. It sounds like all you really want to do is a string replace on the oid and make it your label instead. something like:
This is an extremely brief example, and will only work provided your result is always the apc self check. However it could easily be expanded/changed to work with other codes as well.
Code: Select all
#!/bin/bash
#run check_snmp and store result
result=$(check_snmp -H 172.22.73.199 -C public -o .1.3.6.1.4.1.318.1.1.1.3.2.5.0)
#capture exit code from check_snmp
exitcode=$?
#replace the 9 | [oid]=0 with UPS self test
result=$(echo $result | sed 's/- 9 | iso.3.6.1.4.1.318.1.1.1.3.2.5.0=9/UPS self test/')
#print your result for nagios
echo $result
#exit with the same exitcode as check_snmp
exit $exitcodeNagios-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.
Re: apc ups snmp check question
Keep in mind Ben, that with that example, as long as the check_snmp works, the exit code will always be OK.
EDIT: If your cable/satellite subscription gives you the HGTV channel, I highly recommend NEVER watching it! Too many ideas!
EDIT: If your cable/satellite subscription gives you the HGTV channel, I highly recommend NEVER watching it! Too many ideas!
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
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