GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
bsnmp-regex(8) FreeBSD System Manager's Manual bsnmp-regex(8)

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

bsnmp-regex is a module for bsnmpd(1) which allows you to make SNMP counters 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 specific 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 configuration file and the appropriate counter or value is updated. The sockin(1) utility is useful for piping text into this socket.

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 index):

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.

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.

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

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

Stef Walter ⟨stef@memberwebs.com⟩
April, 2006 bsnmp-regex

Search for    or go to Top of page |  Section 8 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.