- 论坛徽章:
- 0
|
目前是
snmpd服务在运行中
# ps -ef|grep snmpd
snmp 2777 1 0 17:34 ? 00:00:00 /usr/sbin/snmpd -Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid
root 3006 13466 0 17:37 pts/1 00:00:00 grep snmpd
iptables防护墙关闭中
# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
配置文件内容如下
# vim /etc/snmp/snmpd.conf
agentAddress udp:127.0.0.1:161
access notConfigGroup "" any noauth exact all none none
com2sec notConfigUser 192.168.0.0/24 lc20122public
com2sec *.*.*.0 192.168.0.0/24 lc20122public
# system + hrSystem groups only
view systemonly included .1.3.6.1.2.1
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
view all included .1 80
# Full access from the local host
# Default access to basic system info
rocommunity public default -V systemonly
# Full access from an example network
# Adjust this network address to match your local
# settings, change the community string,
# and check the 'agentAddress' setting above
# Full read-only access for SNMPv3
rouser authOnlyUser
# Full write access for encrypted requests
# Remember to activate the 'createUser' lines above
sysLocation Sitting on the Dock of the Bay
sysContact Me <me@example.org>
# Application + End-to-End layers
sysServices 72
# At least one 'mountd' process
proc mountd
# No more than 4 'ntalkd' processes - 0 is OK
proc ntalkd 4
# At least one 'sendmail' process, but no more than 10
proc sendmail 10 1
# 10MBs required on root disk, 5% free on /var, 10% free on all other disks
disk / 10000
disk /var 5%
includeAllDisks 10%
# Unacceptable 1-, 5-, and 15-minute load averages
load 12 10 5
# send SNMPv1 traps
trapsink localhost public
# send SNMPv2c traps
# send SNMPv2c INFORMs
# Remember to activate the 'createUser' lines above
iquerySecName internalUser
rouser internalUser
# generate traps on UCD error conditions
defaultMonitors yes
# generate traps on linkUp/Down
linkUpDownNotifications yes
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world! ; echo Hi there ; exit 35
# Run as an AgentX master agent
master agentx
# Listen for network connections (from localhost)
# rather than the default named socket /var/agentx/master
# snmpwalk -c lc20122public -v 2c 192.168.0.146
Timeout: No Response from 192.168.0.146 |
|