(as4上用exec) 为什么不用exec?报错 SNMPdaemon version 5.0 and above from the NetSNMP project provides a way toaccess output of user supplied scripts via SNMP protocol. In otherwords: SNMP client on one machine can invoke a script on anothermachine just by sending a SNMP query. After the remote script finishesits standard/error output, return code and some other values are sentback to the client in a SNMP response. (NOTE: See SNMP exec section below if you run older SNMP daemon than NetSNMP 5.0) SNMPexec provides a similar functionality to extend, however exec is lessflexible and slightly slower to work with. On the other hand it issupported in many older implementations of SNMP daemons includingUCD-SNMP and NetSNMP 4.x which are still found on many servers.
1.关于SELinux报错: Jun30 10:45:03 web1 setroubleshoot: SELinux is preventing /bin/ps(snmpd_t) "sys_ptrace" access to (snmpd_t). Forcomplete SELinux messages. run sealert -l32ec5849-2d38-49b8-a13c-faaba9239c98 解决:You can disable SELinux for snmpd by issuing the following command: 启动 setroubleshoot,以便可以使用sealert命令查询错误数据库,查询完毕后可以关闭 service setroubleshoot start 使用 sealert -l 32ec5849-2d38-49b8-a13c-faaba9239c98 查看错误数据库 按提示操作setsebool -P snmpd_disable_trans=1 -P参数是永久有效的意思 停止 setroubleshoot service setroubleshoot stop 重起snmpd service snmpd restart
2.关于报错:last message repeated 3 times vi /etc/init.d/snmpd #OPTIONS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a" OPTIONS="-LS 0-4 d -Lf /dev/null -p /var/run/snmpd.pid -a"