SNMP from shell scripts

Posted on 2006-04-25
Last Modified: 2013-12-16
Is there a Linux library that allows SNMP requests to call a shell script?  I know it is possible to call a shell script on an SNMP set, but I'm looking for a simple way to gather information from a shell script, even if it's just wrapping the script output in an SNMP response.

Question by:KurtVon
    LVL 2

    Expert Comment

    Try this network tool, I belive it can use snmp
    LVL 14

    Expert Comment


    You can always use snmp from within your script...

    snmpwalk is what you use to do that...

    Cant remember syntax right now, let me know if you want it...

    LVL 11

    Author Comment

    I don't need a shell script for accessing SNMP.  What I need is a shell script to respond to SNMP requests.  In other words, when an SNMP request comes in I'd like the server to activate a shell script that generates the values SNMP will return to the client.

    Basically I'm trying to pass off writing the service to someone else with very limited programing experience.
    LVL 22

    Accepted Solution

    Here has a superb list of SNMB things that are linux based:

    In particular, you want the snmpd element of net-snmp:

    Man page is:

    It sounds as if you wish to create custom scripts. You will need to specify these modules in the configuration file for them to be recognised. The following page gives details of the types of extensions that can be done. It appears to be fairly comprehensive:
    LVL 11

    Author Comment

    That looks like what I was trying to find.  Thanks.
    LVL 22

    Expert Comment

    A pleasure:)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
    How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now