|
NAMEbsnmp-regex.conf —
the configuration file for the
bsnmp-regex(8)
module.
DESCRIPTIONThe bsnmp-regex SNMP module parses logs or other textual output and exposes the matched values as SNMP counters. Thebsnmp-regex.conf config file
contains definitions for the counters you want, and what text to match to
those counters.
Blank lines and lines starting with a '#' sign are ignored. COUNTERSTwo different kinds of counters are possible. Stat counters increment their value each time a match is made. Value counters contain the last matched value.A counter line constists of a name, a colon and a delimited regular expression: name: /match.*/ The name is used as the regexDescr SNMP value. A stat counter looks like the example above, and simply increments the regexInteger SNMP value each time a match is made. A value counter has a second part to it's regular expression, similar to a 'sed replace': name: /([0-9]+) degrees/\1/ The backslash-numeral refers to the regular expression group. \0 refers to the entire matched text. The resulting value is available in the regexString SNMP value. If the result is parseable as an integer, it is also available in the regexInteger SNMP value. OPTIONSThe file can contain options which change the behavior of the counters below that point. An option line consists of a name, an equals sign, and the value:option = value An option applies to all match lines below that point in the file.
EXAMPLESGiven a maillog output, this would make a counter for the number of messages relayed:relayed: /relay.* status=sent/ expires = 3600 lastuser: /sshd.* Accepted.* for ([^ ]+) from/\1/ SEE ALSObsnmp-regex(8) re_format(7)AUTHORStef Walter ⟨stef@memberwebs.com⟩
Visit the GSP FreeBSD Man Page Interface. |