«

»

Apr 14 2011

Using Cacti with APC UPS and Ubuntu

Tested on :
Ubuntu 10.10 Server x64
Cacti 0.8.7g with NET-SNMP 5.x and RRDTool 1.4.x
APC UPS BR1500I with USB connection and apcupsd (3.14.8-2) package.
The original forum topic is here.
Cacti APC UPS image
You need to have apcupsd package installed, along with cacti.
Cacti can monitor my APC UPS using two scripts that rely on the information provided by apcaccess command.
The two scripts must be located in cacti’s scripts folder (in my case : /usr/share/cacti/site/scripts).

Changes : my UPS does not have an internal temperature sensor and cannot measure line frequency. So i modified the script to only show valid information (from apcaccess).
Stats monitored :

  • Time remaining in minutes
  • Battery charge level in %
  • Battery voltage in Volts
  • Utility line voltage in Volts
  • UPS load in %

My (customized and zipped) scripts are : apcupsd.pl and check_ups.sh and they must be executable.
Graph template (with dependencies, zip archive) is : cacti_graph_template_apc_ups_statistics
Data template is : cacti_data_template_apc_ups_statistics (included in graph template).

One change from the original data template was to increase the maximum value from 220 to 250 to the data source item line_volt, because the output in my case exceeds 220 (usually 230V) and the utility voltage was not shown.

Troubleshooting :

1. Be sure that the scripts are executable and the info in check_ups.sh is correct (the path for the check_ups.sh script)

2. Run check_ups.sh localhost 3551. It should display some statistics like :

line_volt:230.0 load_pct:7.0 b_charge:100.0 time_left:115.2 bat_volt:27.3

If it doesn’t, run the command apcaccess or apcaccess status. If you still get no output with ups stats, check to see if you have apcupsd package installed (see the beginning of the article for a link with install instructions).

3. Check RRD with command : rrdtool fetch /var/lib/cacti/rra/localhost_b_charge_117.rrd MAX where localhost_b_charge_117.rrd is the the data source file for Localhost – APC UPS Statistics. So look in Console -> Data Sources -> Localhost – APC UPS Statistics for the correct name and path.

4. Also check the Cacti log file, locate in Utilities -> System Utilites -> View Cacti Log file

1 ping

  1. Using cacti with HP Procurve 2510-24 (J9019) switch and Ubuntu » EVILBOX

    […] « Using Cacti with APC UPS and Ubuntu […]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*