upsstats.html - HTML template for Network UPS Tools upsstats
This file is used by upsstats.cgi(8) to generate status pages. Certain commands are recognized, and will be replaced with various status elements on the fly.
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.
Some commands begin blocks - sections of the template that will be included, excluded, or repeated depending on certain parameters.
BLOCK CONTROL - ITERATION
BLOCK CONTROL - MATCHING SPECIFIC CASES
@IFEQ var value@
@IFBETWEEN varlow varhigh varvalue@
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@
@IMG varname @
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:
All colors are hex triplets - 0xff0000 is red, 0x00ff00 is green, and 0x0000ff is blue.
@IMG battery.charge@ @IMG battery.charge back_col=0xff00ff bar_col=0xaabbcc@ @IMG input.voltage ok_zone_maj_col=0x123456@
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.
The NUT (Network UPS Tools) home page: https://www.networkupstools.org/
|11/01/2023||Network UPS Tools 2.8.1|