在server端口执行如下命令
[root@localhost ~]# snmpwalk -v2c -c public 客户端ip if
IF-MIB::ifTable = No Such Object available on this agent at this OID
修改access notConfigGroup "" any noauth exact systemviewnone none
access notConfigGroup "" any noauth exact all none none
故障二:在服务器端去取客户端指定oid对应的值
[root@localhost ~]# snmpwalk -v2c -c public 被监控端ip地址 .1.3.6.1.4.1.2021.1
UCD-SNMP-MIB::ucdavis.1 = No Such Object available on this agent at this OID
修改/etc/snmp/snmpd.conf中
exec .1.3.6.1.4.1.2021.1 test /root/test.sh为
extend .1.3.6.1.4.1.2021.1 test /root/test.sh
[root@localhost ~]# snmpwalk -v2c -c public 被监控端ip地址.1.3.6.1.4.1.2021.1
UCD-SNMP-MIB::ucdavis.1.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.2.1.2.4.116.101.115.116 = STRING: "/root/test.sh"
UCD-SNMP-MIB::ucdavis.1.2.1.3.4.116.101.115.116 = ""
UCD-SNMP-MIB::ucdavis.1.2.1.4.4.116.101.115.116 = ""
UCD-SNMP-MIB::ucdavis.1.2.1.5.4.116.101.115.116 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.1.2.1.6.4.116.101.115.116 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.2.1.7.4.116.101.115.116 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.2.1.20.4.116.101.115.116 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.1.2.1.21.4.116.101.115.116 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.3.1.1.4.116.101.115.116 = STRING: "/root/test.sh: Permission denied"
UCD-SNMP-MIB::ucdavis.1.3.1.2.4.116.101.115.116 = STRING: "/root/test.sh: Permission denied"
UCD-SNMP-MIB::ucdavis.1.3.1.3.4.116.101.115.116 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.3.1.4.4.116.101.115.116 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.1.4.1.2.4.116.101.115.116.1 = STRING: "/root/test.sh: Permission denied"
You have new mail in /var/spool/mail/root
给test.sh脚本赋予执行权限
chmod +x /root/test.sh
再次在服务器端执行上述取值命令,ok