Ubuntu snmpd package doesn't include all net-snmpd modules

Bug #496922 reported by Jens Rantil
34
This bug affects 6 people
Affects Status Importance Assigned to Milestone
net-snmp (Ubuntu)
Fix Released
Wishlist
Unassigned
Nominated for Lucid by Peter Matulis
Nominated for Precise by Peter Matulis

Bug Description

Binary package hint: snmpd

=== The problem ===
The 'exec' directive is not compiled into snmpd. However, the snmpd config file (/etc/snmp/snmpd.conf) provides example lines (commented out) on how to use ut. This makes it very confusing, especially since no error is given when restarting snmpd (with /etc/init.d/snmpd restart), and snmpd has no log file enabled by default.

=== Proposed solution(s) ===
There are acouple of ways of solving this issue:
1) The best way: to compile snmpd with the 'ucd_snmp' MIB module. See the blog post in the references section on how to do this.
2) Remove the exec directive examples in the '/etc/snmp/snmpd.conf'.
3) Inform about the dependence in the 'exec' example section in '/etc/snmp/snmpd.conf'.
4) Give an error message that snmpd does not support 'exec'.

=== Additional notes ===
According to the blog post below this problem is also related to the 'proc' directive, too. However, I have not verified this.

=== References ===
This blog post helped me identify this issue: http://bryanfullerton.com/?p=124

=== My system: ===
$ lsb_release -rd
Description: Ubuntu 9.10
Release: 9.10
$ dpkg -l|grep snmpd
ii snmpd 5.4.1~dfsg-12ubuntu7
                       SNMP (Simple Network Management Protocol) agents

Revision history for this message
Jens Rantil (jens-rantil) wrote :

Is there a reason why 'ucd_snmp' is not compiled into snmpd?

description: updated
Revision history for this message
Chuck Short (zulcss) wrote :

Thanks for the bug report Ill get this fixed for lucid.

Regards
chuck

Changed in net-snmp (Ubuntu):
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

This should be fixed for lucid, please re-open if it isnt.

Regards
chuck

Chuck Short (zulcss)
Changed in net-snmp (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Alex G (ogxela-yahoo) wrote :

Can we get a fix backported to Hardy please?

Revision history for this message
yann (lonequiky) wrote :

I stil have the problem under Ubuntu Lucid 10.04.1 LTS and i still can not use the exec command in snmpd.conf file

Revision history for this message
silid (simon-liddicott) wrote :

i agree - it seems exec still doesn't work in lucid.

Revision history for this message
Peter Matulis (petermatulis) wrote :

Changed to 'Confirmed'. Several users report that Lucid remains affected.

Changed in net-snmp (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Michael Heldebrant (mheldebr) wrote :

Lucid is still affected with this issue.

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Hi,

Could the people affected please explain what is not working? Using 'exec' is deprecated and should be replaced with 'extend'. Was this option tried and you still failed to see results?

Also attaching some example configurations using the 'extend' feature would be helpful in pinpointing this issue.

Thanks,
Adam

Revision history for this message
Michael Heldebrant (mheldebr) wrote :

Script essentially is giving me a counter to watch the rate of commits on a subversion repository:

mheldebr@server:~$ /svn-hotcopy/svnyoungest
10386

I tried both exec (works on RHEL5 configured like this) and extend which both fail:

Snippet of snmpd.conf file with exec style:
exec 1.3.6.1.4.1.99999.9.3 svncommits /bin/sh /svn-hotcopy/svnyoungest

mheldebr@server:~$ snmpwalk -v 2c -c REDACTED localhost 1.3.6.1.4.1.99999.3
SNMPv2-SMI::enterprises.99999.3 = No Such Object available on this agent at this OID

And configured as extend:
extend 1.3.6.1.4.1.99999.9.3 svncommits /svn-hotcopy/svnyoungest

mheldebr@server:~$ snmpwalk -v 2c -c REDACTED localhost 1.3.6.1.4.1.99999.3
SNMPv2-SMI::enterprises.99999.3 = No Such Object available on this agent at this OID

Revision history for this message
Adam Stokes (adam-stokes) wrote :

I'm not able to reproduce your issue exactly, but here is information which shows that the snmp extend functionality is available in latest lucid.

zef@lucid:/tmp$ ps -ef |grep nfsd
root 1152 2 0 13:29 ? 00:00:00 [nfsd4]
root 1156 2 0 13:29 ? 00:00:00 [nfsd]
root 1157 2 0 13:29 ? 00:00:00 [nfsd]
root 1158 2 0 13:29 ? 00:00:00 [nfsd]
root 1159 2 0 13:29 ? 00:00:00 [nfsd]
root 1160 2 0 13:29 ? 00:00:00 [nfsd]
root 1161 2 0 13:29 ? 00:00:00 [nfsd]
root 1162 2 0 13:29 ? 00:00:00 [nfsd]
root 1163 2 0 13:29 ? 00:00:00 [nfsd]
zef 2194 1647 0 13:47 pts/0 00:00:00 grep --color=auto nfsd

zef@lucid:/tmp$ snmpwalk -v 2c -c stokescanonical localhost NET-SNMP-EXTEND-MIB::nsExtendObjects
NET-SNMP-EXTEND-MIB::nsExtendNumEntries.0 = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendCommand."top_lists" = STRING: /bin/sh
NET-SNMP-EXTEND-MIB::nsExtendArgs."top_lists" = STRING: /usr/local/bin/blah.sh
NET-SNMP-EXTEND-MIB::nsExtendInput."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendCacheTime."top_lists" = INTEGER: 5
NET-SNMP-EXTEND-MIB::nsExtendExecType."top_lists" = INTEGER: exec(1)
NET-SNMP-EXTEND-MIB::nsExtendRunType."top_lists" = INTEGER: run-on-read(1)
NET-SNMP-EXTEND-MIB::nsExtendStorage."top_lists" = INTEGER: permanent(4)
NET-SNMP-EXTEND-MIB::nsExtendStatus."top_lists" = INTEGER: active(1)
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."top_lists" = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendResult."top_lists" = INTEGER: 9
NET-SNMP-EXTEND-MIB::nsExtendOutLine."top_lists".1 = STRING:

zef@lucid:/tmp$ sudo cat /etc/snmp/snmpd.conf
###########################################################################
#
# snmpd.conf
#
###########################################################################
rocommunity stokescanonical

extend top_lists /bin/sh /usr/local/bin/blah.sh

zef@lucid:/tmp$ cat /usr/local/bin/blah.sh
#!/bin/bash

NUMPIDS=`pgrep nfsd | wc -l`

exit $NUMPIDS

zef@lucid:/tmp$ uname -a
Linux lucid 2.6.32-41-generic #89-Ubuntu SMP Fri Apr 27 22:18:56 UTC 2012 x86_64 GNU/Linux

zef@lucid:/tmp$ dpkg -l snmp snmpd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-===================-===================-======================================================
ii snmp 5.4.2.1~dfsg0ubuntu SNMP (Simple Network Management Protocol) applications
ii snmpd 5.4.2.1~dfsg0ubuntu SNMP (Simple Network Management Protocol) agents

Revision history for this message
Michael Heldebrant (mheldebr) wrote :

It seems then that neither exec not extend let me anchor the oid where I want like I could before. Either way will give

I just had to go digging for the numeric OID to poll with cacti with snmpwalk.

mheldebr@server:/svn-hotcopy$ sudo grep extend /etc/snmp/snmpd.conf
extend svncommits /bin/sh /svn-hotcopy/svnyoungest

mheldebr@server:/svn-hotcopy$ snmpwalk -v 2c -c REDACTED localhost NET-SNMP-EXTEND-MIB::nsExtendObjects -On
.1.3.6.1.4.1.8072.1.3.2.1.0 = INTEGER: 1
.1.3.6.1.4.1.8072.1.3.2.2.1.2.10.115.118.110.99.111.109.109.105.116.115 = STRING: /bin/sh
.1.3.6.1.4.1.8072.1.3.2.2.1.3.10.115.118.110.99.111.109.109.105.116.115 = STRING: /svn-hotcopy/svnyoungest
.1.3.6.1.4.1.8072.1.3.2.2.1.4.10.115.118.110.99.111.109.109.105.116.115 = STRING:
.1.3.6.1.4.1.8072.1.3.2.2.1.5.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: 5
.1.3.6.1.4.1.8072.1.3.2.2.1.6.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: exec(1)
.1.3.6.1.4.1.8072.1.3.2.2.1.7.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: run-on-read(1)
.1.3.6.1.4.1.8072.1.3.2.2.1.20.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: permanent(4)
.1.3.6.1.4.1.8072.1.3.2.2.1.21.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: active(1)
.1.3.6.1.4.1.8072.1.3.2.3.1.1.10.115.118.110.99.111.109.109.105.116.115 = STRING: 11145
.1.3.6.1.4.1.8072.1.3.2.3.1.2.10.115.118.110.99.111.109.109.105.116.115 = STRING: 11145
.1.3.6.1.4.1.8072.1.3.2.3.1.3.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: 1
.1.3.6.1.4.1.8072.1.3.2.3.1.4.10.115.118.110.99.111.109.109.105.116.115 = INTEGER: 0
.1.3.6.1.4.1.8072.1.3.2.4.1.2.10.115.118.110.99.111.109.109.105.116.115.1 = STRING: 11145

mheldebr@server:/svn-hotcopy$ snmpget -v 2c -c REDACTED localhost \ .1.3.6.1.4.1.8072.1.3.2.4.1.2.10.115.118.110.99.111.109.109.105.116.115.1
NET-SNMP-EXTEND-MIB::nsExtendOutLine."svncommits".1 = STRING: 11145

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Michael,

Let me do some more investigating on this and I'll get back to you.

Thanks for testing
Adam

Revision history for this message
Adam Stokes (adam-stokes) wrote :

Michael,

You could alter your previous query to resemble something like the following:

zef@lucid:/tmp$ snmpget -v1 -c stokescanonical localhost 'NET-SNMP-EXTEND-MIB::nsExtendResult."top_lists"'
NET-SNMP-EXTEND-MIB::nsExtendResult."top_lists" = INTEGER: 9

Thanks,
Adam

Revision history for this message
Michael Heldebrant (mheldebr) wrote :

snmp commands do work with:

mheldebr@server:/$ snmpwalk -v2c -c REDACTED localhost 'NET-SNMP-EXTEND-MIB::nsExtendOutLine."svncommits".1'
NET-SNMP-EXTEND-MIB::nsExtendOutLine."svncommits".1 = STRING: 11486

Revision history for this message
Adam Stokes (adam-stokes) wrote :

It doesn't look like your OID is correct, below is the one used for NET-SNMP-EXTEND-MIB:

zef@lucid:~$ snmpwalk -v1 -c stokescanonical localhost .1.3.6.1.4.1.8072.1.3.2
NET-SNMP-EXTEND-MIB::nsExtendNumEntries.0 = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendCommand."top_lists" = STRING: /bin/sh
NET-SNMP-EXTEND-MIB::nsExtendArgs."top_lists" = STRING: /usr/local/bin/blah.sh
NET-SNMP-EXTEND-MIB::nsExtendInput."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendCacheTime."top_lists" = INTEGER: 5
NET-SNMP-EXTEND-MIB::nsExtendExecType."top_lists" = INTEGER: exec(1)
NET-SNMP-EXTEND-MIB::nsExtendRunType."top_lists" = INTEGER: run-on-read(1)
NET-SNMP-EXTEND-MIB::nsExtendStorage."top_lists" = INTEGER: permanent(4)
NET-SNMP-EXTEND-MIB::nsExtendStatus."top_lists" = INTEGER: active(1)
NET-SNMP-EXTEND-MIB::nsExtendOutput1Line."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendOutputFull."top_lists" = STRING:
NET-SNMP-EXTEND-MIB::nsExtendOutNumLines."top_lists" = INTEGER: 1
NET-SNMP-EXTEND-MIB::nsExtendResult."top_lists" = INTEGER: 9
NET-SNMP-EXTEND-MIB::nsExtendOutLine."top_lists".1 = STRING:

Nothing else has changed as far as configuration goes.

Thanks,
Adam

Revision history for this message
Adam Stokes (adam-stokes) wrote :

For now I'll set this to invalid as I've had no issues getting external scripts to execute through NET-SNMP-EXTEND-MIB

Changed in net-snmp (Ubuntu):
status: Confirmed → Fix Released
tags: added: verification-done-lucid
Revision history for this message
Thomas (stilwellt) wrote :

apt-get install snmp-mibs-downloader

Fixed it for me in 12.04.

I'll spare everyone the deluge of obscenities I'm currently spewing at everyone within earshot of my brain.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.