still problems with exec and extend?
Kai <[email protected]>
| Newsgroups | gmane.network.net-snmp.user |
|---|---|
| Message-ID | <[email protected]> |
Hello, We're using net-snmpd quite extensively on all the servers in my company, and we're happily using 'exec' to supply custom information via snmp to make remote rrdtool graphs, but the fact that it executes the script for every line is taking its toll now :(. In the archives I read that the new extend is the suggested way to run scripts locally, but it doesn't work for us either: # cat > /tmp/pid.sh #!/bin/sh echo line1: pid: $$ echo line2: pid: $$ echo line3: pid: $$ echo line4: pid: $$ EOF Assume this snmpd.conf: rocommunity public 127.0.0.1 exec .1.3.6.1.4.1.7460.1.13 showpid /bin/sh /tmp/pid.sh extend .1.3.6.1.4.1.7460.1.14 showpid2 /bin/sh /tmp/pid.sh Which results in this: # snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.7460.1.13 SNMPv2-SMI::enterprises.7460.1.13.1.1 = INTEGER: 1 SNMPv2-SMI::enterprises.7460.1.13.2.1 = STRING: "showpid" SNMPv2-SMI::enterprises.7460.1.13.3.1 = STRING: "/bin/sh /tmp/pid.sh" SNMPv2-SMI::enterprises.7460.1.13.100.1 = INTEGER: 0 SNMPv2-SMI::enterprises.7460.1.13.101.1 = STRING: "line1: pid: 94243" SNMPv2-SMI::enterprises.7460.1.13.101.2 = STRING: "line2: pid: 94244" SNMPv2-SMI::enterprises.7460.1.13.101.3 = STRING: "line3: pid: 94246" SNMPv2-SMI::enterprises.7460.1.13.101.4 = STRING: "line4: pid: 94248" SNMPv2-SMI::enterprises.7460.1.13.102.1 = INTEGER: 0 SNMPv2-SMI::enterprises.7460.1.13.103.1 = "" # snmpwalk -v 1 -c public localhost SNMPv2-SMI::enterprises.7460.1.14.1.0 = INTEGER: 1 SNMPv2-SMI::enterprises.7460.1.14.2.1.2.8.115.104.111.119.112.105.100.50 = STRING: "/bin/sh" SNMPv2-SMI::enterprises.7460.1.14.2.1.3.8.115.104.111.119.112.105.100.50 = STRING: "/tmp/pid.sh" SNMPv2-SMI::enterprises.7460.1.14.2.1.4.8.115.104.111.119.112.105.100.50 = "" SNMPv2-SMI::enterprises.7460.1.14.2.1.5.8.115.104.111.119.112.105.100.50 = INTEGER: 5 SNMPv2-SMI::enterprises.7460.1.14.2.1.6.8.115.104.111.119.112.105.100.50 = INTEGER: 1 SNMPv2-SMI::enterprises.7460.1.14.2.1.7.8.115.104.111.119.112.105.100.50 = INTEGER: 1 SNMPv2-SMI::enterprises.7460.1.14.2.1.20.8.115.104.111.119.112.105.100.50 = INTEGER: 4 SNMPv2-SMI::enterprises.7460.1.14.2.1.21.8.115.104.111.119.112.105.100.50 = INTEGER: 1 SNMPv2-SMI::enterprises.7460.1.14.3.1.1.8.115.104.111.119.112.105.100.50 = STRING: "line1: pid: 94977" SNMPv2-SMI::enterprises.7460.1.14.3.1.2.8.115.104.111.119.112.105.100.50 = STRING: "line1: pid: 94977 line2: pid: 94977 line3: pid: 94977 line4: pid: 94977" SNMPv2-SMI::enterprises.7460.1.14.3.1.3.8.115.104.111.119.112.105.100.50 = INTEGER: 4 SNMPv2-SMI::enterprises.7460.1.14.3.1.4.8.115.104.111.119.112.105.100.50 = INTEGER: 0 From what I can read in the output, it seems that the relocation of the mib to our oidspace isn't possible at all, as half of the info gets lost (SNMPv2-SMI::enterprises.7460.1.14.4 is missing). Running them without relocating the mib doesn't work in our case as we run multiple scripts. The caching in the 'extend' works as intended though. Is there a solution to this problem? or is this a known bug for which I should await a new release for? Regards, Kai -- begin 600 .signature ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ Net-snmp-users mailing list [email protected] Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users