SNMP OID query a remote script!

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
mongaron
Posts: 7
Joined: Mon Jan 15, 2007 5:30 am

SNMP OID query a remote script!

Post by mongaron »

Hi,
i am trying to run a script on a remote machine by querying an SNMP OID.
thus i have configured my snmpd.conf with the follwoing:
exec .1.3.6.1.4.1.20011.51 /usr/local/snmp/testtcp.sh
when i query it from cacti by doing:
snmpwalk -v 1 -c public 10.12.0.11:161 .1.3.6.1.4.1.20011.51.1
i get the follwoing:
SNMPv2-SMI::enterprises.20011.51.1.1 = INTEGER: 1
SNMPv2-SMI::enterprises.20011.51.2.1 STRING: "/usr/local/snmp/testtcp.sh"
SNMPv2-SMI::enterprises.20011.51.3.1 = ""
SNMPv2-SMI::enterprises.20011.51.100.1 = INTEGER: 1
SNMPv2-SMI::enterprises.20011.51.101.1 = STRING: "No such file or directory"
SNMPv2-SMI::enterprises.20011.51.102.1 = INTEGER: 0


when i run the script from the remote machine /usr/local/snmp/testtcp.sh i get the follwoing;
established:170 listen:6 timewait:63 timeclose:0 finwait1:0 finwait2:0 synsent:0 synrecv:0 closewait:0

which is what i need for cacti to graph my data on the tcp connections or any other script that i would like to run and get data from.
help will be most appreciated

thanks in advanced
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please make sure that the script includes /full/path/to/any/command and does not rely on $PATH setting. This is an issue with snmp/script/exec, not a pure cacti thingy
Reinhard
mongaron
Posts: 7
Joined: Mon Jan 15, 2007 5:30 am

Post by mongaron »

hi thanks for the response i have checked and even after i have
rewrite the script with the full path or write a simple script that just echo a line ,i got the same error so i will keep looking at it maybe upgrading my snmp.
thanks anyway
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

BTB: There's a script that provides TCP status printout. Pleae serach script and templates forum
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests