- 论坛徽章:
- 0
|
安装的net-snmp的tar包,安装过程如下:
$ ./configure --prefix=/usr/local/snmpd
$ make
$ make install
拷了一个配置文件过来,内容如下:
#cat /etc/snmpd/snmpd.conf |grep -v "^#"
com2sec notConfigUser 59.41.186.218 public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
view systemview included .1.3.6.1.2.1.2
view systemview included .1.3.6.1.4.1.2021.9.1.1
access notConfigGroup "" any noauth exact all none none
view all included .1 80
view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
启动脚本:
$ /usr/local/snmpd/sbin/snmpd -c /etc/snmpd/snmpd.conf
端口:
$ netstat -na|grep 161
udp 0 0 0.0.0.0:161 0.0.0.0:*
日志:
$ cat /var/log/snmpd.log
NET-SNMP version 5.2.4
在别的机上测试:
$ ./cfgmaker --global "WorkDir: /data/http/htdocs" \
> --global "Options[_]: growright,bits" \
> --ifref=ip --output mrtg123.cfg public@59.41.186.221
--base: Get Device Info on public@59.41.186.221:
SNMP Error:
no response received
SNMPv1_Session (remote host: "59.41.186.221" [59.41.186.221].161)
community: "public"
request ID: 1015823259
PDU bufsize: 8000 bytes
timeout: 2s
retries: 5
backoff: 1)
at /data/mrtg/bin/../lib/mrtg2/SNMP_util.pm line 627
SNMPWALK Problem for 1.3.6.1.2.1.1 on public@59.41.186.221::::::v4only
at ./cfgmaker line 924
WARNING: Skipping public@59.41.186.221: as no info could be retrieved
--base: Writing mrtg123.cfg
请教各位高人,这是哪里的问题呀,已经搞了两天 了,网上也没查到个所以然来。 |
|