MRTG APC PDU power usage

With MRTG it is possible to easily monitor the power usage of your APC PDU.

In this case I will be using a APC AP7920 Switched rack PDU, creating the MRTG graphs is actually very simple.

First create your MRTG config dir in /etc/ and create a mrtg dir in your www root (in my case /var/www) the name of the PDU I will be monitoring is ‘APC001’.

trouble@sun:$ sudo mkdir /etc/mrtg
trouble@sun:$ sudo mkdir -p /var/www/mrtg/APC001

Then create the mrtg config file: /etc/mrtg/APC001.cfg and add the following content:

WorkDir: /var/www/mrtg/APC001
 
Target[APC001-power]: enterprises.318.1.1.12.2.3.1.1.2.1&enterprises.318.1.1.12.2.3.1.1.2.1:COMMUNITY@YOUR.APC.IP
Title[APC001-power]: Power APC001
PageTop[APC001-power]:
<h1>Power APC001</h1>
MaxBytes[APC001-power]: 100
Options[APC001-power]: gauge,growright
Ylegend[APC001-power]: Power Amps
Shortlegend[APC001-power]: Amp
Legend1[APC001-power]: Power in Ampere
Unscaled[APC001-power]: ymwd
YTicsFactor[APC001-power]: 0.1

Target[APC001-power]: enterprises.318.1.1.12.2.3.1.1.2.1&enterprises.318.1.1.12.2.3.1.1.2.1:COMMUNITY@YOUR.APC.IP
Title[APC001-power]: Power APC001
PageTop[APC001-power]:
<h1>Power APC001</h1>
MaxBytes[APC001-power]: 100
Options[APC001-power]: gauge,growright
Ylegend[APC001-power]: Power Amps
Shortlegend[APC001-power]: Amp
Legend1[APC001-power]: Power in Ampere
Unscaled[APC001-power]: ymwd
YTicsFactor[APC001-power]: 0.1

Be sure to change the SNMP community and IP to your settings and possibly change APC001 to the name of your PDU and the location of your www root if you use some other location.

Now add the following line to your crontab to run mrtg every 5 minutes.

*/5 * * * *   env LANG=C /usr/bin/mrtg /etc/mrtg/APC001.cfg >> /var/log/mrtg/mrtg.log 2>&1

Create a index.html in /var/www/mrtg/APC001:

trouble@sun:$ indexmaker /etc/mrtg/APC001.cfg > /var/www/mrtg/APC001/index.html

Now browse to your webserver and you should see the graphs.

Powerusage

0

Add a Comment