Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-18-2010, 07:53 AM   #1
LQ Newbie
Registered: Jun 2006
Posts: 2

Rep: Reputation: 0
Question Trouble configuring snmpd on Debian etch. Running exec scripts

Hi All,

First post here (despite frequenting this exelent resource) and I'm having a little trouble configuring snmpd under debian etch.

Ultimately im trying to get snmpd to poll the result of apcaccess (via a script) in order to report the status of a UPS over SNMP.

however I'm having trouble getting anything other than the default information from an snmpwalk.

I installed snmpd using aptitude

#aptitude install snmpd
and edited /etc/snmp/snmpd.conf as suggested here.

then doing an snmp walk returns the following (my test box is called kryten)

kryten:/etc/apt# snmpwalk -v 1 -c public localhost
SNMPv2-MIB::sysDescr.0 = STRING: Linux kryten 2.6.18-6-686 #1 SMP Sat Dec 27 09:31:05 UTC 2008 i686
SNMPv2-MIB::sysObjectID.0 = OID: NET-SNMP-MIB::netSnmpAgentOIDs.10
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (83298) 0:13:52.98
SNMPv2-MIB::sysContact.0 = STRING: Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
SNMPv2-MIB::sysName.0 = STRING: kryten
SNMPv2-MIB::sysLocation.0 = STRING: Unknown (configure /etc/snmp/snmpd.local.conf)
SNMPv2-MIB::sysORLastChange.0 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORID.2 = OID: SNMPv2-MIB::snmpMIB
SNMPv2-MIB::sysORID.4 = OID: IP-MIB::ip
SNMPv2-MIB::sysORID.7 = OID: SNMP-FRAMEWORK-MIB::snmpFrameworkMIBCompliance
SNMPv2-MIB::sysORID.8 = OID: SNMP-MPD-MIB::snmpMPDCompliance
SNMPv2-MIB::sysORDescr.1 = STRING: The MIB module to describe generic objects for network interface sub-layers
SNMPv2-MIB::sysORDescr.2 = STRING: The MIB module for SNMPv2 entities
SNMPv2-MIB::sysORDescr.3 = STRING: The MIB module for managing TCP implementations
SNMPv2-MIB::sysORDescr.4 = STRING: The MIB module for managing IP and ICMP implementations
SNMPv2-MIB::sysORDescr.5 = STRING: The MIB module for managing UDP implementations
SNMPv2-MIB::sysORDescr.6 = STRING: View-based Access Control Model for SNMP.
SNMPv2-MIB::sysORDescr.7 = STRING: The SNMP Management Architecture MIB.
SNMPv2-MIB::sysORDescr.8 = STRING: The MIB for Message Processing and Dispatching.
SNMPv2-MIB::sysORDescr.9 = STRING: The management information definitions for the SNMP User-based Security Model.
SNMPv2-MIB::sysORUpTime.1 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.2 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.3 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.4 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.5 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.6 = Timeticks: (0) 0:00:00.00
SNMPv2-MIB::sysORUpTime.7 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.8 = Timeticks: (1) 0:00:00.01
SNMPv2-MIB::sysORUpTime.9 = Timeticks: (1) 0:00:00.01
End of MIB

Right, so all seems well. snmpd is working and responing.

I then edited /etc/snmp/snmpd.conf and uncommented the test exec:

# a simple hello world
exec echotest /bin/echo hello world

# Run a shell script containing:
# #!/bin/sh
# echo hello world
# echo hi there
# exit 35
# Note:  this has been specifically commented out to prevent
# accidental security holes due to someone else on your system writing
# a /tmp/shtest before you do.  Uncomment to use it.
#exec shelltest /bin/sh /tmp/shtest

# Then,
# % snmpwalk -v 1 -c public localhost .
so I want to check If thats worked before I try with my script.

kryten:/etc/snmp# /etc/init.d/snmpd restart
Restarting network management services: snmpd.
kryten:/etc/snmp# snmpwalk -v 1 -c public localhost .
End of MIB
kryten:/etc/snmp# snmpwalk -v 1 -c public localhost .
End of MIB
if I run a complete snmpwalk, I get the same output as I did before I edited snmp.conf

I've also tried adding a script to snmpd.conf with no luck.

Can anyone tell me what I'm doing wrong here? I've never tried to configure snmpd before so I fully expect that i'm just doing something silly. It's almost like I'm editing the wrong conf file (if I rename the file and restart the daemon it doesn't complain) but I can't find another snmpd.conf.

Many thanks in advance
Old 03-18-2010, 08:10 AM   #2
LQ Newbie
Registered: Jun 2006
Posts: 2

Original Poster
Rep: Reputation: 0
I've just tested the "Edidting the wrong conf file" theory by changing the system contact and the change was reflected in the output... now im totaly stumped :s


debian, snmp, snmpd

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
Trouble configuring 2 network Debian Etch that Linux guy Linux - Networking 1 05-27-2008 06:40 PM
Problem installing debian etch /scripts/init-premount guillermo Linux - General 2 01-19-2008 11:00 AM
LXer: Speeding Up Perl Scripts With SpeedyCGI/PersistentPerl On Debian Etch LXer Syndicated Linux News 0 09-14-2007 10:50 PM
Configuring Exim routing Debian Etch wonderd Linux - Server 3 06-18-2007 06:42 PM
Cannot run scripts (Permission denied). Debian etch. mva.led Debian 7 10-05-2006 02:38 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:58 PM.

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