SNMP pass-through command not returning with snmpget

旧街凉风 提交于 2019-12-11 05:39:23

问题


I am trying to get some scripts working in my snmpd.conf file using pass, however calling snmpget on the OID is returning

No Such Instance currently exists at this OID

in the snmpd.conf I have

pass .1.3.6.1.4.1.13732.100.2.1  /bin/sh       /usr/share/snmp/local/terminal

and when I call

snmpget -c public -v2c 127.0.0.1 .1.3.6.1.4.1.13732.100.2.1.1

I get the no such instance error. Why does the snmpget not seem to find the pass in the conf file and use the script?

It is able to find the OID in the MIB because the snmpget returns the MIB plus the object name with the error

Please let me know if any more info is needed to help answer this question


回答1:


You can debug snmpd by starting it foreground as snmpd -f -Lo -Ducd-snmp/pass.

Add the below lines to /etc/snmpd.conf

rocommunity testCommunityString localhost
pass .1.3.6.1.4.1.13732.100.2.1  /bin/sh /home/user/smpd_pass/test.sh

Download sample pass script and change PLACE asPLACE=".1.3.6.1.4.1.13732.100.2.1" to create test.sh pass script.

Now running snmpwalk -c testCommunityString -v2c 127.0.0.1 .1.3.6.1.4.1.13732.100.2.1 would show the values defined in the file.



来源:https://stackoverflow.com/questions/47210999/snmp-pass-through-command-not-returning-with-snmpget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!