2

Iwant to add an custom OID to MIB tree structure. I add the line as below to file /etc/snmp/snmpd.conf

extend    test1   /bin/echo  Hello, world!

but I don't know how to specifiy the exact OID number. Is there any way to do that?

Waveter
  • 564
  • 2
  • 6
  • 23

1 Answers1

0

Sure, for example when I want to graph more fancy disk usage with say, iostat I have

pass .1.3.6.1.3.1 /usr/bin/perl /usr/local/bin/iostat.pl

at the bottom of my /etc/snmp/snmpd.conf

then I can use snmpwalk -v2c -cpublic localhost snmpwalk -v2c -cpublic localhost .1.3.6.1.3.1

Recct
  • 370
  • 1
  • 3
  • 22
  • I did as your answer, but when I restart snmpd service, I received the error: /etc/snmp/snmpd.conf: line 154: Error: unknown monitor OID – Waveter Apr 21 '16 at 09:23
  • Well what's the full line now? You may need to use the experimental tree like above rather than something that's probably allocated to an enterprise but I'm not sure. – Recct Apr 21 '16 at 09:53
  • Here is my line: pass .1.3.6.1.3.1 /bin/sh /etc/snmp/scripts/postgresfiles.sh, and the error become /etc/snmp/snmpd.conf: line 154: Error: unknown payload OID – Waveter Apr 21 '16 at 10:06