File: upsstats.html.txt

package info (click to toggle)
nut 2.8.1-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 18,284 kB
  • sloc: ansic: 108,785; sh: 9,370; cpp: 3,370; makefile: 2,842; python: 1,029; perl: 763; xml: 47
file content (236 lines) | stat: -rw-r--r-- 6,746 bytes parent folder | download
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
UPSSTATS.HTML(5)
================

NAME
----

upsstats.html - HTML template for Network UPS Tools upsstats

DESCRIPTION
-----------

This file is used by linkman:upsstats.cgi[8] to generate status pages.
Certain commands are recognized, and will be replaced with various
status elements on the fly.

FORMATTING
----------

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

BLOCK CONTROL
-------------

Some commands begin blocks - sections of the template that will be
included, excluded, or repeated depending on certain parameters.

BLOCK CONTROL - ITERATION
~~~~~~~~~~~~~~~~~~~~~~~~~

*@FOREACHUPS@*::
Starts a block that will be repeated for each MONITOR directive in the
linkman:hosts.conf[5].  This is how you can generate pages that monitor
all of your systems simultaneously.

*@ENDFOR@*::
Ends a FOREACHUPS block.

BLOCK CONTROL - MATCHING SPECIFIC CASES
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

*@IFSUPP 'var'*@*::
Starts a block that will only be printed if the variable var is
supported by the current UPS.  This is generally used to suppress "not
supported" messages by avoiding the label and variable call entirely.

*@IFEQ* 'var' 'value'*@*::
Starts a block if the value returned from the variable 'var' matches
'value'.

*@IFBETWEEN* 'varlow' 'varhigh' 'varvalue'*@*::
Starts a block if the value returned by the variable 'varvalue' is between
the values returned by the variables 'varlow' and 'varhigh'.

*@ELSE@*::
If the previous IF-command did not match, perform this instead.

*@ENDIF@*::
Ends an IF/ELSE-block.

BLOCK CONTROL - ADVANCED EXPRESSIONS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Even though the parser is pretty limited, it's still possible to create
rather advanced expressions. The key to this is the fact that
multiple block control commands are AND:ed. This is illustrated with an
example (more examples are available in upsstats.html).

   @IFSUPP ambient.humidity@
   @IFSUPP ambient.temperature@
   This UPS knows both ambient temperature and humidity.
   @ELSE@
   @IFSUPP ambient.humidity@
   This UPS only knows ambient humidity.
   @ELSE@
   @IFSUPP ambient.temperature@
   This UPS only knows ambient temperature.
   @ELSE@
   This UPS knows nothing, how annoying.
   @ENDIF@

OTHER COMMANDS
--------------

*@AMBTEMP@*::
Insert the ambient temperature in the current temperature scale.

*@DATE* 'format'*@*::
Insert the current date and time.  The format string is passed to strftime,
so almost anything is possible.  See *strftime*(3) for possible values.

*@DEGREES@*::
Insert the entity for degrees (°) and either C or F depending on
the current temperature scale.

*@HOST@*::
Insert the designation of the host being monitored, like `myups@localhost`.

*@HOSTDESC@*::
Insert the host's description from linkman:hosts.conf[5].

*@HOSTLINK@*::
Insert a link to upsstats.cgi with the "host" variable set to the
current UPS.  This is only useful within a FOREACHUPS block.

*@IMG* 'varname' ['extra']*@*::
Insert an IMG SRC to linkman:upsimage.cgi[8] for one of these
status variables:

	battery.charge;; Battery charge - a percentage

	battery.voltage;; The charge on the battery in volts

	input.frequency;; Incoming utility frequency (Hz)

	input.voltage;; Incoming utility voltage

	input.L1-L2.voltage;; Incoming voltage, L1-L2 (3phase)

	input.L2-L3.voltage;; Incoming voltage, L2-L3 (3phase)

	input.L3-L1.voltage;; Incoming voltage, L3-L1 (3phase)

	output.frequency;; Outgoing utility frequency (Hz)

	output.voltage;; Outgoing voltage (from the UPS)

	output.L1-L2.voltage;; Outgoing voltage, L1-L2 (3phase)

	output.L2-L3.voltage;; Outgoing voltage, L2-L3 (3phase)

	output.L3-L1.voltage;; Outgoing voltage, L3-L1 (3phase)

	output.L1.power.percent;; UPS load, L1 (3phase)

	output.L2.power.percent;; UPS load, L2 (3phase)

	output.L3.power.percent;; UPS load, L3 (3phase)

	ups.load;; UPS load - percentage

	ups.temperature;; UPS temperature

'extra' is where you can put additional definitions.  Right now
the valid definitions are colors for various parts of the bars drawn
by upsimage.cgi.  Possible color names are:

	back_col;; background color

	scale_num_col;; scale number color

	summary_col;; summary color (number at the bottom)

	ok_zone_maj_col;; major scale color for the normal ("ok") zone

	ok_zone_min_col;; minor scale color for the normal ("ok") zone

	neutral_zone_maj_col;; major scale color for the neutral zone

	neutral_zone_min_col;; minor scale color for the neutral zone

	warn_zone_maj_col;; major scale color for the warning zone

	warn_zone_min_col;; minor scale color for the warning zone

	bar_col;; the color of the bar in the middle

All colors are hex triplets - 0xff0000 is red, 0x00ff00 is green, and
0x0000ff is blue.

Examples:

	@IMG battery.charge@
	@IMG battery.charge back_col=0xff00ff bar_col=0xaabbcc@
	@IMG input.voltage ok_zone_maj_col=0x123456@

*@REFRESH@*::
Insert the META header magic for refreshing the page if that variable
has been set by the browser.  This needs to be in the HEAD section of
the page.

*@STATUS@*::
Expand the abbreviations in the ups.status variable - OL becomes
"On line", OB becomes "On battery", and so on.

*@STATUSCOLOR@*::
Insert red, green, or yellow color triplets depending on the severity of
the current UPS status.  Normal operations are green, warnings like
voltage trim/boost or "off" are yellow, and other events like being on
battery or having a low battery are red.

*@VAR* 'varname'*@*::
Insert the current value of the status variable varname on the host being
monitored, or "Not supported".

*@RUNTIME@*::
Inserts the current runtime, in `hh:mm:ss` format.

*@TEMPC@*::
Use the Celsius scale for temperature data (default).

*@TEMPF@*::
Use the Fahrenheit scale for temperature data.

*@UPSTEMP@*::
Insert the UPS temperature in the current scale.

*@BATTTEMP@*::
Insert the battery temperature in the current scale.

*@UTILITYCOLOR@*::
Obsoleted. Use IFBETWEEN instead (see example in upsstats.html).

*@VERSION@*::
Insert the version number of the software.

OTHER TEMPLATES
---------------

linkman:upsstats.cgi[8] will also open a file called `upsstats-single.html`
if you call it with "host=" set in the URL.  That file uses the same
rules and techniques documented here.

SEE ALSO
--------

linkman:upsstats.cgi[8], linkman:upsimage.cgi[8]

Internet resources:
~~~~~~~~~~~~~~~~~~~

The NUT (Network UPS Tools) home page: https://www.networkupstools.org/