Page 1 of 3
Why Is This So Hard?How do I Monitor a UPS? (check_apcupsd)
Posted: Tue Mar 01, 2016 12:41 pm
by Moneer81
Hello,
Can someone tell me if I am on the right track here. I just need to monitor an APC UPS. I am running a trial of Nagios XI 5.2.3.
I am starting from scratch. Here is what I did:
-Added the host to CCM. For the check_command so I am using "check-host-alive". Is there a better option?
-Now I need to attach a service to it. I would like to use check_apcupsd. Tried to configure the service and associate it to the host that I added above. Kinda lost on what to use for arguments. I am assuming each physical status that I want to monitor (i.e. temperature, voltage, battery load, etc.) will need to be defined as a separate service associated with the host. How do I define these services? What do I use for arguments?
Any help will be greatly appreciated. If my approach to this is flawed, please let me know.
Thanks,
Capture.JPG
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Tue Mar 01, 2016 3:05 pm
by lmiltchev
I believe you will need to use one more argument in your command in order to pass "bcharge", "itemp", "loadpct" or "timeleft". See the plugin's usage below:
[root@localhost libexec]# ./check_apcupsd.sh
usage: check_apcupsd [-c critical_value] [-h hostname] [-p port]
[-w warning_value] <bcharge|itemp|loadpct|timeleft>
hostname and port defaults to localhost and 3551, respectively.
checks:
bcharge = battery charge, measured in percent.
itemp = internal temperature, measured in degree Celcius.
loadpct = load percent, measured in percent (do'h!).
timeleft = time left with current battery charge and load,
measured in minutes.
I would recommend following the steps, outlined in the document below:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Make sure your check works from the command line first. Next, modify your command, your service, and test your check from the Nagios XI web UI. Let us know if you get stuck on something.
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Wed Mar 02, 2016 4:30 pm
by Moneer81
Thank you very much for the link and the answer. That helps.
Now when I try from the command line, I get the following error message:
"Error: /sbin/apcaccess must exist and be executable!"
Indeed, apcaccess is not in the /sbin/ directory. Now I am scouring the internet trying to find instructions on how to install apcaccess. Any ideas?
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Wed Mar 02, 2016 4:49 pm
by rkennedy
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Wed Mar 02, 2016 6:08 pm
by Box293
Is this a UPS connected to your XI server, or a remote one on the network?
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Thu Mar 03, 2016 8:06 am
by Moneer81
rkennedy wrote:Try running -
[ccode]
yum install apcupsd -y
[/code]
I will try that here in a bit
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Thu Mar 03, 2016 8:07 am
by Moneer81
Box293 wrote:Is this a UPS connected to your XI server, or a remote one on the network?
On the network. Nagios XI can see it and ping it and it is currently a monitored host in XI.
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Thu Mar 03, 2016 12:19 pm
by bwallace
Thanks for that info, let us know the outcome of running 'yum install apcupsd -y' whenever you have a chance.
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Thu Mar 03, 2016 12:27 pm
by lmiltchev
First you will need to make sure this works from the command line. Have you tried something like this?
Code: Select all
/usr/local/nagios/libexec/check_apcupsd.sh -h <device IP address> -w <warning threshold> -c <critical threshold> -p <port number> bcharge
I am not sure what port needs to be used, but you can run nmap against the device to see which ports are open.
Run the following command and show the output:
Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup
Posted: Thu Mar 03, 2016 4:46 pm
by Box293
Moneer81 wrote:Box293 wrote:Is this a UPS connected to your XI server, or a remote one on the network?
On the network. Nagios XI can see it and ping it and it is currently a monitored host in XI.
I'm pretty sure the plugin you're trying is for locally connected UPS that is running an APC agent, this is not the most common method.
Have a look at this plugin instead:
https://exchange.nagios.org/directory/P ... ps/details
It connects to the UPS via SNMP, so you'll need to configure SNMP on the UPS management interface.
And even more basic is this list of SNMP checks:
https://exchange.nagios.org/directory/P ... ad/details
(ignore the command[xxxx]= bits at the start)