|
The configuration file consists of a series of statements, with each statement keyword followed by parameters separated by whitespace, and the statement terminated by either the end of the line or a '#' comment marker. Comments continue from the '#' to the end of the line.
Blank lines are permitted.
Parameters containing spaces may be quoted with double quotes. A parameter starting with '$' is translated through a symbol name. Note that only parameters starting with '$' will be recognised and the entire parameter replaced; to embed a symbol value in a parameter, use a set statement to construct a symbol first.
| $file | Current configuration file name |
| $masterfile | Configuration file name as specified on command line (or default) |
| $collector | Host name as specified in -h option, default system host name |
Symbols can be created using the set statement. This takes the form:
set <name> <data> ...
Note that each data element is appended together, thus set x a b c assigns ``abc'' to the symbol x.
Each non-blank line read from an include file is appended to the line preceding the '@'. For example, if the configuration file contains:
device ns1 object @ns1-objects end device
and the file ns1-objects contains
# Objects for ns1 ns1.eth0.in interfaces.ifTable.ifEntry.ifInOctets.1 ns1.eth0.out interfaces.ifTable.ifEntry.ifOutOctets.1
what is processed is:
device ns1 object ns1.eth0.in interfaces.ifTable.ifEntry.ifInOctets.1 object ns1.eth0.out interfaces.ifTable.ifEntry.ifOutOctets.1 end device
The if statement is in the form if <cond>, with <cond> defined as <parameter> <relop> <parameter> [<logop> <cond> ...]. <relop> can be one of:
| = | Equal to |
| != | Not equal to |
| < | Less than |
| > | Greater than |
| <= | Less than or equal to |
| >= | Greater than or equal to |
Note that all comparisons are strings, thus ``9'' is greater than ``10''; the comparison should be between ``09'' and ``10''.
<logop> can be one of and or or.
snmpmerge extends this model further for the -e (end time) option and aggregate intervals, in that when the interval is an exact multiple of a day, the interval is treated as days aligned at midnight local time rather than seconds, as seconds truncated to a multiple of 24 hours would result in days aligned at midnight GMT, not midnight local time. Note that this means that when daylight saving starts and ends, a "day" can be 23 or 25 hours (assuming a one hour daylight saving offset). The days number calculation is arranged so that if 7 days is requested, the week starts oat midnight Monday morning.
Additionally, if a multiple of 30 days is requested, it is treated as actual calendar months, not intervals of 30 days. That is, an interval of 90 days would indicate periods starting on 1 January, 1 April, 1 July and 1 October.
For example, to output files in the form out-YYYYMMDD-HHMM.dat, one could use out-%Y%m%d-%H%M.dat.
Common time substitution strings include:
| %d | Day of month, zero filled, e.g. 01, 31 |
| %H | Hour of day, zero-filled, e.g. 01, 23. |
| %m | Month of year, zero filled, e.g. 01, 12. |
| %M | Minute of hour, zero-filled, e.g. 00, 59. |
| %y | Two digit, zero-filled year, e.g. 00, 01, 99. |
| %Y | Four digit year, e.g. 1999, 2000. |
| %% | Insert a percent sign. |
For more information, see the Unix manual pages for strftime(3).
|