1UPSSTATS.HTML(5)                  NUT Manual                  UPSSTATS.HTML(5)
2
3
4

NAME

6       upsstats.html - HTML template for Network UPS Tools upsstats
7

DESCRIPTION

9       This file is used by upsstats.cgi(8) to generate status pages. Certain
10       commands are recognized, and will be replaced with various status
11       elements on the fly.
12

FORMATTING

14       Commands can be placed anywhere on a line, but must start and end with
15       @. Any extra characters before or after the commands will be passed
16       through unchanged. It is allowed to use more than one command on a
17       single line, as long as each command has its own start and end
18       character. If you need to use the @ sign, use @ to prevent it from
19       being treated as a start character.
20

BLOCK CONTROL

22       Some commands begin blocks - sections of the template that will be
23       included, excluded, or repeated depending on certain parameters.
24
25   BLOCK CONTROL - ITERATION
26       @FOREACHUPS@
27           Starts a block that will be repeated for each MONITOR directive in
28           the hosts.conf(5). This is how you can generate pages that monitor
29           all of your systems simultaneously.
30
31       @ENDFOR@
32           Ends a FOREACHUPS block.
33
34   BLOCK CONTROL - MATCHING SPECIFIC CASES
35       @IFSUPP var@*
36           Starts a block that will only be printed if the variable var is
37           supported by the current UPS. This is generally used to suppress
38           "not supported" messages by avoiding the label and variable call
39           entirely.
40
41       @IFEQ var value@
42           Starts a block if the value returned from the variable var matches
43           value.
44
45       @IFBETWEEN varlow varhigh varvalue@
46           Starts a block if the value returned by the variable varvalue is
47           between the values returned by the variables varlow and varhigh.
48
49       @ELSE@
50           If the previous IF-command did not match, perform this instead.
51
52       @ENDIF@
53           Ends an IF/ELSE-block.
54
55   BLOCK CONTROL - ADVANCED EXPRESSIONS
56       Even though the parser is pretty limited, it’s still possible to create
57       rather advanced expressions. The key to this is the fact that multiple
58       block control commands are AND:ed. This is illustrated with an example
59       (more examples are available in upsstats.html).
60
61           @IFSUPP ambient.humidity@
62           @IFSUPP ambient.temperature@
63           This UPS knows both ambient temperature and humidity.
64           @ELSE@
65           @IFSUPP ambient.humidity@
66           This UPS only knows ambient humidity.
67           @ELSE@
68           @IFSUPP ambient.temperature@
69           This UPS only knows ambient temperature.
70           @ELSE@
71           This UPS knows nothing, how annoying.
72           @ENDIF@
73

OTHER COMMANDS

75       @AMBTEMP@
76           Insert the ambient temperature in the current temperature scale.
77
78       @DATE format@
79           Insert the current date and time. The format string is passed to
80           strftime, so almost anything is possible. See strftime(3) for
81           possible values.
82
83       @DEGREES@
84           Insert the entity for degrees (°) and either C or F depending on
85           the current temperature scale.
86
87       @HOST@
88           Insert the designation of the host being monitored, like
89           myups@localhost.
90
91       @HOSTDESC@
92           Insert the hout’s description from hosts.conf(5).
93
94       @HOSTLINK@
95           Insert a link to upsstats.cgi with the "host" variable set to the
96           current UPS. This is only useful within a FOREACHUPS block.
97
98       @IMG varname @
99           Insert an IMG SRC to upsimage.cgi(8) for one of these status
100           variables:
101
102           battery.charge
103               Battery charge - a percentage
104
105           battery.voltage
106               The charge on the battery in volts
107
108           input.frequency
109               Incoming utility frequency (Hz)
110
111           input.voltage
112               Incoming utility voltage
113
114           input.L1-L2.voltage
115               Incoming voltage, L1-L2 (3phase)
116
117           input.L2-L3.voltage
118               Incoming voltage, L2-L3 (3phase)
119
120           input.L3-L1.voltage
121               Incoming voltage, L3-L1 (3phase)
122
123           output.frequency
124               Outgoing utility frequency (Hz)
125
126           output.voltage
127               Outgoing voltage (from the UPS)
128
129           output.L1-L2.voltage
130               Outgoing voltage, L1-L2 (3phase)
131
132           output.L2-L3.voltage
133               Outgoing voltage, L2-L3 (3phase)
134
135           output.L3-L1.voltage
136               Outgoing voltage, L3-L1 (3phase)
137
138           output.L1.power.percent
139               UPS load, L1 (3phase)
140
141           output.L2.power.percent
142               UPS load, L2 (3phase)
143
144           output.L3.power.percent
145               UPS load, L3 (3phase)
146
147           ups.load
148               UPS load - percentage
149
150           ups.temperature
151               UPS temperature
152
153       extra is where you can put additional definitions. Right now the valid
154       definitions are colors for various parts of the bars drawn by
155       upsimage.cgi. Possible color names are:
156
157       back_col
158           background color
159
160       scale_num_col
161           scale number color
162
163       summary_col
164           summary color (number at the bottom)
165
166       ok_zone_maj_col
167           major scale color for the normal ("ok") zone
168
169       ok_zone_min_col
170           minor scale color for the normal ("ok") zone
171
172       neutral_zone_maj_col
173           major scale color for the neutral zone
174
175       neutral_zone_min_col
176           minor scale color for the neutral zone
177
178       warn_zone_maj_col
179           major scale color for the warning zone
180
181       warn_zone_min_col
182           minor scale color for the warning zone
183
184       bar_col
185           the color of the bar in the middle
186
187       All colors are hex triplets - 0xff0000 is red, 0x00ff00 is green, and
188       0x0000ff is blue.
189
190       Examples:
191
192           @IMG battery.charge@
193           @IMG battery.charge back_col=0xff00ff bar_col=0xaabbcc@
194           @IMG input.voltage ok_zone_maj_col=0x123456@
195
196       @REFRESH@
197           Insert the META header magic for refreshing the page if that
198           variable has been set by the browser. This needs to be in the HEAD
199           section of the page.
200
201       @STATUS@
202           Expand the abbreviations in the ups.status variable - OL becomes
203           "On line", OB becomes "On battery", and so on.
204
205       @STATUSCOLOR@
206           Insert red, green, or yellow color triplets depending on the
207           severity of the current UPS status. Normal operations are green,
208           warnings like voltage trim/boost or "off" are yellow, and other
209           events like being on battery or having a low battery are red.
210
211       @VAR varname@
212           Insert the current value of the status variable varname on the host
213           being monitored, or "Not supported".
214
215       @RUNTIME@
216           Inserts the current runtime, in hh:mm:ss format.
217
218       @TEMPC@
219           Use the Celsius scale for temperature data (default).
220
221       @TEMPF@
222           Use the Fahrenheit scale for temperature data.
223
224       @UPSTEMP@
225           Insert the UPS temperature in the current scale.
226
227       @BATTTEMP@
228           Insert the battery temperature in the current scale.
229
230       @UTILITYCOLOR@
231           Obsoleted. Use IFBETWEEN instead (see example in upsstats.html).
232
233       @VERSION@
234           Insert the version number of the software.
235

OTHER TEMPLATES

237       upsstats.cgi(8) will also open a file called upsstats-single.html if
238       you call it with "host=" set in the URL. That file uses the same rules
239       and techniques documented here.
240

SEE ALSO

242       upsstats.cgi(8), upsimage.cgi(8)
243
244   Internet resources:
245       The NUT (Network UPS Tools) home page: http://www.networkupstools.org/
246
247
248
249Network UPS Tools 2.7.3.          03/02/2016                  UPSSTATS.HTML(5)
Impressum