blob: 047d5293d0621e25740546b1baaf94d90259215e [file] [log] [blame]
#
# Many people have requested better examples of the configuration
# file, so here it is. You can stick the file straight into the
# proper place (PREFIX/lib/snmp/snmpd.conf) and run all the commands
# I talk about below.
# - Wes
#
# Note: This file is automatically generated from EXAMPLE.conf.def.
# Do NOT read this till after you have run configure & make, and then
# make sure you read EXAMPLE.conf instead. It will tailor itself to
# your configuration.
# All lines beginning with a '#' are comments and are intended for you
# to read. All other lines are configuration commands for the agent.
#
# Process checks.
#
# The following are examples of how to use the agent to check for
# processes running on the host. The syntax looks something like:
#
# proc NAME [MAX=0] [MIN=0]
#
# NAME: the name of the process to check for. It must match
# exactly (ie, http will not find httpd processes).
# MAX: the maximum number allowed to be running. Defaults to 0.
# MIN: the minimum number to be running. Defaults to 0.
#
# Examples:
#
# Make sure mountd is running
proc mountd
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
proc ntalkd 4
# Make sure at least one sendmail, but less than or equal to 10 are running.
proc sendmail 10 1
# A snmpwalk of the process mib tree would look something like this:
#
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.PROCMIBNUM
# local.Processes.processIndex.1 = 1
# local.Processes.processIndex.2 = 2
# local.Processes.processIndex.3 = 3
# local.Processes.processNames.1 = "mountd"
# local.Processes.processNames.2 = "ntalkd"
# local.Processes.processNames.3 = "sendmail"
# local.Processes.processMin.1 = 0
# local.Processes.processMin.2 = 0
# local.Processes.processMin.3 = 1
# local.Processes.processMax.1 = 0
# local.Processes.processMax.2 = 4
# local.Processes.processMax.3 = 10
# local.Processes.processCount.1 = 0
# local.Processes.processCount.2 = 0
# local.Processes.processCount.3 = 1
# local.Processes.processErrorFlag.1 = 1
# local.Processes.processErrorFlag.2 = 0
# local.Processes.processErrorFlag.3 = 0
# local.Processes.processErrMessage.1 = "No mountd process running."
# local.Processes.processErrMessage.2 = ""
# local.Processes.processErrMessage.3 = ""
# local.Processes.processErrFix.1 = 0
# local.Processes.processErrFix.2 = 0
# local.Processes.processErrFix.3 = 0
#
# Note that the errorFlag for mountd is set to 1 because one is not
# running (in this case an rpc.mountd is, but thats not good enough),
# and the ErrMessage tells you what's wrong. The configuration
# imposed in the snmpd.conf file is also shown.
#
# Special Case: When the min and max numbers are both 0, it assumes
# you want a max of infinity and a min of 1.
#
# ----------------------------------------------------------------------
#
# Executables/scripts
#
#
# You can also have programs run by the agent that return a single
# line of output and an exit code. Here are two examples.
#
# exec NAME PROGRAM [ARGS ...]
#
# NAME: A generic name.
# PROGRAM: The program to run. Include the path!
# ARGS: optional arguments to be passed to the program
# a simple hello world
exec echotest /bin/echo hello world
# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note: this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do. Uncomment to use it.
#
#exec shelltest /bin/sh /tmp/shtest
# Then,
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.SHELLMIBNUM
# local.Extensible.extensibleIndex.1 = 1
# local.Extensible.extensibleIndex.2 = 2
# local.Extensible.extensibleNames.1 = "echotest"
# local.Extensible.extensibleNames.2 = "shelltest"
# local.Extensible.extensibleCommand.1 = "/bin/echo hello world"
# local.Extensible.extensibleCommand.2 = "/bin/sh /tmp/shtest"
# local.Extensible.extensibleResult.1 = 0
# local.Extensible.extensibleResult.2 = 35
# local.Extensible.extensibleOutput.1 = "hello world."
# local.Extensible.extensibleOutput.2 = "hello world."
# local.Extensible.extensibleErrFix.1 = 0
# local.Extensible.extensibleErrFix.2 = 0
# Note that the second line of the /tmp/shtest shell script is cut
# off. Also note that the exit status of 35 was returned.
# ----------------------------------------------------------------------
#
# disk checks
#
# The agent can check the amount of available disk space, and make
# sure it is above a set limit.
# disk PATH [MIN=DEFDISKMINIMUMSPACE]
#
# PATH: mount path to the disk in question.
# MIN: Disks with space below this value will have the Mib's errorFlag set.
# Default value = DEFDISKMINIMUMSPACE.
# Check the / partition and make sure it contains at least 10 megs.
disk / 10000
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.DISKMIBNUM
# local.Disk.diskIndex.1 = 0
# local.Disk.diskPath.1 = "/" Hex: 2F
# local.Disk.diskDevice.1 = "/dev/dsk/c201d6s0"
# local.Disk.diskMinimum.1 = 10000
# local.Disk.diskTotal.1 = 837130
# local.Disk.diskAvail.1 = 316325
# local.Disk.diskUsed.1 = 437092
# local.Disk.diskPercent.1 = 58
# local.Disk.diskErrorFlag.1 = 0
# local.Disk.diskErrorMsg.1 = ""
# ----------------------------------------------------------------------
#
# load average checks
#
# load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE]
#
# 1MAX: If the 1 minute load average is above this limit at query
# time, the errorFlag will be set.
# 5MAX: Similar, but for 5 min average.
# 15MAX: Similar, but for 15 min average.
# Check for loads:
load 12 14 14
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.LOADAVEMIBNUM
# local.Loadaves.loadaveIndex.1 = 1
# local.Loadaves.loadaveIndex.2 = 2
# local.Loadaves.loadaveIndex.3 = 3
# local.Loadaves.loadaveNames.1 = "Load-1"
# local.Loadaves.loadaveNames.2 = "Load-5"
# local.Loadaves.loadaveNames.3 = "Load-15"
# local.Loadaves.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39
# local.Loadaves.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31
# local.Loadaves.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36
# local.Loadaves.loadaveConfig.1 = "12.00"
# local.Loadaves.loadaveConfig.2 = "14.00"
# local.Loadaves.loadaveConfig.3 = "14.00"
# local.Loadaves.loadaveErrorFlag.1 = 0
# local.Loadaves.loadaveErrorFlag.2 = 0
# local.Loadaves.loadaveErrorFlag.3 = 0
# local.Loadaves.loadaveErrMessage.1 = ""
# local.Loadaves.loadaveErrMessage.2 = ""
# local.Loadaves.loadaveErrMessage.3 = ""
# ----------------------------------------------------------------------
#
# snmp agent errors
#
# This mib merely reports agent problems. Typically this happens when
# the file/process table gets full or when it can't fork due to
# memory. Even if you can't log in to the machine, this mib might
# tell you the cause. Note that problems are cleared every
# ERRORTIMELENGTH seconds.
# Here's an example of a badly configured disk check:
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.ERRORMIBNUM
# local.Snmperrs.snmperrIndex.1 = 1
# local.Snmperrs.snmperrNames.1 = "snmp" Hex: 73 6E 6D 70
# local.Snmperrs.snmperrErrorFlag.1 = 1
# local.Snmperrs.snmperrErrMessage.1 = "open dev/disk: No such file or directory"
# ----------------------------------------------------------------------
#
# snmp version mib
#
# a convenience mib. It will inform you of the current ucd-snmp version
# you are running. Additionally, it has a couple settable values:
#
# .EXTENSIBLEDOTMIB.VERSIONMIBNUM.VERCLEARCACHE:
# If set to 1: Clears the output cache. (the agent caches the
# output of all programs run to speed up mib access).
#
# .EXTENSIBLEDOTMIB.VERSIONMIBNUM.VERUPDATECONFIG:
# If set to 1: the agent will re-read the configuration file(s).
#
# .EXTENSIBLEDOTMIB.VERSIONMIBNUM.VERRESTARTAGENT:
# If set to 1: restart the agent.
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.VERSIONMIBNUM
# local.Version.versionIndex.1 = 1
# local.Version.versionTag.1 = "3.1"
# local.Version.versionDate.1 = "$Date$"
# local.Version.versionCDate.1 = "Fri May 24 12:49:40 1996."
# local.Version.versionIdent.1 = "$Id$"
# ----------------------------------------------------------------------
#
# Extensible sections.
#
# This alleviates the multiple line output problem found in the
# previous executable mib by placing each mib in its own mib table:
# Run a shell script containing:
#
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
#
# Note: this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do. Uncomment to use it.
#
# exec .EXTENSIBLEDOTMIB.50 shelltest /bin/sh /tmp/shtest
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.50
# local.50.1.1 = 1
# local.50.2.1 = "shelltest"
# local.50.3.1 = "/bin/sh /tmp/shtest"
# local.50.100.1 = 35
# local.50.101.1 = "hello world."
# local.50.101.2 = "hi there."
# local.50.102.1 = 0
# Now the Output has grown to two lines, and we can see the 'hi
# there.' output as the second line from our shell script.
#
# Note that you must alter the mib.txt file to be correct if you want
# the .50.* outputs above to change to reasonable text descriptions.
# Other ideas:
#
# exec .EXTENSIBLEDOTMIB.51 ps /bin/ps
# exec .EXTENSIBLEDOTMIB.52 top /usr/local/bin/top
# exec .EXTENSIBLEDOTMIB.53 mailq /usr/bin/mailq
# ----------------------------------------------------------------------
#
# Pass through control.
#
# Usage:
# pass MIBOID EXEC-COMMAND
#
# This will pass total control of the mib underneath the MIBOID
# portion of the mib to the EXEC-COMMAND.
#
# Note: You'll have to change the path of the passtest script to your
# source directory or install it in the given location.
#
# Example: (see the script for details)
#
pass .EXTENSIBLEDOTMIB.255 /bin/sh PREFIX/local/passtest
# % snmpwalk -v 1 localhost public .EXTENSIBLEDOTMIB.255
# local.255.1 = "life the universe and everything"
# local.255.2.1 = 42
# local.255.2.2 = OID: 42.42.42
# local.255.3 = Timeticks: (363136200) 42 days, 0:42:42
# local.255.4 = IpAddress: 127.0.0.1
# local.255.5 = 42
# local.255.6 = Gauge: 42
#
# % snmpget -v 1 localhost public .EXTENSIBLEDOTMIB.255.5
# local.255.5 = 42
#
# % snmpset -v 1 localhost private .EXTENSIBLEDOTMIB.255.1 s "New string"
# local.255.1 = "New string"
#
# Note: For snmpset requests you must use the 'private' community
# name, or else community number 2 as defined in the snmpd.conf
# file like the following line:
#
# community 2 new-private
# For specific usage information, see the man/snmpd.conf.5 manual page
# as well as the local/passtest script used in the above example.
# ----------------------------------------------------------------------
#
# System contact information
#
# It is also possible to set the sysContact and sysLocation system
# variables through the snmpd.conf file:
syslocation Right here, right now.
syscontact Me <me@somewhere.org>
# % snmpwalk -v 1 localhost public system
# system.sysDescr.0 = "SunOS name sun4c"
# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4
# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55
# system.sysContact.0 = "Me <me@somewhere.org>"
# system.sysName.0 = "name"
# system.sysLocation.0 = "Right here, right now."
# system.sysServices.0 = 72
# ----------------------------------------------------------------------