LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-19-2009, 10:22 AM   #1
skatersam0
LQ Newbie
 
Registered: Apr 2006
Location: St. Louis, MO
Distribution: Ubuntu currently, but Fedora is my favorite
Posts: 8

Rep: Reputation: 0
Net-Snmp: Cannot extend agent to run script from configuration file


Hello Everyone,

I am having a little bit of a problem with net-snmp on Ubuntu Jaunty, and also on Debian Lenny (x64). I have both of the agents configured and up and running. I can query anything in the standard MIBs.
My issue is with trying to extend the agent with just the simple shell script. I will post my current snmpd.conf file here.

Code:
rwcommunity public
syslocation "Intern Cube"
syscontact sam@localhost

#if I comment this next line out the conf works great
#exec echotest /bin/echo hello world
exec testing /bin/sh /tmp/test

proc snmpd
proc apache2

disk / 100000
As is if I did an snmp walk it would find the name of shell script (testing) and then it would kill the snmpd process. The script doesn't even start to run before the process dies.

The command I run is:
Code:
snmpwalk -v 1 -c public localhost ucdavis
ucdavis is where the scripts are put be default, and the output looks like this:
Code:
...
UCD-SNMP-MIB::memIndex.0 = INTEGER: 0
UCD-SNMP-MIB::memErrorName.0 = STRING: swap
UCD-SNMP-MIB::memTotalSwap.0 = INTEGER: 0
UCD-SNMP-MIB::memAvailSwap.0 = INTEGER: 0
UCD-SNMP-MIB::memTotalReal.0 = INTEGER: 3095572
UCD-SNMP-MIB::memAvailReal.0 = INTEGER: 2452832
UCD-SNMP-MIB::memTotalFree.0 = INTEGER: 2452832
UCD-SNMP-MIB::memMinimumSwap.0 = INTEGER: 16000
UCD-SNMP-MIB::memShared.0 = INTEGER: 0
UCD-SNMP-MIB::memBuffer.0 = INTEGER: 42764
UCD-SNMP-MIB::memCached.0 = INTEGER: 254860
UCD-SNMP-MIB::memSwapError.0 = INTEGER: 1
UCD-SNMP-MIB::memSwapErrorMsg.0 = STRING: Running out of swap space (0)
UCD-SNMP-MIB::extIndex.1 = INTEGER: 1
UCD-SNMP-MIB::extIndex.2 = INTEGER: 2
UCD-SNMP-MIB::extNames.1 = STRING: testing
Timeout: No Response from localhost
sam@intern008:~$

I have been working on this for two entire days now. Any help, or additional thoughts would be greatly appreciated. Thank you!

-Sam
 
Old 06-24-2009, 04:00 PM   #2
shrodione
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
SNMP exec

Try formatting your exec command this way. The second argument should be the OID that the command output will be sent to. The third is the name of the command. The fourth is the command itself.

This command works to query netstat information and return it as at the OID shown:

Code:
exec 1.3.6.1.4.1.999999.1.4 netstat /bin/netstat

Last edited by shrodione; 06-24-2009 at 04:04 PM.
 
Old 06-30-2009, 11:11 AM   #3
skatersam0
LQ Newbie
 
Registered: Apr 2006
Location: St. Louis, MO
Distribution: Ubuntu currently, but Fedora is my favorite
Posts: 8

Original Poster
Rep: Reputation: 0
In the man page for snmpd.conf it says that the oid value is optional. I have tried both with, and without and neither one has worked for me. I was however to compile a subagent that uses the agentx protocol to achieve the same result I was looking for. Thank you for your response, unfortunately this solution also doesn't work on my machine. I think that I have some other form of internal configuration error, (e.g. execute permissions not set quite right.). I'm still a little confused as to why it shuts down the snmp daemon if I run it though.


Thanks again,

Sam
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integrate Mod-Apache-Snmp with Net-SNMP source kirukan Linux - Server 2 05-11-2011 01:48 AM
Net-SNMP writing a Subagent - snmp.conf Unknown token: master AustinMarton Programming 0 12-16-2008 07:34 PM
Net-Snmp perl scripts failed to open file ohcarol Linux - Software 2 08-17-2008 07:48 AM
Error: Agent Configuration Agent (use Oracle with Linux) shipon_97 Linux - Enterprise 0 02-02-2007 12:11 AM
snmp (ucd-snmp, net-snmp) markus1982 Linux - Software 1 11-21-2002 10:45 AM


All times are GMT -5. The time now is 06:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration