Why Is This So Hard?How do I Monitor a UPS? (check_apcupsd)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Moneer81
Posts: 21
Joined: Mon Dec 07, 2015 2:55 pm

Why Is This So Hard?How do I Monitor a UPS? (check_apcupsd)

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Moneer81
Posts: 21
Joined: Mon Dec 07, 2015 2:55 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post by rkennedy »

Try running -

Code: Select all

yum install apcupsd -y
Former Nagios Employee
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post by Box293 »

Is this a UPS connected to your XI server, or a remote one on the network?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Moneer81
Posts: 21
Joined: Mon Dec 07, 2015 2:55 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post by Moneer81 »

rkennedy wrote:Try running -
[ccode]
yum install apcupsd -y
[/code]
I will try that here in a bit
Moneer81
Posts: 21
Joined: Mon Dec 07, 2015 2:55 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post 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.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post by bwallace »

Thanks for that info, let us know the outcome of running 'yum install apcupsd -y' whenever you have a chance.
Be sure to check out the Knowledgebase for helpful articles and solutions!
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

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

Code: Select all

nmap <device IP address>
Run the following command and show the output:

Code: Select all

ll -d /usr/sbin/apcaccess
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Why Is This So Hard?How do I Monitor a UPS? (check_apcup

Post 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)
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked