snmp服务无法正确运行我的程序..在linux中

|| 我已经开发了这个脚本程序:(程序名称是x1)
#!/bin/bash
/usr/bin/top -n 1 >/tmp/top1.log
echo ok
接下来是我在终端上运行它并获得正确回复的命令:
./x1
意思是当在文件top1.log中写入了
top -n 1>tmp/top1.log
的外部命令,然后在输出中输出了OK消息! 但是,如果我配置了snmpd.cof,并且该程序由snmp服务运行:
snmpwalk -v2c -c public 127.0.0.0    OID
top -n 1>/tmp/top1.log
的外部命令将不会放置在top1.log中,并且不会生成文件top1.log,仅在输出中显示OK消息。 实际上,“ 4”命令不能由SNMP服务运行。     
已邀请:
我的snmpd.conf:
syslocation Server Room
syscontact Sysadmin (root@localhost)

rwcommunity public 192.168.7.165
rwcommunity public 127.0.0.1

sh  1.3.6.1.4.1.999.4.1.4  public  /tmp/x1
我用(sh和exec)运行!     

要回复问题请先登录注册