2

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

Tyler
  • 955
  • 9
  • 20
  • You'd better run `snmpwalk` against your `snmpd` to see if your OID indeed is registered correctly. Otherwise, the error message of `snmpget` makes perfect sense. Notice that `snmpget` never reads `snmpd.conf` directly. – Lex Li Nov 15 '17 at 23:05
  • I get the same error with snmpwalk, but our script doesn't handle -n calls. How do I get it to read snmpd.conf to use the pass script? I can't even walk netSnmpPassExamples for the passtest example script @LexLi – Tyler Nov 16 '17 at 18:10

1 Answers1

4

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.

rabhis
  • 440
  • 2
  • 5
  • Thank you, this helped me figure the problem out. Running it in the foreground showed an error `no access control configured`, so something was wrong with my agent itself. Recreating the conf file with the conf tool was the fix. I accepted your answer because it pushed me in the right direction – Tyler Nov 20 '17 at 15:09
  • have a look at my detailed solution https://github.com/ahmednawazkhan/guides/blob/master/snmp/creating-custom-mib.md – Ahmed Nawaz Khan May 11 '20 at 18:19