<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Just a reference base &#187; MRTG</title>
	<atom:link href="http://www.troublenow.org/archives/category/mrtg/feed" rel="self" type="application/rss+xml" />
	<link>http://www.troublenow.org</link>
	<description>Just a reference base</description>
	<lastBuildDate>Thu, 08 Jul 2010 12:52:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MRTG APC UPS battery info</title>
		<link>http://www.troublenow.org/archives/85</link>
		<comments>http://www.troublenow.org/archives/85#comments</comments>
		<pubDate>Wed, 29 Jul 2009 17:04:26 +0000</pubDate>
		<dc:creator>Arno Haverlach</dc:creator>
				<category><![CDATA[MRTG]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.troublenow.org/?p=85</guid>
		<description><![CDATA[In addition to the APC PDU&#8217;s which you can graph nicely to see the power usage, it is also possible to graph a UPS so you can monitor the UPS with mrtg.
In this case I will be using a APC Smart-UPS VT 40 which supports graphing the battery temperature, battery capacity, input &#038; output frequency, [...]]]></description>
			<content:encoded><![CDATA[<p>In addition to the <a href="http://www.troublenow.org/archives/70">APC PDU&#8217;s</a> which you can graph nicely to see the power usage, it is also possible to graph a UPS so you can monitor the UPS with mrtg.</p>
<p>In this case I will be using a APC Smart-UPS VT 40 which supports graphing the battery temperature, battery capacity, input &#038; output frequency, minimum &#038; maximum line voltage and the reason why the UPS switched to battery (see below for a example)</p>
<p>First create your MRTG config dir in /etc/ if it doesn&#8217;t exists yet and create a mrtg dir in your www root (in my case /var/www) the name of the UPS I will be monitoring is &#8216;UPS001&#8242;.</p>

<div class="wp-terminal">trouble@sun:$ sudo mkdir /etc/mrtg<br/>trouble@sun:$ sudo mkdir -p /var/www/mrtg/UPS001<br/></div>

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

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">WorkDir: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>UPS001
&nbsp;
<span style="color: #666666; font-style: italic;">################################</span>
<span style="color: #666666; font-style: italic;"># Battery temperature</span>
<span style="color: #666666; font-style: italic;">################################</span>
&nbsp;
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 1.3.6.1.4.1.318.1.1.1.2.2.2.0<span style="color: #000000; font-weight: bold;">&amp;</span>1.3.6.1.4.1.318.1.1.1.2.2.2.0:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
Directory<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">100</span>
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: APC-UPS Temperature
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>APC-UPS Temperature<span style="color: #000000; font-weight: bold;">&lt;/</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: growright, gauge, nopercent, absolute
YLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Temp
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Temperature
Legend2<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: .
Legend3<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max value per interval on graph
Legend4<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: .
LegendI<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: UPS Battery Temperature
LegendO<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-temp<span style="color: #7a0874; font-weight: bold;">&#93;</span>: . 
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">################################</span>
<span style="color: #666666; font-style: italic;"># Battery capacity</span>
<span style="color: #666666; font-style: italic;">################################</span>
&nbsp;
&nbsp;
YLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Percent
ShortLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">%</span>
Directory<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Battery Capacity
Legend2<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Load
Legend3<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max Capacity
Legend4<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max Load
LegendI<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Battery Capacity
LegendO<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Load
WithPeak<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: ywm
Unscaled<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: dwmy
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">110</span>
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: growright, gauge, nopercent
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: APC Battery Capacity <span style="color: #000000; font-weight: bold;">&amp;</span> Load
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 1.3.6.1.4.1.318.1.1.1.2.2.1.0<span style="color: #000000; font-weight: bold;">&amp;</span>1.3.6.1.4.1.318.1.1.1.4.2.3.0:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-cap<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>Battery Capacity <span style="color: #000000; font-weight: bold;">&amp;</span> Load<span style="color: #000000; font-weight: bold;">&lt;/</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################</span>
<span style="color: #666666; font-style: italic;"># Input &amp; output frequency</span>
<span style="color: #666666; font-style: italic;">################################</span>
&nbsp;
&nbsp;
YLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Hertz
ShortLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Hz
Directory<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Input Frequency
Legend2<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Output Frequency
Legend3<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max Input Frequency
Legend4<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max Output Frequency
LegendI<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Input Hz
LegendO<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Output Hz
WithPeak<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: ywm
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">100</span>
Unscaled<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: dwmy
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: growright, gauge, nopercent
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: APC Input <span style="color: #000000; font-weight: bold;">&amp;</span> Output Frequency
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 1.3.6.1.4.1.318.1.1.1.3.2.4.0<span style="color: #000000; font-weight: bold;">&amp;</span>1.3.6.1.4.1.318.1.1.1.4.2.2.0:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-iofreq<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>APC Input <span style="color: #000000; font-weight: bold;">&amp;</span> Output Frequency<span style="color: #000000; font-weight: bold;">&lt;/</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################</span>
<span style="color: #666666; font-style: italic;"># Minimum &amp; Maximum line voltage</span>
<span style="color: #666666; font-style: italic;">################################</span>
YLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Volts AC
ShortLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: VAC
Directory<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Minimum Line Voltage
Legend2<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Maximum Line Voltage
Legend3<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Minimum Line Voltage
Legend4<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Maximum Line Voltage
LegendI<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Min VAC
LegendO<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Max VAC
WithPeak<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: ywm
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">500</span>
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: growright, gauge, nopercent
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: APC Minimum <span style="color: #000000; font-weight: bold;">&amp;</span> Maximum line voltage
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 1.3.6.1.4.1.318.1.1.1.3.2.3.0<span style="color: #000000; font-weight: bold;">&amp;</span>1.3.6.1.4.1.318.1.1.1.3.2.2.0:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-mimaxline<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>APC Minimum <span style="color: #000000; font-weight: bold;">&amp;</span> Maximum line voltage<span style="color: #000000; font-weight: bold;">&lt;/</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################################</span>
<span style="color: #666666; font-style: italic;"># Last-Reason-On-Battery</span>
<span style="color: #666666; font-style: italic;">################################</span>
YLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Reason
ShortLegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
Directory<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Last-Reason-On-Battery
Legend2<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Last-Reason-On-Battery
Legend3<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Last-Reason-On-Battery
Legend4<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Last-Reason-On-Battery
LegendI<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: LROB
LegendO<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: LROB
WithPeak<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: ywm
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">11</span>
Unscaled<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: dwmy
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: growright, gauge, nopercent
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: apc_ups Last Reason On Battery
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: 1.3.6.1.4.1.318.1.1.1.3.2.5.0<span style="color: #000000; font-weight: bold;">&amp;</span>1.3.6.1.4.1.318.1.1.1.3.2.5.0:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>batt-lrob<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000; font-weight: bold;">&lt;</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>APC Last Reason On Battery<span style="color: #000000; font-weight: bold;">&lt;/</span>H1<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;</span>TABLE<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>TR<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>System:<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>APC <span style="color: #000000; font-weight: bold;">in</span> OXIVOCC<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>TR<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>TR<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>Maintainer:<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>operations<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>TR<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>TR<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD <span style="color: #007800;">VALIGN</span>=<span style="color: #ff0000;">&quot;top&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>Description:<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>LROB Values<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
				 	<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> No Transfer<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">2</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> High Line Voltage<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">40</span><span style="color: #000000; font-weight: bold;">%</span> - <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> Line Power<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">4</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> - <span style="color: #000000;">40</span><span style="color: #000000; font-weight: bold;">%</span> Line Power<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">5</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000;">5</span> Sec Shallow Voltage Sag<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">6</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000;">5</span> Sec Deep Voltage Sag<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">7</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000;">5</span> Sec Small Voltage Spike<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">8</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #000000;">5</span> Sec Large Voltage Spike<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
					<span style="color: #000000;">9</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> UPS Self Test<span style="color: #000000; font-weight: bold;">&lt;</span>BR<span style="color: #000000; font-weight: bold;">&gt;</span>
				   <span style="color: #000000;">10</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Significant Voltage Delta<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>TR<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>TR<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>Resource:<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;</span>TD<span style="color: #000000; font-weight: bold;">&gt;</span>Last Reason On Battery<span style="color: #000000; font-weight: bold;">&lt;/</span>TD<span style="color: #000000; font-weight: bold;">&gt;&lt;/</span>TR<span style="color: #000000; font-weight: bold;">&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;/</span>TABLE<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Be sure to change the SNMP community and IP to your settings and the location of your www root if you use some other location.</p>
<p>Now add the following line to your crontab to run mrtg every 5 minutes.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span>   <span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #007800;">LANG</span>=C <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mrtg <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>UPS001.cfg <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>mrtg.log <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></td></tr></table></div>

<p>Create a index.html in /var/www/mrtg/UPS001:</p>

<div class="wp-terminal">trouble@sun:$ indexmaker /etc/mrtg/UPS001.cfg &gt; /var/www/mrtg/UPS001/index.html<br/></div>

<p>Now browse to your webserver and you should see the graphs.</p>
<p>Temperature:<br />
<img src="http://www.troublenow.org/wp-content/uploads/2009/07/UPS001-temp.png" alt="Temperature" /></p>
<p>APC Minimum &#038; Maximum line voltage:<br />
<img src="http://www.troublenow.org/wp-content/uploads/2009/07/UPS001-batt-mimaxline-day.png" alt="APC Minimum &#038; Maximum line voltage" /></p>
<p>Last Reason On Battery:<br />
<img src="http://www.troublenow.org/wp-content/uploads/2009/07/UPS001-batt-lrob-day.png" alt="Last reason on battery" /></p>
<p>Input &#038; Output Frequency:<br />
<img src="http://www.troublenow.org/wp-content/uploads/2009/07/UPS001-batt-iofreq-day.png" alt="Input &#038; Output Frequency" /></p>
<p>Battery Capacity &#038; Load:<br />
<img src="http://www.troublenow.org/wp-content/uploads/2009/07/UPS001-Bat-cap-loa.png" alt="Battery Capacity &#038; Load" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.troublenow.org/archives/85/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MRTG APC PDU power usage</title>
		<link>http://www.troublenow.org/archives/70</link>
		<comments>http://www.troublenow.org/archives/70#comments</comments>
		<pubDate>Tue, 28 Jul 2009 17:08:30 +0000</pubDate>
		<dc:creator>Arno Haverlach</dc:creator>
				<category><![CDATA[MRTG]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.troublenow.org/?p=70</guid>
		<description><![CDATA[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) [...]]]></description>
			<content:encoded><![CDATA[<p>With MRTG it is possible to easily monitor the power usage of your APC PDU.</p>
<p>In this case I will be using a APC AP7920 Switched rack PDU, creating the MRTG graphs is actually very simple.</p>
<p>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 &#8216;APC001&#8242;.</p>

<div class="wp-terminal">trouble@sun:$ sudo mkdir /etc/mrtg<br/>trouble@sun:$ sudo mkdir -p /var/www/mrtg/APC001<br/></div>

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

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">WorkDir: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>APC001
&nbsp;
Target<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: enterprises.318.1.1.12.2.3.1.1.2.1<span style="color: #000000; font-weight: bold;">&amp;</span>enterprises.318.1.1.12.2.3.1.1.2.1:COMMUNITY<span style="color: #000000; font-weight: bold;">@</span>YOUR.APC.IP
Title<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Power APC001
PageTop<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>:
<span style="color: #000000; font-weight: bold;">&lt;</span>h1<span style="color: #000000; font-weight: bold;">&gt;</span>Power APC001<span style="color: #000000; font-weight: bold;">&lt;/</span>h1<span style="color: #000000; font-weight: bold;">&gt;</span>
MaxBytes<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">100</span>
Options<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: gauge,growright
Ylegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Power Amps
Shortlegend<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Amp
Legend1<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Power <span style="color: #000000; font-weight: bold;">in</span> Ampere
Unscaled<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: ymwd
YTicsFactor<span style="color: #7a0874; font-weight: bold;">&#91;</span>APC001-power<span style="color: #7a0874; font-weight: bold;">&#93;</span>: <span style="color: #000000;">0.1</span></pre></div></div>

<p>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.</p>
<p>Now add the following line to your crontab to run mrtg every 5 minutes.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*/</span><span style="color: #000000;">5</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span>   <span style="color: #c20cb9; font-weight: bold;">env</span> <span style="color: #007800;">LANG</span>=C <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>mrtg <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>APC001.cfg <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>mrtg<span style="color: #000000; font-weight: bold;">/</span>mrtg.log <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span></pre></div></div>

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

<div class="wp-terminal">trouble@sun:$ indexmaker /etc/mrtg/APC001.cfg &gt; /var/www/mrtg/APC001/index.html<br/></div>

<p>Now browse to your webserver and you should see the graphs.</p>
<p><img src="http://www.troublenow.org/wp-content/uploads/2009/07/APC001-power.png" alt="Powerusage" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.troublenow.org/archives/70/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
