Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SNMP to remotely launch applications

Status
Not open for further replies.

simmoja3

Programmer
Oct 19, 2006
1
US
Hello all,

I realize this isn't the "traditional" usage, but I'm trying to utilize SNMP to manage a large distributed software simulation system. One of the goals is to remotely launch an application (on a linux box) using some type of SNMP message. The closest I've come so far is having the process started by sending an snmp get, but it hangs up waiting for the process to terminate and give a response. Any suggestions?
 
Just spawning the background process should allow SNMP to return, but try starting the process from a launcher script that will terminate quickly.

#!/bin/sh
process_to_start &
exit 0

 
I am trying to remotely execute a process on linux using snmp and whould like to know the snmp instructions you used to do it. Can you provide a code example.
I am using my Window app to remotely start the linux app.
 
There are good examples in snmpd.conf. Example:

exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest

# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.50
# enterprises.ucdavis.50.1.1 = 1
# enterprises.ucdavis.50.2.1 = "shelltest"
# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest"
# enterprises.ucdavis.50.100.1 = 35
# enterprises.ucdavis.50.101.1 = "hello world."
# enterprises.ucdavis.50.101.2 = "hi there."
# enterprises.ucdavis.50.102.1 = 0


Then "get" the OID that you made up to execute the remote program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top