📄 snmpd.conf
字号:
# 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 -c public localhost .1.3.6.1.4.1.2021.8# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest"# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest"# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world"# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest"# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world."# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world."# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0# enterprises.ucdavis.extTable.extEntry.extErrFix.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 -c public localhost .1.3.6.1.4.1.2021.9# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F # enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0"# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0# enterprises.ucdavis.diskTable.dskEntry.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 -c public localhost .1.3.6.1.4.1.2021.10# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1"# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5"# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15"# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39 # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31 # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36 # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00"# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00"# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00"# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = ""# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = ""# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = ""# -----------------------------------------------------------------------------################################################################################ 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 .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50# enterprises.ucdavis.50.1.1 = 1# enterprises.ucdavis.50.2.1 = "shelltest"# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"# enterprises.ucdavis.50.100.1 = 35# enterprises.ucdavis.50.101.1 = "hello world."# enterprises.ucdavis.50.101.2 = "hi there."# enterprises.ucdavis.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 .1.3.6.1.4.1.2021.51 ps /bin/ps # exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top# exec .1.3.6.1.4.1.2021.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)# (commented out here since it requires that you place the# script in the right location. (its not installed by default))# pass .1.3.6.1.4.1.2021.255 /bin/sh PREFIX/local/passtest# % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255# enterprises.ucdavis.255.1 = "life the universe and everything"# enterprises.ucdavis.255.2.1 = 42# enterprises.ucdavis.255.2.2 = OID: 42.42.42# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1# enterprises.ucdavis.255.5 = 42# enterprises.ucdavis.255.6 = Gauge: 42## % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5# enterprises.ucdavis.255.5 = 42## % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string"# enterprises.ucdavis.255.1 = "New string"## For specific usage information, see the man/snmpd.conf.5 manual page# as well as the local/passtest script used in the above example.################################################################################ Subagent control## The agent can support subagents using a number of extension mechanisms.# From the 4.2.1 release, AgentX support is being compiled in by default.# However, this is still experimental code, so should not be used on# critical production systems.# Please see the file README.agentx for more details.## If having read, marked, learnt and inwardly digested this information,# you decide that you do wish to make use of this mechanism, simply# uncomment the following directive.## master agentx## I repeat - this is *NOT* regarded as suitable for front-line production# systems, though it is probably stable enough for day-to-day use.# Probably.## No refunds will be given.################################################################################ Further Information## See the snmpd.conf manual page, and the output of "snmpd -H".# MUCH more can be done with the snmpd.conf than is shown as an# example here.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -