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

FreeBSD Manual Pages

  
 
  

home | help
bsnmp-regex(8)		  BSD System Manager's Manual		bsnmp-regex(8)

NAME
     bsnmp-regex -- an SNMP module which produces counters from	logs or	other
     text

DESCRIPTION
     bsnmp-regex is a module for bsnmpd(1) which allows	you to make SNMP coun-
     ters from log files or other text.	For example you	could count the	number
     of	occurances of a	certain	string in a text file. You can also match spe-
     cific numbers or text to build SNMP values.

     bsnmp-regex has a configuration file which	contains regular expressions
     for the text you'd	like to	match. See bsnmp-regex.conf(5) for details on
     this file.

     bsnmp-regex opens a UNIX domain socket which text is piped	into. The text
     is	matched	line by	line against the regular expressions in	the configura-
     tion file and the appropriate counter or value is updated.	The sockin(1)
     utility is	useful for piping text into this socket.

MIBS
     The counters will be available as a table under the following MIB:

	    .1.3.6.1.4.1.12325.1.203

     Or	if the appropriate MIB.txt files have been installed:

	    enterprises.fokus.begemot.regex

     The following SNMP	MIBs are available for use (where X is the counter in-
     dex):

     regex.regexCount.0
		 The number of counters	available.

     regex.regexEntry.regexIndex.X
		 The index of the counter.

     regex.regexEntry.regexDescr.X
		 The description of the	counter.

     regex.regexEntry.regexLast.X
		 How long ago the counter was last updated.

     regex.regexEntry.regexInteger.X
		 The current value or counter as a integer.

     regex.regexEntry.regexString.X
		 The current value as a	string.

     regex.regexEntry.regexCounter.X
		 The current counter value as a	64 bit integer.

OPTIONS
     To	activate the bsnmp-regex module	you must load the module in
     /etc/snmpd.config and configure the location for the UNIX socket and
     bsnmp-regex.conf(5) file. See the examples	section	below.

     regexConfig
		 The location of the bsnmp-regex.conf(5) file. This option
		 must be specified.

     regexSocket
		 The location of the UNIX socket on which this module will
		 listen	for logs or text to match.

EXAMPLES
     For a simple bsnmp-regex configuration add	the following to
     /etc/snmpd.config:

	   begemotSnmpdModulePath."regex" = "/usr/local/lib/snmp_regex.so"
	   %regex
	   regexConfig = "/usr/local/etc/bsnmp-regex.conf"
	   regexSocket = "/var/run/bsnmp-regex.sock"

     For details on what /usr/local/etc/bsnmp-regex.conf should	contain, see
     the bsnmp-regex.conf(5) man page.

     To	pipe logs or text to match into	the socket use the sockin(1) utility,
     run something like	this:

	   # sockin /var/run/bsnmp-regex.sock tail -f /var/log/maillog

     To	have syslogd(8)	send all logs for matching add a line like this	to the
     /etc/syslog.conf file:

	   *.*	       | sockin	/var/run/bsnmp-regex.sock

SEE ALSO
     bsnmp-regex.conf(5), bsnmpd(1), sockin(1),	syslog.conf(5)

AUTHOR
     Stef Walter <stef@memberwebs.com>

bsnmp-regex			 July 8, 2020			   bsnmp-regex

NAME | DESCRIPTION | MIBS | OPTIONS | EXAMPLES | SEE ALSO | AUTHOR

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=bsnmp-regex&sektion=8&manpath=FreeBSD+12.1-RELEASE+and+Ports>

home | help