snmpd配置文件:
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view all included .1
access notConfigGroup "" any noauth exact all none none
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <> (configure /etc/snmp/snmp.local.conf)
load 12 14 14
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
几个常用的oid:
查看主机内核信息:
/usr/local/snmpd/bin/snmpwalk -v1 -cpublic localhost sysDesc
SNMPv2-MIB::sysDescr.0 = STRING: Linux localhost 2.6.18-128.el5PAE #1 SMP Wed Dec 17 12:02:33 EST 2008 i686
查看uptime:
/usr/local/snmpd/bin/snmpwalk -v1 -cpublic localhost sysUptime
SNMPv2-MIB::sysUpTime.0 = Timeticks: (1528990) 4:14:49.90
查看load average:
/usr/local/snmpd/bin/snmpwalk -v1 -cpublic localhost laLoadFloat
UCD-SNMP-MIB::laLoadFloat.1 = Opaque: Float: 1.100000
UCD-SNMP-MIB::laLoadFloat.2 = Opaque: Float: 1.180000
UCD-SNMP-MIB::laLoadFloat.3 = Opaque: Float: 1.240000
查看ESTABLISHED状态的数目:
/usr/local/snmpd/bin/snmpwalk -v1 -cpublic localhost 1.3.6.1.2.1.6.9
TCP-MIB::tcpCurrEstab.0 = Gauge32: 18
将上面的localhost换成远程主机ip就能实现对远程主机的各种监控.
更多oid详见:
阅读(796) | 评论(0) | 转发(0) |