Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
bsnmp-regex.conf(5)	      File Formats Manual	   bsnmp-regex.conf(5)

NAME
       bsnmp-regex.conf	 -- the	configuration file for the bsnmp-regex(8) mod-
       ule.

DESCRIPTION
       The bsnmp-regex SNMP module parses logs or other	textual	output and ex-
       poses the matched values	as SNMP	counters. The bsnmp-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.

COUNTERS
       Two 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 ex-
       pression:

	     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.

OPTIONS
       The 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.

       expires	   This	option is the amount of	time (in seconds) after	 which
		   to  expire a	counter	if no new values have come in. This is
		   mostly useful for stat counters.

EXAMPLES
       Given a maillog output, this would make a counter  for  the  number  of
       messages	relayed:

	     relayed: /relay.* status=sent/
       This would set the counter to the last user that	logged into the	system
       over the	past hour:

	     expires = 3600
	     lastuser: /sshd.* Accepted.* for ([^ ]+) from/\1/

SEE ALSO
       bsnmp-regex(8) re_format(7)

AUTHOR
       Stef Walter <stef@memberwebs.com>

bsnmp-regex			  April, 2006		   bsnmp-regex.conf(5)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=bsnmp-regex.conf&sektion=5&manpath=FreeBSD+Ports+15.0>

home | help