Using SNMP to run remote commands

 
Thread Tools Search this Thread
Special Forums UNIX and Linux Applications Infrastructure Monitoring Using SNMP to run remote commands
# 1  
Old 11-26-2010
Using SNMP to run remote commands

so i just discovered it was possible to run remote scripts using snmp.

problem is, one can't pass arguments to the remote script from the client machine.

for instance, the code below will execute the script called CallDropper on sgt66.blahblah.com.

Code:
snmpwalk -v2c -c A@GTF42 sgt66.blahblah.com NET-SNMP-EXTEND-MIB::nsExtendOutputFull.\"CallDropper\"

But what if I want to pass a couple of arguments to CallDropper? Is there a way to do this?

Last edited by SkySmart; 11-26-2010 at 03:19 PM..
# 2  
Old 11-29-2010
I've stayed away from this - SNMP is a VERY complex protocol. Here is the way you start doing it. It involves creating C code and working with the Netsnmp library. It is not just like bash or ksh. OID's (from MIB's) are involved.

Net-SNMP
# 3  
Old 11-30-2010
As far as I can see from the MIB definition, you should use the nsExtendArgs object;
Code:
nsExtendArgs    OBJECT-TYPE
    SYNTAX      DisplayString
    MAX-ACCESS  read-create
    STATUS      current
    DESCRIPTION
      "Any command-line arguments for the command"
    DEFVAL      { ''H }   -- the empty string
    ::= { nsExtendConfigEntry 3 }

Cheers, Loïc
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run commands on remote server using ssh password less authentication?

Hi, I need to run a script located in a directory on remote server by using ssh authentication from my local unix server. Can anyone help me in this. I have tried the below command. It worked for echo command but when i tried to open a file using cat command it is showing "cat: cannot open... (6 Replies)
Discussion started by: ssk250
6 Replies

2. UNIX for Dummies Questions & Answers

How to run UNIX commands on remote machine from windows?

Hi All, I am working in support and we are planning to automate a system to reduce the direct manual intervention to core system. Please find the below details. 1. we have a web application that runs on Windows Platform. 2. From web application, we need to connect to remote Unix machine.... (6 Replies)
Discussion started by: Balaji K
6 Replies

3. Shell Programming and Scripting

Until string from remote command equals value run remote command

I solved my issue by using the following code #!/bin/bash function GET_STATUS { #values Active Passive Failed ssh -a localhost '/home/user/fakecommand.sh' } STATE="unknown" until ] do echo $STATE sleep 5 STATUS=`GET_STATUS` echo $STATUS | grep Active &&... (1 Reply)
Discussion started by: $scipt_Kid
1 Replies

4. Infrastructure Monitoring

Using SNMP to monitor remote processes and disk space

snmpget -v 1 -c COMMUNITYSTR hostname OID what OIDs would I use to get information on all the processes and disk space information that are on a particular host. where can i find out information on all of this? thanks (3 Replies)
Discussion started by: SkySmart
3 Replies

5. Infrastructure Monitoring

SNMP from remote machine

Hi, I have sucessfully set up snmp daemon on my AIX box (v 6.1.2.0). I can query snmp from localhost (using command: snmpinfo -v -m dump -c public mib-2) and it works perfectly. But I don't get any reply when query my AIX box from remote machine (AIX, Linux,...) I have tried to set up SNMP v1... (0 Replies)
Discussion started by: pavel.kovar
0 Replies

6. Shell Programming and Scripting

Run a shell script from one host which connext to remote host and run the commands

I want to write a script which would run from one host say A and connect to other remote host B and then run rest of commands in that host. I tried connecting from A host to B with SSH but after connecting to host B it just getting me inside Host B command prompt. Rest of the script is not running... (6 Replies)
Discussion started by: SN2009
6 Replies

7. Shell Programming and Scripting

remote ssh commands help

I have a script that I'm trying to use that will check for files on a remote machine and if there is files copy the files, modify the perm on the copied files, and then delete the files off of the remote server. Right now I need to get the correct syntax so the the remote commands still interpret... (4 Replies)
Discussion started by: jcalisi
4 Replies

8. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

9. Shell Programming and Scripting

commands to remote sftp

Hello, Is there a way to use wc, sed or other commands against remote sftp in a regular shell script? wc -c *.* | grep total | sed s/total// ? thanks in advance (0 Replies)
Discussion started by: chm0dvii
0 Replies

10. Solaris

display remote commands

is there a way to display the commands the the remote user is typing -I would like to know a way by which i can log onto a remote system and type commands as the user watched on the console - I know about vnc but that is not what i am looking for -or is it rexec ? Ndegem SCSA (4 Replies)
Discussion started by: ndegem
4 Replies
Login or Register to Ask a Question