-
oid
This fetches an SNMP value into a datapage variable. The command looks like:
oid VARNAME HOSTNAME OIDNAME
The VARNAME
is the name of the datapage variable (let's just call
them variables from now on).
The HOSTNAME
is the name of the host
to query. The SNMP community-string is usually supplied in
that host's config-file, but can be supplied in usual MRTG fashion by
giving COMMUNITY@HOSTNAME
or even COMMUNITY@HOSTNAME:PORTNUMBER
instead of the HOSTNAME
.
The OIDNAME
must be defined in the
oids config-file, but can be suffixed by the usual
numbers. E.G. you can use ifName.4 to get the ifName for interface 4.
-
rrd
This fetches a value from an RRD database into a variable. It looks like:
rrd VARNAME HOSTNAME RRDNAME DSNAME CF
The RRDNAME
is the name of the rrd, as remstats knows it, not fully
qualified. I.E. it will be under the config-file defined datadir
,
and under the host's directory under that.
The DSNAME
is the ds-name within that RRD file and the CF
is the usual RRD consolidation-function to be applied.
-
status
This is so-named because it fetches remstats status files, usually written
by the various collectors and monitors. It looks like:
status VARNAME HOSTNAME STATUSNAME
The STATUSNAME
is the name of the status file, as named in the
host's data directory. There is a standard mapping applied by the
function to_filename
from the remstats.pl</t
file to
munge the filename so that it won't conflict with the filesystem. Either
look for the name in the data directory, use the function (see eval) or
look at the code. I am planning on changing the mapping when I
figure out the best way to do it.
-
eval
The eval command lets you modify the values fetched by previous oid
,
rrd
, status
and eval
commands with arbitrary perl code.
It looks like:
eval VARNAME PERLEXPRESSION
The PERLEXPRESSION
is a perl expression and can be arbitrarily complex,
but gets messy quickly with the datapage.cgi
and perl both doing variable
interpolation.
Note: datapage.cgi
uses private.pl, so you can include commonly
used functions here to make your datapage creation easier.
-
debug
The debug
command takes a number which is the level to set debugging to.
It causes extra output which may be helpful in figuring out why your page
isn't working the way you expected.
-
alertstatus
This lets you fetch the alert level for a given (host, rrd, dsname, cf)
combination. The command looks like:
alertstatus VARNAME HOSTNAME RRDNAME DSNAME [CF]
This will fetch the alert status and put it in the datapage variable VARNAME
.
The status will be the same set of values shown on the alerts report
for status.
The CF
parameter is optional and is rrdtool's consolidation function.
It will be set to AVERAGE
if it's not supplied.
-
alertvalue
This is the same as alertstatus
except that it sets the variable to the
current value of the (host, rrd, variable, cf) combination.