snmp從RH9.0後就改為net-snmp,所以跟之前設定略有差別,請修改下列設定檔:
]#vi /etc/snmp/snmpd.conf
.SNMP的設定
snmp從RH9.0後就改為net-snmp,所以跟之前設定略有差別,請修改下列設定檔:
]#vi /etc/snmp/snmpd.conf
com2sec local localhost public
com2sec mynetwork 192.168.0.0/24 public
group MyRWGroup v1 local
group MyROGroup v1 mynetwork
group MyRWGroup v2c local
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view all included .1 80
access MyROGroup "" any noauth prefix all none none
access MyRWGroup "" any noauth prefix all all all
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
<ps>請注意,mailscanner-mrtg使用v2c的
界面取得數據,group MyRWGroup v2c
local此行一定要有.
修改完請重新啟動,/etc/rc.d/init.d/snmpd restart
測試snmp,
]#snmpwalk localhost -c public -v 1
測試mailscanner-mrtg使用的v2c uptime
]#snmpwalk -v 2c -c public localhost uptime