[packages] net-snmp: Update to v5.4.2.1

git-svn-id: svn://svn.openwrt.org/openwrt/packages@16591 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
acinonyx 2009-06-27 21:43:45 +00:00
parent 72b9f41056
commit 392c95443d
8 changed files with 370 additions and 1107 deletions

View File

@ -8,12 +8,12 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=net-snmp
PKG_VERSION:=5.1.2
PKG_RELEASE:=5
PKG_VERSION:=5.4.2.1
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/net-snmp
PKG_MD5SUM:=8080555ab3f90011f25d5122042d9a8d
PKG_MD5SUM:=984932520143f0c8bf7b7ce1fc9e1da1
include $(INCLUDE_DIR)/package.mk
@ -98,7 +98,7 @@ SNMP_MIB_MODULES_INCLUDED = \
ieee802dot11 \
mibII/at \
mibII/icmp \
mibII/interfaces \
mibII/ifTable \
mibII/ip \
mibII/snmp_mib \
mibII/sysORTable \
@ -126,12 +126,19 @@ SNMP_MIB_MODULES_INCLUDED = \
SNMP_MIB_MODULES_EXCLUDED = \
agent_mibs \
agentx \
disman/event \
disman/schedule \
hardware \
host \
if-mib \
mibII \
notification \
notification-log-mib \
snmpv3mibs \
target \
tcp-mib \
ucd_snmp \
udp-mib \
utilities \
SNMP_TRANSPORTS_INCLUDED = Callback UDP
@ -168,13 +175,14 @@ define Build/Compile
rm -rf $(PKG_INSTALL_DIR)
mkdir -p $(PKG_INSTALL_DIR)
$(MAKE) -C $(PKG_BUILD_DIR) \
LDFLAGS="$(TARGET_LDFLAGS) -lm" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
all install
( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-shared; )
#ifneq ($(CONFIG_PACKAGE_snmpd-static),)
( cd $(PKG_BUILD_DIR); rm -f agent/snmpd; )
$(MAKE) -C $(PKG_BUILD_DIR) \
LDFLAGS="$(TARGET_LDFLAGS) -static" \
LDFLAGS="$(TARGET_LDFLAGS) -lm -static" \
INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
all install
( cd $(PKG_INSTALL_DIR); mv ./usr/sbin/snmpd ./usr/sbin/snmpd-static; )

View File

@ -0,0 +1,22 @@
--- net-snmp-5.1.2.orig/agent/mibgroup/mibII/interfaces.c
+++ net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c
@@ -1598,6 +1612,10 @@
struct ifnet *nnew;
char *stats, *ifstart = line;
+ /* Ignore interfaces with no statistics. */
+ if (strstr(line, "No statistics available."))
+ continue;
+
if (line[strlen(line) - 1] == '\n')
line[strlen(line) - 1] = '\0';
@@ -1631,7 +1649,7 @@
&coll) != 5)) {
if ((scan_line_to_use == scan_line_2_2)
&& !strstr(line, "No statistics available"))
- snmp_log(LOG_ERR,
+ snmp_log(LOG_DEBUG,
"/proc/net/dev data format error, line ==|%s|",
line);
continue;

View File

@ -0,0 +1,40 @@
--- net-snmp-5.1.2.orig/local/Makefile.in
+++ net-snmp-5.1.2/local/Makefile.in
@@ -58,7 +58,7 @@
mib2c.made: $(srcdir)/mib2c
if test "x$(PERL)" != "x" ; then \
- $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;' ${srcdir}/mib2c > mib2c.made; \
+ $(PERL) -p -e 's%^#!.*/perl.*%#!$(PERL)%;s#/usr/local/share/snmp#$(snmplibdir)#;s#/usr/local/etc/snmp#$(SNMPCONFPATH)#;' ${srcdir}/mib2c > mib2c.made; \
else \
touch mib2c.made; \
fi
--- net-snmp-5.1.2.orig/mibs/Makefile.in
+++ net-snmp-5.1.2/mibs/Makefile.in
@@ -43,11 +43,15 @@
UCDMIBS = UCD-SNMP-MIB.txt UCD-DEMO-MIB.txt UCD-IPFWACC-MIB.txt \
UCD-DLMOD-MIB.txt UCD-DISKIO-MIB.txt
+EXTRAMIBS = BGP4-MIB.txt BRIDGE-MIB.txt GNOME-SMI.txt OSPF-MIB.txt \
+ OSPF-TRAP-MIB.txt RIPv2-MIB.txt SOURCE-ROUTING-MIB.txt \
+ LM-SENSORS-MIB.txt
+
DEFAULTMIBS = @default_mibs_install@
MIBS = $(V1MIBS) $(V2MIBS) $(V3MIBS) $(RFCMIBS) \
$(AGENTMIBS) $(IANAMIBS) \
- $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS)
+ $(NETSNMPMIBS) $(UCDMIBS) $(DEFAULTMIBS) $(EXTRAMIBS)
all: standardall
--- net-snmp-5.1.2.orig/Makefile.top
+++ net-snmp-5.1.2/Makefile.top
@@ -27,6 +27,7 @@
snmplibdir = $(datadir)/snmp
mibdir = $(snmplibdir)/mibs
persistentdir = @PERSISTENT_DIRECTORY@
+sysconfdir = @sysconfdir@
DESTDIR = @INSTALL_PREFIX@
INSTALL_PREFIX = @INSTALL_PREFIX@

View File

@ -0,0 +1,14 @@
--- net-snmp-5.1.2.orig/local/mib2c
+++ net-snmp-5.1.2/local/mib2c
@@ -60,8 +60,9 @@
if($ENV{MIB2C_DIR}) {
push @def_search_dirs, split(/:/, $ENV{MIB2C_DIR});
}
-push @def_search_dirs, "/usr/local/share/snmp/";
-push @def_search_dirs, "/usr/local/share/snmp/mib2c-data";
+push @def_search_dirs, "/etc/snmp/";
+push @def_search_dirs, "/usr/share/snmp/";
+push @def_search_dirs, "/usr/share/snmp/mib2c-data";
push @def_search_dirs, "./mib2c-conf.d";
sub usage {

View File

@ -0,0 +1,95 @@
--- net-snmp-5.4.orig/FAQ 2006-11-25 00:34:18.000000000 +0100
+++ net-snmp-5.4/FAQ 2006-11-25 00:37:09.000000000 +0100
@@ -98,7 +98,7 @@
I don't understand the new access control stuff - what does it mean?
How do I configure SNMPv3 users?
The 'createUser' line disappears when I start the agent. Why?
- What's the difference between /var/net-snmp and /usr/local/share/snmp?
+ What's the difference between /var/lib/snmp and /usr/share/snmp?
My new agent is ignoring the old snmpd.conf file. Why?
Why am I getting "Connection refused"?
Why can't I see values in the UCDavis 'extensible' or 'disk' trees?
@@ -630,7 +630,7 @@
There are two steps required to add a new MIB file to the tools.
Firstly, copy the MIB file into the appropiate location:
- cp MY-MIB.txt /usr/local/share/snmp/mibs
+ cp MY-MIB.txt /usr/share/snmp/mibs
(which makes it available to everyone on the system)
or
@@ -1158,7 +1158,7 @@
If this is the case, then you can specify this interpreter
explicitly as part of the trap handle directive:
- traphandle default /usr/bin/perl /usr/local/bin/log_it
+ traphandle default /usr/bin/perl /usr/bin/log_it
In this case, it's almost certain that you'll also
need to give the full path to the traphandle script (as shown)
@@ -1232,7 +1232,7 @@
string to use.
Some of these (such as the MIB file location), might be best put in
- a shared snmp.conf file (typically /usr/local/share/snmp/snmp.conf or
+ a shared snmp.conf file (typically /usr/share/snmp/snmp.conf or
/etc/snmp/snmp.conf) to apply to all users of the system. Others
(particularly the SNMPv3 security settings), are more likely to refer
to a particular user, and should go in a personal snmp.conf file
@@ -1455,7 +1455,7 @@
Alternatively, the tools may be looking in the wrong place.
- The default location for the mib files is /usr/local/share/snmp/mibs.
+ The default location for the mib files is /usr/share/snmp/mibs.
Again, this is set when the suite is first configured and compiled.
This can be changed using the environmental variable 'MIBDIRS'
or the snmp.conf directive 'mibdirs'.
@@ -2409,7 +2409,7 @@
There are three ways to configure SNMPv3 users:
- 1) Stop the agent, and create a file /var/net-snmp/snmpd.conf,
+ 1) Stop the agent, and create a file /var/lib/snmp/snmpd.conf,
containing the line
createUser {myUser} MD5 {myPassword} DES
@@ -2422,7 +2422,7 @@
net-snmp-config --create-snmpv3-user
and follow the instructions. This will create an entry
- in the /var/net-snmp/snmpd.conf file similar to the above.
+ in the /var/lib/snmp/snmpd.conf file similar to the above.
Then re-start the snmpd agent.
3) Make sure the agent is running, and will respond to a suitable
@@ -2455,16 +2455,16 @@
-What's the difference between /var/net-snmp and /usr/local/share/snmp?
----------------------------------------------------------------------
+What's the difference between /var/lib/snmp and /usr/share/snmp?
+----------------------------------------------------------------
- The /var/net-snmp location is primarily used for information set
+ The /var/lib/snmp location is primarily used for information set
during the running of the agent, which needs to be persistent between
one run of the agent and the next. Apart from "createUser" (see
the previous entry), you shouldn't need to touch this file.
All other user-provided configuration should go in the traditional
- location (typically /usr/local/share/snmp/snmpd.conf or /etc/snmp).
+ location (typically /usr/share/snmp or /etc/snmp).
@@ -2477,7 +2477,7 @@
distribution), with the current release installed from the source.
The default location for this file with the basic distribution is
- /usr/local/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf).
+ /usr/share/snmp/snmpd.conf (or PREFIX/share/snmp/snmpd.conf).
Ready-installed versions often look for the file as /etc/snmpd.conf,
or /etc/snmp/snmpd.conf. Try moving the old config file to the new
location, and restart the agent.

View File

@ -0,0 +1,142 @@
--- net-snmp-5.1.2.orig/EXAMPLE.conf.def
+++ net-snmp-5.1.2/EXAMPLE.conf.def
@@ -6,7 +6,7 @@
###############################################################################
#
# This file is intended to only be an example. If, however, you want
-# to use it, it should be placed in SYSCONFDIR/snmp/snmpd.conf.
+# to use it, it should be placed in /etc/snmp/snmpd.conf.
# When the snmpd agent starts up, this is where it will look for it.
#
# You might be interested in generating your own snmpd.conf file using
@@ -58,31 +58,37 @@
# from):
# sec.name source community
-com2sec local localhost COMMUNITY
-com2sec mynetwork NETWORK/24 COMMUNITY
+com2sec paranoid default public
+#com2sec readonly default public
+#com2sec readwrite default private
####
# Second, map the security names into group names:
# sec.model sec.name
-group MyRWGroup v1 local
-group MyRWGroup v2c local
-group MyRWGroup usm local
-group MyROGroup v1 mynetwork
-group MyROGroup v2c mynetwork
-group MyROGroup usm mynetwork
+group MyROSystem v1 paranoid
+group MyROSystem v2c paranoid
+group MyROSystem usm paranoid
+group MyROGroup v1 readonly
+group MyROGroup v2c readonly
+group MyROGroup usm readonly
+group MyRWGroup v1 readwrite
+group MyRWGroup v2c readwrite
+group MyRWGroup usm readwrite
####
# Third, create a view for us to let the groups have rights to:
# incl/excl subtree mask
view all included .1 80
+view system included .iso.org.dod.internet.mgmt.mib-2.system
####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:
# context sec.model sec.level match read write notif
+access MyROSystem "" any noauth exact system none none
access MyROGroup "" any noauth exact all none none
access MyRWGroup "" any noauth exact all all none
@@ -100,8 +106,8 @@
# value of an object whose value is given here will fail with an error
# status of notWritable.
-syslocation Right here, right now.
-syscontact Me <me@somewhere.org>
+syslocation Unknown (configure /etc/snmp/snmpd.local.conf)
+syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf)
# Example output of snmpwalk:
# % snmpwalk -v 1 -c public localhost system
@@ -135,13 +141,13 @@
#
# Make sure mountd is running
-proc mountd
+#proc mountd
# Make sure there are no more than 4 ntalkds running, but 0 is ok too.
-proc ntalkd 4
+#proc ntalkd 4
# Make sure at least one sendmail, but less than or equal to 10 are running.
-proc sendmail 10 1
+#proc sendmail 10 1
# A snmpwalk of the prTable would look something like this:
#
@@ -199,7 +205,7 @@
# ARGS: optional arguments to be passed to the program
# a simple hello world
-exec echotest /bin/echo hello world
+#exec echotest /bin/echo hello world
# Run a shell script containing:
#
@@ -250,7 +256,7 @@
# Check the / partition and make sure it contains at least 10 megs.
-disk / 10000
+#disk / 10000
# % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.DISKMIBNUM
# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0
@@ -279,7 +285,7 @@
# 15MAX: Similar, but for 15 min average.
# Check for loads:
-load 12 14 14
+#load 12 14 14
# % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.LOADAVEMIBNUM
# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1
@@ -365,7 +371,7 @@
# (commented out here since it requires that you place the
# script in the right location. (its not installed by default))
-# pass .EXTENSIBLEDOTMIB.255 /bin/sh PREFIX/local/passtest
+# pass .EXTENSIBLEDOTMIB.255 /bin/sh /usr/local/passtest
# % snmpwalk -v 1 -c public localhost .EXTENSIBLEDOTMIB.255
# enterprises.ucdavis.255.1 = "life the universe and everything"
--- net-snmp-5.1.2.orig/EXAMPLE-trap.conf
+++ net-snmp-5.1.2/EXAMPLE-trap.conf
@@ -0,0 +1,18 @@
+###############################################################################
+#
+# EXAMPLE-trap.conf:
+# An example configuration file for configuring the Net-SNMP snmptrapd agent.
+#
+###############################################################################
+#
+# This file is intended to only be an example. If, however, you want
+# to use it, it should be placed in /etc/snmp/snmptrapd.conf.
+# When the snmptrapd agent starts up, this is where it will look for it.
+#
+# All lines beginning with a '#' are comments and are intended for you
+# to read. All other lines are configuration commands for the agent.
+
+#
+# PLEASE: read the snmptrapd.conf(5) manual page as well!
+#
+

View File

@ -1,44 +0,0 @@
Date: Tue, 14 Jun 2005 00:39:54 +0200
From: Alexander Holler <aholler@ahsoftware.de>
To: nthill@free.fr
Subject: Patch for libsnmp (openwrt) to work with ipsec-if
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Hello,
I've a small patch for net-snmp (5.1.2) which is needed to work with
ipsec-interfaces. Otherwise snmpd will segfault which means snmp is not
really usable.
The patch is from me, but the source for the fault is from:
http://lists.openswan.org/pipermail/users/2004-August/001773.html
It works, because this email is going out over ipsec using a
snmp-monitored wrt54g. ;)
--- net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c.orig 2005-06-14 00:41:16.000000000 +0200
+++ net-snmp-5.1.2/agent/mibgroup/mibII/interfaces.c 2005-06-14 03:21:35.000000000 +0200
@@ -1438,8 +1438,10 @@
if (ioctl(fd, 0x8947, &ifr) >= 0) {
new_ioctl_nums = 1;
+/*
} else if (ioctl(fd, SIOCDEVPRIVATE, &ifr) >= 0) {
new_ioctl_nums = 0;
+*/
} else {
DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIPHY on %s failed\n", ifr.ifr_name));
return retspeed;
@@ -1449,7 +1451,8 @@
for (mii_reg = 0; mii_reg < 8; mii_reg++){
data[0] = phy_id;
data[1] = mii_reg;
- if(ioctl(fd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) <0){
+/* if(ioctl(fd, new_ioctl_nums ? 0x8948 : SIOCDEVPRIVATE+1, &ifr) <0){ */
+ if(ioctl(fd, 0x8948, &ifr) <0){
DEBUGMSGTL(("mibII/interfaces", "SIOCGMIIREG on %s failed\n", ifr.ifr_name));
}
mii_val[mii_reg] = data[3];