1upsstats.html(5) Network UPS Tools (NUT) upsstats.html(5)
2
3
4
6 upsstats.html - HTML template for Network UPS Tools upsstats
7
8
10 This file is used by upsstats.cgi(8) to generate status pages. Certain
11 commands are recognized, and will be replaced with various status ele‐
12 ments on the fly.
13
14
16 All commands must be alone on a line, and start and end with @. A line
17 that has any extra characters before or after the @ will be passed
18 through unchanged.
19
20
22 Some commands begin blocks - sections of the template that will be
23 included, excluded, or repeated depending on certain parameters.
24
25
27 @FOREACHUPS@
28 Starts a block that will be repeated for each MONITOR directive
29 in the hosts.conf(5). This is how you can generate pages that
30 monitor all of your systems simultaneously.
31
32
33 @ENDFOR@
34 Ends a FOREACHUPS block.
35
36
38 @IFSUPP var@
39 Starts a block that will only be printed if the variable var is
40 supported by the current UPS. This is generally used to sup‐
41 press "not supported" messages by avoiding the label and vari‐
42 able call entirely.
43
44
45 @IFEQ var value@
46 Starts a block if the value returned from the variable var
47 matches value.
48
49
50 @IFBETWEEN varlow varhigh varvalue@
51 Starts a block if the value returned by the variable varvalue is
52 between the values returned by the variables varlow and varhigh.
53
54
55 @ELSE@ If the previous IF-command did not match, perform this instead.
56
57
58 @ENDIF@
59 Ends an IF/ELSE-block.
60
61
63 Even though the parser is pretty limited, it's still possible to create
64 rather advanced expressions. The key to this is the fact that multiple
65 block control commands are AND:ed. This is illustrated with an example
66 (more examples are available in upsstats.html).
67
68 @IFSUPP ambient.humidity@
69
70 @IFSUPP ambient.temperature@
71
72 This UPS knows both ambient temperature and humidity.
73
74 @ELSE@
75
76 @IFSUPP ambient.humidity@
77
78 This UPS only knows ambient humidity.
79
80 @ELSE@
81
82 @IFSUPP ambient.temperature@
83
84 This UPS only knows ambient temperature.
85
86 @ELSE
87
88 This UPS knows nothing, how annoying.
89
90 @ENDIF@
91
92
94 @AMBTEMP@
95 Insert the ambient temperature in the current temperature scale.
96
97
98 @DATE format@
99 Insert the current date and time. The format string is passed
100 to strftime, so almost anything is possible. See strftime(3)
101 for possible values.
102
103
104 @DEGREES@
105 Insert the entity for degrees (°) and either C or F depend‐
106 ing on the current temperature scale.
107
108
109 @HOST@ Insert the designation of the host being monitored, like
110 myups@localhost.
111
112
113 @HOSTDESC@
114 Insert the host's description from hosts.conf(5).
115
116
117 @HOSTLINK@
118 Insert a link to upsstats.cgi with the "host" variable set to
119 the current UPS. This is only useful within a FOREACHUPS block.
120
121
122 @IMG varname [extra]@
123 Insert an IMG SRC to upsimage.cgi(8) for one of these status
124 variables:
125
126 battery.charge - Battery charge - a percentage
127
128 battery.voltage - The charge on the battery in volts
129
130 input.frequency - Incoming utility frequency (Hz)
131
132 input.voltage - Incoming utility voltage
133
134 input.L1-L2.voltage - Incoming voltage, L1-L2 (3phase)
135
136 input.L2-L3.voltage - Incoming voltage, L2-L3 (3phase)
137
138 input.L3-L1.voltage - Incoming voltage, L3-L1 (3phase)
139
140 output.frequency - Outgoing utility frequency (Hz)
141
142 output.voltage - Outgoing voltage (from the UPS)
143
144 output.L1-L2.voltage - Outgoing voltage, L1-L2 (3phase)
145
146 output.L2-L3.voltage - Outgoing voltage, L2-L3 (3phase)
147
148 output.L3-L1.voltage - Outgoing voltage, L3-L1 (3phase)
149
150 output.L1.power.percent - UPS load, L1 (3phase)
151
152 output.L2.power.percent - UPS load, L2 (3phase)
153
154 output.L3.power.percent - UPS load, L3 (3phase)
155
156 ups.load - UPS load - percentage
157
158 ups.temperature - UPS temperature
159
160 extra is where you can put additional definitions. Right now
161 the valid definitions are colors for various parts of the bars
162 drawn by upsimage.cgi. Possible color names are:
163
164 back_col - background color
165
166 scale_num_col - scale number color
167
168 summary_col - summary color (number at the bottom)
169
170 ok_zone_maj_col - major scale color for the normal
171 ("ok") zone
172
173 ok_zone_min_col - minor scale color for the normal
174 ("ok") zone
175
176 neutral_zone_maj_col - major scale color for the neutral
177 zone
178
179 neutral_zone_min_col - minor scale color for the neutral
180 zone
181
182 warn_zone_maj_col - major scale color for the warning zone
183
184 warn_zone_min_col - minor scale color for the warning zone
185
186 bar_col - the color of the bar in the middle
187
188 All colors are hex triplets - 0xff0000 is red, 0x00ff00 is
189 green, and 0x0000ff is blue.
190
191 Examples:
192
193 @IMG battery.charge@
194
195 @IMG battery.charge back_col=0xff00ff bar_col=0xaabbcc@
196
197 @IMG input.voltage ok_zone_maj_col=0x123456@
198
199
200 @REFRESH@
201 Insert the META header magic for refreshing the page if that
202 variable has been set by the browser. This needs to be in the
203 HEAD section of the page.
204
205
206 @STATUS@
207 Expand the abbreviations in the ups.status variable - OL becomes
208 "On line", OB becomes "On battery", and so on.
209
210
211 @STATUSCOLOR@
212 Insert red, green, or yellow color triplets depending on the
213 severity of the current UPS status. Normal operations are
214 green, warnings like voltage trim/boost or "off" are yellow, and
215 other events like being on battery or having a low battery are
216 red.
217
218
219 @VAR varname@
220 Insert the current value of the status variable varname on the
221 host being monitored, or "Not supported".
222
223
224 @RUNTIME@
225 Inserts the current runtime, in hh:mm:ss format.
226
227
228 @TEMPC@
229 Use the Celsius scale for temperature data (default).
230
231
232 @TEMPF@
233 Use the Fahrenheit scale for temperature data.
234
235
236 @UPSTEMP@
237 Insert the UPS temperature in the current scale.
238
239
240 @UTILITYCOLOR@
241 Obsoleted. Use IFBETWEEN instead (see example in upsstats.html).
242
243
244 @VERSION@
245 Insert the version number of the software.
246
247
249 upsstats.cgi(8) will also open a file called upsstats-single.html if
250 you call it with "host=" set in the URL. That file uses the same rules
251 and techniques documented here.
252
253
255 upsstats.cgi(8), upsimage.cgi(8)
256
257
258 Internet resources:
259 The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
260
261
262
263 Thu Feb 9 2006 upsstats.html(5)