DESCRIPTION

       This file is used by upsstats.cgi(8) to generate status pages.  Certain
       commands are recognized, and will be replaced with various status  ele-
       ments on the fly.



FORMATTING

       All commands must be alone on a line, and start and end with @.  A line
       that has any extra characters before or after  the  @  will  be  passed
       through unchanged.



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  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 sup-
              press "not supported" messages by avoiding the label  and  vari-
              able 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.

       @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 depend-
              ing on the current temperature scale.


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


       @HOSTDESC@
              Insert the host's description from 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 upsimage.cgi(8) for one of these status
                   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.


       @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.


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


       @VERSION@
              Insert the version number of the software.



OTHER TEMPLATES

       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

       upsstats.cgi(8), upsimage.cgi(8)

Man(1) output converted with man2html