1
.TH upsstats.html 5 "Thu Feb 9 2006" "" "Network UPS Tools (NUT)"
3
upsstats.html \- HTML template for Network UPS Tools upsstats
7
This file is used by \fBupsstats.cgi\fR(8) to generate status pages.
8
Certain commands are recognized, and will be replaced with various
9
status elements on the fly.
13
Commands can be placed anywhere on a line, but must start and end with @.
14
Any extra characters before or after the commands will be passed through
15
unchanged. It is allowed to use more than one command on a single line,
16
as long as each command has its own start and end character. If you need
17
to use the @ sign, use @ to prevent it from being treated as a start
22
Some commands begin blocks - sections of the template that will be
23
included, excluded, or repeated depending on certain parameters.
25
.SH BLOCK CONTROL - ITERATION
28
Starts a block that will be repeated for each MONITOR directive in the
29
\fBhosts.conf\fR(5). This is how you can generate pages that monitor
30
all of your systems simultaneously.
33
Ends a FOREACHUPS block.
35
.SH BLOCK CONTROL - MATCHING SPECIFIC CASES
38
Starts a block that will only be printed if the variable var is
39
supported by the current UPS. This is generally used to suppress "not
40
supported" messages by avoiding the label and variable call entirely.
42
.IP "@IFEQ var value@"
43
Starts a block if the value returned from the variable var matches
46
.IP "@IFBETWEEN varlow varhigh varvalue@"
47
Starts a block if the value returned by the variable varvalue is between
48
the values returned by the variables varlow and varhigh.
51
If the previous IF-command did not match, perform this instead.
54
Ends an IF/ELSE-block.
56
.SH BLOCK CONTROL - ADVANCED EXPRESSIONS
58
Even though the parser is pretty limited, it's still possible to create
59
rather advanced expressions. The key to this is the fact that
60
multiple block control commands are AND:ed. This is illustrated with an
61
example (more examples are available in upsstats.html).
63
@IFSUPP ambient.humidity@
65
@IFSUPP ambient.temperature@
67
This UPS knows both ambient temperature and humidity.
71
@IFSUPP ambient.humidity@
73
This UPS only knows ambient humidity.
77
@IFSUPP ambient.temperature@
79
This UPS only knows ambient temperature.
83
This UPS knows nothing, how annoying.
92
Insert the ambient temperature in the current temperature scale.
95
Insert the current date and time. The format string is passed to strftime,
96
so almost anything is possible. See \fBstrftime\fR(3) for possible values.
99
Insert the entity for degrees (°) and either C or F depending on
100
the current temperature scale.
103
Insert the designation of the host being monitored, like myups@localhost.
106
Insert the host's description from \fBhosts.conf\fR(5).
109
Insert a link to upsstats.cgi with the "host" variable set to the
110
current UPS. This is only useful within a FOREACHUPS block.
112
.IP "@IMG varname [\fIextra\fR]@"
113
Insert an IMG SRC to \fBupsimage.cgi\fR(8) for one of these
116
battery.charge - Battery charge - a percentage
118
battery.voltage - The charge on the battery in volts
120
input.frequency - Incoming utility frequency (Hz)
122
input.voltage - Incoming utility voltage
124
input.L1-L2.voltage - Incoming voltage, L1-L2 (3phase)
126
input.L2-L3.voltage - Incoming voltage, L2-L3 (3phase)
128
input.L3-L1.voltage - Incoming voltage, L3-L1 (3phase)
130
output.frequency - Outgoing utility frequency (Hz)
132
output.voltage - Outgoing voltage (from the UPS)
134
output.L1-L2.voltage - Outgoing voltage, L1-L2 (3phase)
136
output.L2-L3.voltage - Outgoing voltage, L2-L3 (3phase)
138
output.L3-L1.voltage - Outgoing voltage, L3-L1 (3phase)
140
output.L1.power.percent - UPS load, L1 (3phase)
142
output.L2.power.percent - UPS load, L2 (3phase)
144
output.L3.power.percent - UPS load, L3 (3phase)
146
ups.load - UPS load - percentage
148
ups.temperature - UPS temperature
150
\fIextra\fR is where you can put additional definitions. Right now
151
the valid definitions are colors for various parts of the bars drawn
152
by upsimage.cgi. Possible color names are:
154
back_col - background color
156
scale_num_col - scale number color
158
summary_col - summary color (number at the bottom)
160
ok_zone_maj_col - major scale color for the normal ("ok") zone
162
ok_zone_min_col - minor scale color for the normal ("ok") zone
164
neutral_zone_maj_col - major scale color for the neutral zone
166
neutral_zone_min_col - minor scale color for the neutral zone
168
warn_zone_maj_col - major scale color for the warning zone
170
warn_zone_min_col - minor scale color for the warning zone
172
bar_col - the color of the bar in the middle
174
All colors are hex triplets - 0xff0000 is red, 0x00ff00 is green, and
181
@IMG battery.charge back_col=0xff00ff bar_col=0xaabbcc@
183
@IMG input.voltage ok_zone_maj_col=0x123456@
186
Insert the META header magic for refreshing the page if that variable
187
has been set by the browser. This needs to be in the HEAD section of
191
Expand the abbreviations in the ups.status variable - OL becomes
192
"On line", OB becomes "On battery", and so on.
195
Insert red, green, or yellow color triplets depending on the severity of
196
the current UPS status. Normal operations are green, warnings like
197
voltage trim/boost or "off" are yellow, and other events like being on
198
battery or having a low battery are red.
201
Insert the current value of the status variable varname on the host being
202
monitored, or "Not supported".
205
Inserts the current runtime, in hh:mm:ss format.
208
Use the Celsius scale for temperature data (default).
211
Use the Fahrenheit scale for temperature data.
214
Insert the UPS temperature in the current scale.
217
Insert the battery temperature in the current scale.
220
Obsoleted. Use IFBETWEEN instead (see example in upsstats.html).
223
Insert the version number of the software.
226
\fBupsstats.cgi\fR(8) will also open a file called upsstats-single.html
227
if you call it with "host=" set in the URL. That file uses the same
228
rules and techniques documented here.
231
\fBupsstats.cgi\fR(8), \fBupsimage.cgi\fR(8)
233
.SS Internet resources:
234
The NUT (Network UPS Tools) home page: http://www.networkupstools.org/