OBS User unknown 2009-01-22 17:18:30 +00:00 committed by Git OBS Bridge
parent 6b939b06a5
commit 81983e70d3
7 changed files with 1281 additions and 1170 deletions

View File

@ -7,6 +7,7 @@ SNMP access (161/udp,162/udp) be blocked at your firewall.
There are also some important changes that have been made in this release
of our package:
o the daemon now sets a PID file in /var/run/
o logging is now done directly to /var/log/net-snmp.log instead
@ -25,14 +26,16 @@ of our package:
has been the source of many of the security problems with snmp
so please don't run this unless you are sure of what you are doing.
To install the script,
cp rc.snmptrapd /etc/init.d/snmptrapd
innserv /etc/init.d/snmptrapd
cd /usr/sbin && ln -s ../../etc/init.d/snmptrapd .
and create a configuration file named /etc/snmptrapd.conf. Then,
install rc.snmptrapd /etc/init.d/snmptrapd
chkconfig snmptrapd on
ln -s ../../etc/init.d/snmptrapd /usr/sbin/rcsnmptrapd.
and create a configuration file named /etc/snmp/snmptrapd.conf. Then,
start the daemon with
rcsnmptrapd start
Logging is done to /var/log/net-snmptrapd.log.
For more informations see the manpages for snmptrapd and snmptrapd.conf.
o Master agentx support is enabled if you have modules in
/usr/lib/net-snmp/--the domain socket is created as
/var/run/agentx/master. You can change this to a network
@ -41,5 +44,4 @@ of our package:
/var/lib/net-snmp.
More documentation on the net-snmp package can be found in this directory
as well as the project's homepage: http://net-snmp.sourceforge.net/
as well as the project's homepage: http://www.net-snmp.org/

View File

@ -1,7 +1,340 @@
Index: agent/mibgroup/rmon-mib/etherStatsTable.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable.c 2008-09-16 16:36:41.339791677 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats.h 2008-12-21 05:47:47.000000000 -0500
@@ -0,0 +1,7 @@
+/*
+ * module to include the modules
+ */
+
+#if defined(linux)
+config_require(rmon-mib/data_access/etherstats_linux)
+#endif
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/data_access/etherstats_linux.c 2009-01-12 07:38:52.000000000 -0500
@@ -0,0 +1,319 @@
+/*
+ * standard Net-SNMP includes
+ */
+#include <net-snmp/net-snmp-config.h>
+#include <net-snmp/net-snmp-includes.h>
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+
+/*
+ * include our parent header
+ */
+#include "rmon-mib/etherStatsTable/etherStatsTable.h"
+#include "rmon-mib/etherStatsTable/etherStatsTable_data_access.h"
+#include "rmon-mib/etherStatsTable/ioctl_imp_common.h"
+
+/*
+ * @retval 0 success
+ * @retval -1 getifaddrs failed
+ * @retval -2 memory allocation failed
+ */
+
+struct ifname *
+etherstats_interface_name_list_get (struct ifname *list_head, int *retval)
+{
+ struct ifaddrs *addrs = NULL, *p = NULL;
+ struct ifname *nameptr1=NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "called\n"));
+
+ if ((getifaddrs(&addrs)) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "getifaddrs failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, getifaddrs failed\n");
+ *retval = -1;
+ return NULL;
+ }
+
+ for (p = addrs; p; p = p->ifa_next) {
+
+ if (!list_head) {
+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ memset (list_head, 0, sizeof (struct ifname));
+ strncpy (list_head->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+ }
+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next)
+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE))
+ break;
+
+ if (nameptr1)
+ continue;
+
+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ interface_name_list_free (list_head);
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ nameptr2 = nameptr2->ifn_next;
+ memset (nameptr2, 0, sizeof (struct ifname));
+ strncpy (nameptr2->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+
+ }
+
+ freeifaddrs(addrs);
+ *retval = 0;
+ return list_head;
+}
+
+
+/*
+ * @retval 0 success
+ * @retval -1 invalid pointer
+ */
+
+int
+etherstats_interface_name_list_free (struct ifname *list_head)
+{
+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "called\n"));
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:etherStatsTable:interface_name_list_free: invalid pointer list_head");
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "invalid pointer list_head\n"));
+ return -1;
+ }
+
+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) {
+ nameptr2 = nameptr1->ifn_next;
+ free (nameptr1);
+ }
+
+ return 0;
+}
+
+/*
+ * @retval 0 : not found
+ * @retval !0 : ifIndex
+ */
+
+int
+etherstats_interface_ioctl_ifindex_get (int fd, const char *name) {
+#ifndef SIOCGIFINDEX
+ return 0;
+#else
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "ifindex_get\n"));
+
+ rc = _etherStats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStats:ioctl",
+ "ifindex_get error on inerface '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, ifindex_get error on inerface '%s'\n", name);
+ return 0;
+
+ }
+
+ return ifrq.ifr_ifindex;
+#endif /* SIOCGIFINDEX */
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 cannot get ETHTOOL_DRVINFO failed
+ * @retval -2 n_stats zero - no statistcs available
+ * @retval -3 memory allocation for holding the statistics failed
+ * @retval -4 cannot get ETHTOOL_GSTRINGS information
+ * @retval -5 cannot get ETHTOOL_GSTATS information
+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined
+ */
+
+int
+interface_ioctl_etherstats_get (etherStatsTable_rowreq_ctx *rowreq_ctx , int fd, const char *name) {
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+
+ etherStatsTable_data *data = &rowreq_ctx->data;
+ struct ethtool_drvinfo driver_info;
+ struct ethtool_gstrings *eth_strings;
+ struct ethtool_stats *eth_stats;
+ struct ifreq ifr;
+ unsigned int nstats, size_str, size_stats, i;
+ int err;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "called\n"));
+
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, name);
+
+ memset(&driver_info, 0, sizeof(driver_info));
+ driver_info.cmd = ETHTOOL_GDRVINFO;
+ ifr.ifr_data = (char *)&driver_info;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "ETHTOOL_GETDRVINFO failed on interface |%s| \n", name));
+ return -1;
+ }
+
+ nstats = driver_info.n_stats;
+ if (nstats < 1) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no stats available for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no stats availablei for interface |%s| \n", name);
+ return -2;
+ }
+
+ size_str = nstats * ETH_GSTRING_LEN;
+ size_stats = nstats * sizeof(u64);
+
+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings));
+ if (!eth_strings) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings)));
+
+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats));
+ if (!eth_stats) {
+ free (eth_strings);
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats)));
+
+ eth_strings->cmd = ETHTOOL_GSTRINGS;
+ eth_strings->string_set = ETH_SS_STATS;
+ eth_strings->len = nstats;
+ ifr.ifr_data = (char *) eth_strings;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats strings information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -4;
+ }
+
+ eth_stats->cmd = ETHTOOL_GSTATS;
+ eth_stats->n_stats = nstats;
+ ifr.ifr_data = (char *) eth_stats;
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -5;
+ }
+
+ for (i = 0; i < nstats; i++) {
+ char s[ETH_GSTRING_LEN];
+
+ strncpy(s, (const char *) &eth_strings->data[i * ETH_GSTRING_LEN],
+ ETH_GSTRING_LEN);
+
+ if (ETHERSTATSJABBERS(s)) {
+ data->etherStatsJabbers = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_ETHERSTATSJABBERS_FLAG;
+ }
+ }
+ free(eth_strings);
+ free(eth_stats);
+
+ return 0;
+#else
+ return -6;
+#endif
+
+}
+
+
+/* ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param which
+ * @param ifrq
+ * param ifentry : ifentry to update
+ * @param name
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ */
+int
+_etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name)
+{
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "_etherStats_ioctl_get\n"));
+ /*
+ * sanity checks
+ */
+ if(NULL == name) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get invalid ifname '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get couldn't create a socket\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+
+ return -2;
+ }
+ }
+
+ strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0;
+ rc = ioctl(fd, which, ifrq);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get ioctl %d returned %d\n", which, rc));
+ rc = -3;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ return rc;
+}
+
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.c 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,229 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -232,11 +565,10 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable.c
+
+
+/** @{ */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_access.c 2008-09-16 16:36:41.375791976 +0200
@@ -0,0 +1,825 @@
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.c 2009-01-12 03:39:26.000000000 -0500
@@ -0,0 +1,522 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
+ * version : 14170 $ of $
@ -254,10 +586,11 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+ * include our parent header
+ */
+#include "etherStatsTable.h"
+
+
+#include "etherStatsTable_data_access.h"
+
+#if defined(linux)
+#include "ioctl_imp_common.h"
+#endif
+
+/** @ingroup interface
+ * @addtogroup data_access data_access: Routines to access data
@ -458,11 +791,13 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+ * etherStatsIndex(1)/INTEGER32/ASN_INTEGER/long(long)//l/A/w/e/R/d/h
+ */
+
+
+ long etherStatsIndex;
+ int fd;
+ int rc = 0, retval = 0;
+
+#if defined(linux)
+ struct ifname *list_head = NULL, *p = NULL;
+#endif
+
+ /*
+ * create socket for ioctls
@ -479,7 +814,8 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+ * and list_head contains null
+ */
+
+ list_head = interface_name_list_get (list_head, &retval);
+#if defined(linux)
+ list_head = etherstats_interface_name_list_get (list_head, &retval);
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:etherStatsTable, error getting the interface names present in the system\n");
@ -502,7 +838,7 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+ * get index via ioctl.
+ */
+
+ etherStatsIndex = (long) interface_ioctl_ifindex_get(-1, p->name);
+ etherStatsIndex = (long) etherstats_interface_ioctl_ifindex_get(-1, p->name);
+
+ /*
+ * get the etherstats contents populated, if the device is not an ethernet device
@ -556,12 +892,12 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+ * free the interface names list
+ */
+
+ if ( (interface_name_list_free(list_head)) < 0) {
+ if ( (etherstats_interface_name_list_free(list_head)) < 0) {
+ snmp_log(LOG_ERR, "access:etherStatsTable, error freeing the interface name list \n");
+ DEBUGMSGTL(("access:etherStatsTable", "error freeing the interface name list\n"));
+ return MFD_ERROR;
+ }
+
+#endif
+
+ DEBUGMSGT(("verbose:etherStatsTable:etherStatsTable_container_load",
+ "inserted %d records\n", count));
@ -570,313 +906,6 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+}
+ /* etherStatsTable_container_load */
+
+/*
+ * @retval 0 success
+ * @retval -1 getifaddrs failed
+ * @retval -2 memory allocation failed
+ */
+
+static struct ifname *
+interface_name_list_get (struct ifname *list_head, int *retval)
+{
+ struct ifaddrs *addrs = NULL, *p = NULL;
+ struct ifname *nameptr1=NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "called\n"));
+
+ if ((getifaddrs(&addrs)) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "getifaddrs failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, getifaddrs failed\n");
+ *retval = -1;
+ return NULL;
+ }
+
+ for (p = addrs; p; p = p->ifa_next) {
+
+ if (!list_head) {
+ if ( (list_head = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ memset (list_head, 0, sizeof (struct ifname));
+ strncpy (list_head->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+ }
+ for (nameptr1 = list_head; nameptr1; nameptr2 = nameptr1, nameptr1 = nameptr1->ifn_next)
+ if (!strncmp(p->ifa_name, nameptr1->name, IF_NAMESIZE))
+ break;
+
+ if (nameptr1)
+ continue;
+
+ if ( (nameptr2->ifn_next = (struct ifname *) malloc (sizeof(struct ifname))) < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_get",
+ "memory allocation failed\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_name_list_get, memory allocation failed\n");
+ interface_name_list_free (list_head);
+ freeifaddrs(addrs);
+ *retval = -2;
+ return NULL;
+ }
+ nameptr2 = nameptr2->ifn_next;
+ memset (nameptr2, 0, sizeof (struct ifname));
+ strncpy (nameptr2->name, p->ifa_name, IF_NAMESIZE);
+ continue;
+
+ }
+
+ freeifaddrs(addrs);
+ *retval = 0;
+ return list_head;
+}
+
+
+/*
+ * @retval 0 success
+ * @retval -1 invalid pointer
+ */
+
+static int
+interface_name_list_free (struct ifname *list_head)
+{
+ struct ifname *nameptr1 = NULL, *nameptr2 = NULL;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "called\n"));
+
+ if (!list_head) {
+ snmp_log (LOG_ERR, "access:etherStatsTable:interface_name_list_free: invalid pointer list_head");
+ DEBUGMSGTL(("access:etherStatsTable:interface_name_list_free",
+ "invalid pointer list_head\n"));
+ return -1;
+ }
+
+ for (nameptr1 = list_head; nameptr1; nameptr1 = nameptr2) {
+ nameptr2 = nameptr1->ifn_next;
+ free (nameptr1);
+ }
+
+ return 0;
+}
+
+/*
+ * @retval 0 : not found
+ * @retval !0 : ifIndex
+ */
+
+static int
+interface_ioctl_ifindex_get (int fd, const char *name) {
+#ifndef SIOCGIFINDEX
+ return 0;
+#else
+ struct ifreq ifrq;
+ int rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "ifindex_get\n"));
+
+ rc = _etherStats_ioctl_get(fd, SIOCGIFINDEX, &ifrq, name);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStats:ioctl",
+ "ifindex_get error on inerface '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, ifindex_get error on inerface '%s'\n", name);
+ return 0;
+
+ }
+
+ return ifrq.ifr_ifindex;
+#endif /* SIOCGIFINDEX */
+}
+
+/*
+ * @retval 0 success
+ * @retval -1 cannot get ETHTOOL_DRVINFO failed
+ * @retval -2 n_stats zero - no statistcs available
+ * @retval -3 memory allocation for holding the statistics failed
+ * @retval -4 cannot get ETHTOOL_GSTRINGS information
+ * @retval -5 cannot get ETHTOOL_GSTATS information
+ * @retval -6 function not supported if HAVE_LINUX_ETHTOOL_H not defined
+ */
+
+int
+interface_ioctl_etherstats_get (etherStatsTable_rowreq_ctx *rowreq_ctx , int fd, const char *name) {
+
+#ifdef HAVE_LINUX_ETHTOOL_H
+
+ etherStatsTable_data *data = &rowreq_ctx->data;
+ struct ethtool_drvinfo driver_info;
+ struct ethtool_gstrings *eth_strings;
+ struct ethtool_stats *eth_stats;
+ struct ifreq ifr;
+ unsigned int nstats, size_str, size_stats, i;
+ int err;
+
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "called\n"));
+
+ memset(&ifr, 0, sizeof(ifr));
+ strcpy(ifr.ifr_name, name);
+
+ memset(&driver_info, 0, sizeof(driver_info));
+ driver_info.cmd = ETHTOOL_GDRVINFO;
+ ifr.ifr_data = (char *)&driver_info;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "ETHTOOL_GETDRVINFO failed on interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, ETHTOOL_GETDRVINFO failed on interface |%s| \n", name);
+ return -1;
+ }
+
+ nstats = driver_info.n_stats;
+ if (nstats < 1) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no stats available for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no stats availablei for interface |%s| \n", name);
+ return -2;
+ }
+
+ size_str = nstats * ETH_GSTRING_LEN;
+ size_stats = nstats * sizeof(u64);
+
+ eth_strings = malloc(size_str + sizeof (struct ethtool_gstrings));
+ if (!eth_strings) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_strings, 0, (size_str + sizeof (struct ethtool_gstrings)));
+
+ eth_stats = malloc (size_str + sizeof (struct ethtool_stats));
+ if (!eth_stats) {
+ free (eth_strings);
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "no memory available\n"));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, no memory available\n");
+
+ return -3;
+ }
+ memset (eth_stats, 0, (size_str + sizeof (struct ethtool_stats)));
+
+ eth_strings->cmd = ETHTOOL_GSTRINGS;
+ eth_strings->string_set = ETH_SS_STATS;
+ eth_strings->len = nstats;
+ ifr.ifr_data = (char *) eth_strings;
+
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats strings information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -4;
+ }
+
+ eth_stats->cmd = ETHTOOL_GSTATS;
+ eth_stats->n_stats = nstats;
+ ifr.ifr_data = (char *) eth_stats;
+ err = _etherStats_ioctl_get(fd, SIOCETHTOOL, &ifr, name);
+ if (err < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:interface_ioctl_etherstats_get",
+ "cannot get stats strings information for interface |%s| \n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable,interface_ioctl_etherstats_get, cannot get stats information for interface |%s| \n", name);
+
+ free(eth_strings);
+ free(eth_stats);
+ return -5;
+ }
+
+ for (i = 0; i < nstats; i++) {
+ char s[ETH_GSTRING_LEN];
+
+ strncpy(s, (const char *) &eth_strings->data[i * ETH_GSTRING_LEN],
+ ETH_GSTRING_LEN);
+
+ if (ETHERSTATSJABBERS(s)) {
+ data->etherStatsJabbers = (u_long)eth_stats->data[i];
+ rowreq_ctx->column_exists_flags |= COLUMN_ETHERSTATSJABBERS_FLAG;
+ }
+ }
+ free(eth_strings);
+ free(eth_stats);
+
+ return 0;
+#else
+ return -6;
+#endif
+
+}
+
+
+/* ioctl wrapper
+ *
+ * @param fd : socket fd to use w/ioctl, or -1 to open/close one
+ * @param which
+ * @param ifrq
+ * param ifentry : ifentry to update
+ * @param name
+ *
+ * @retval 0 : success
+ * @retval -1 : invalid parameters
+ * @retval -2 : couldn't create socket
+ * @retval -3 : ioctl call failed
+ */
+static int
+_etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name)
+{
+ int ourfd = -1, rc = 0;
+
+ DEBUGMSGTL(("access:etherStatsTable:ioctl", "_etherStats_ioctl_get\n"));
+ /*
+ * sanity checks
+ */
+ if(NULL == name) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get invalid ifname '%s'\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+ return -1;
+ }
+
+ /*
+ * create socket for ioctls
+ */
+ if(fd < 0) {
+ fd = ourfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if(ourfd < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get couldn't create a socket\n", name));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+
+ return -2;
+ }
+ }
+
+ strncpy(ifrq->ifr_name, name, sizeof(ifrq->ifr_name));
+ ifrq->ifr_name[ sizeof(ifrq->ifr_name)-1 ] = 0;
+ rc = ioctl(fd, which, ifrq);
+ if (rc < 0) {
+ DEBUGMSGTL(("access:etherStatsTable:ioctl",
+ "_etherStats_ioctl_get ioctl %d returned %d\n", which, rc));
+ snmp_log (LOG_ERR, "access:etherStatsTable:ioctl, _etherStats_ioctl_get error on inerface '%s'\n", name);
+
+ rc = -3;
+ }
+
+ if(ourfd >= 0)
+ close(ourfd);
+
+ return rc;
+}
+
+/**
+ * container clean up
@ -1062,10 +1091,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.c
+} /* etherStatsTable_validate_index */
+
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_access.h 2008-09-16 16:36:41.440291464 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_access.h 2008-08-31 11:04:55.000000000 -0400
@@ -0,0 +1,80 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -1147,10 +1175,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_access.h
+}
+#endif
+#endif /* ETHERSTATSTABLE_DATA_ACCESS_H */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_get.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_get.c 2008-09-16 16:36:41.479792276 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.c 2008-08-25 09:31:32.000000000 -0400
@@ -0,0 +1,1411 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -2563,10 +2590,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_get.c
+
+
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_get.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_get.h 2008-09-16 16:36:41.507791686 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_get.h 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,151 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -2719,10 +2745,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_get.h
+#endif
+#endif /* ETHERSTATSTABLE_DATA_GET_H */
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_set.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_set.c 2008-09-16 16:36:41.547792106 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.c 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,977 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -3701,10 +3726,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_set.c
+} /* etherStatsStatus_undo */
+
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_data_set.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_data_set.h 2008-09-16 16:36:41.571792191 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_data_set.h 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,356 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -4062,10 +4086,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_data_set.h
+}
+#endif
+#endif /* ETHERSTATSTABLE_DATA_SET_H */
Index: agent/mibgroup/rmon-mib/etherStatsTable_enums.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_enums.h 2008-09-16 16:36:41.595792061 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_enums.h 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,57 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -4124,10 +4147,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_enums.h
+}
+#endif
+#endif /* ETHERSTATSTABLE_ENUMS_H */
Index: agent/mibgroup/rmon-mib/etherStatsTable.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable.h 2008-09-16 16:36:41.639791658 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable.h 2008-09-09 12:03:42.000000000 -0400
@@ -0,0 +1,303 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -4432,10 +4454,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable.h
+#endif
+#endif /* ETHERSTATSTABLE_H */
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_interface.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_interface.c 2008-09-16 16:36:41.663791903 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.c 2008-09-12 14:15:42.000000000 -0400
@@ -0,0 +1,2225 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -6662,10 +6683,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_interface.c
+
+ return rowreq_ctx;
+}
Index: agent/mibgroup/rmon-mib/etherStatsTable_interface.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_interface.h 2008-09-16 16:36:41.687791226 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_interface.h 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,98 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -6765,10 +6785,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_interface.h
+#endif
+#endif /* ETHERSTATSTABLE_INTERFACE_H */
+/** @} */
Index: agent/mibgroup/rmon-mib/etherStatsTable_oids.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/etherStatsTable_oids.h 2008-09-16 16:36:41.715791881 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/etherStatsTable_oids.h 2008-08-25 02:37:27.000000000 -0400
@@ -0,0 +1,107 @@
+/*
+ * Note: this file originally auto-generated by mib2c using
@ -6877,10 +6896,9 @@ Index: agent/mibgroup/rmon-mib/etherStatsTable_oids.h
+}
+#endif
+#endif /* ETHERSTATSTABLE_OIDS_H */
Index: agent/mibgroup/rmon-mib/ioctl_imp_common.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib/ioctl_imp_common.h 2008-09-16 16:36:41.755791948 +0200
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable/ioctl_imp_common.h 2008-12-21 05:55:16.000000000 -0500
@@ -0,0 +1,35 @@
+#include <sys/socket.h>
+#include <sys/types.h>
@ -6905,10 +6923,10 @@ Index: agent/mibgroup/rmon-mib/ioctl_imp_common.h
+ char name [IF_NAMESIZE];
+};
+
+static struct ifname *interface_name_list_get (struct ifname *, int *);
+static int interface_name_list_free (struct ifname *list_head);
+static int interface_ioctl_ifindex_get (int fd, const char *name);
+static int _etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name);
+struct ifname *etherstats_interface_name_list_get (struct ifname *, int *);
+int etherstats_interface_name_list_free (struct ifname *list_head);
+int etherstats_interface_ioctl_ifindex_get (int fd, const char *name);
+int _etherStats_ioctl_get(int fd, int which, struct ifreq *ifrq, const char* name);
+int interface_ioctl_etherstats_get(etherStatsTable_rowreq_ctx *rowreq_ctx, int fd, const char* name);
+
+/* for maintainability */
@ -6917,20 +6935,32 @@ Index: agent/mibgroup/rmon-mib/ioctl_imp_common.h
+
+#define ETHERSTATSJABBERS(x) strstr(x, BROADCOM_RECEIVE_JABBERS)
+
Index: agent/mibgroup/rmon-mib.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ agent/mibgroup/rmon-mib.h 2008-09-16 16:36:41.779791875 +0200
@@ -0,0 +1,12 @@
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib/etherStatsTable.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib/etherStatsTable.h 2008-12-21 05:47:48.000000000 -0500
@@ -0,0 +1,11 @@
+/*
+ * module to include the modules
+ */
+
+config_require(rmon-mib/data_access/etherstats)
+config_require(rmon-mib/etherStatsTable/etherStatsTable)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_get)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_set)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_data_access)
+config_require(rmon-mib/etherStatsTable/etherStatsTable_interface)
+
diff -uNr net-snmp-5.4.1.2/agent/mibgroup/rmon-mib.h net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib.h
--- net-snmp-5.4.1.2/agent/mibgroup/rmon-mib.h 1969-12-31 19:00:00.000000000 -0500
+++ net-snmp-5.4.1.2-new/agent/mibgroup/rmon-mib.h 2008-12-21 05:41:57.000000000 -0500
@@ -0,0 +1,8 @@
+/*
+ * module to include the modules
+ */
+
+config_require(rmon-mib/etherStatsTable)
+config_require(rmon-mib/etherStatsTable_interface)
+config_require(rmon-mib/etherStatsTable_data_get)
+config_require(rmon-mib/etherStatsTable_data_set)
+config_require(rmon-mib/etherStatsTable_data_access)
+config_add_mib(RMON-MIB)
+
+

View File

@ -1,8 +1,30 @@
-------------------------------------------------------------------
Thu Jan 22 16:36:00 CET 2009 - mrueckert@suse.de
- updated patches from Dell:
Those patches incorporate the latest fixes for remarks from the
upstream review
old: net-snmp-5.4.1.2-rmon-mib-revised.patch
new: net-snmp-5.4.1.2-rmon-mib-revised_3.patch
old: net-snmp-5.4.1.2-etherlike-mib-revised_2.patch
new: net-snmp-5.4.1.2-etherlike-mib-revised_4.patch
-------------------------------------------------------------------
Wed Dec 10 12:34:56 CET 2008 - olh@suse.de
- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade
(bnc#437293)
- use Obsoletes: -XXbit only for ppc64 to help solver during
distupgrade (bnc#437293)
-------------------------------------------------------------------
Fri Dec 5 22:07:47 CET 2008 - mrueckert@suse.de
- fix the snmptrapd init script:
1. make sure the config isnt loaded twice.
2. do not truncate the net-snmp.log
3. use SNMPD_LOGLEVEL aswell.
4. write a pid
- update snmptrapd section in README.SuSE
- whitespace cleanup in both init scripts
-------------------------------------------------------------------
Fri Nov 21 14:53:28 CET 2008 - mrueckert@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package net-snmp (Version 5.4.2.1)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -20,7 +20,7 @@
Name: net-snmp
Version: 5.4.2.1
Release: 5
Release: 6
#
License: BSD 3-Clause; X11/MIT
Group: Productivity/Networking/Other
@ -77,8 +77,8 @@ Patch8: net-snmp-5.4.2_net-snmp-config_headercheck.patch
Patch9: net-snmp-5.4.2_perl_tk_warning.patch
Patch10: net-snmp-5.4.2_snmpconf-selinux.patch
Patch11: net-snmp-5.3.0.1_trap-agent-addr_v2.patch
Patch12: net-snmp-5.4.1.2-etherlike-mib-revised_2.patch
Patch13: net-snmp-5.4.1.2-rmon-mib-revised.patch
Patch12: net-snmp-5.4.1.2-etherlike-mib-revised_4.patch
Patch13: net-snmp-5.4.1.2-rmon-mib-revised_3.patch
Patch14: net-snmp-5.4.2_velocity-mib.patch
Patch15: Fix-for-tcpConnnectionTable-tcpListenerTable-udpEn.patch
Patch16: Fix-for-IPv6-Interface-Table.patch
@ -215,8 +215,8 @@ Authors:
%patch9
%patch10
%patch11
%patch12
%patch13
%patch12 -p1
%patch13 -p1
%patch14
%patch15 -p1
%patch16 -p1
@ -431,9 +431,25 @@ fi
%{_bindir}/tkmib
%changelog
* Thu Jan 22 2009 mrueckert@suse.de
- updated patches from Dell:
Those patches incorporate the latest fixes for remarks from the
upstream review
old: net-snmp-5.4.1.2-rmon-mib-revised.patch
new: net-snmp-5.4.1.2-rmon-mib-revised_3.patch
old: net-snmp-5.4.1.2-etherlike-mib-revised_2.patch
new: net-snmp-5.4.1.2-etherlike-mib-revised_4.patch
* Wed Dec 10 2008 olh@suse.de
- use Obsoletes: -XXbit only for ppc64 to help solver during distupgrade
(bnc#437293)
- use Obsoletes: -XXbit only for ppc64 to help solver during
distupgrade (bnc#437293)
* Fri Dec 05 2008 mrueckert@suse.de
- fix the snmptrapd init script:
1. make sure the config isnt loaded twice.
2. do not truncate the net-snmp.log
3. use SNMPD_LOGLEVEL aswell.
4. write a pid
- update snmptrapd section in README.SuSE
- whitespace cleanup in both init scripts
* Fri Nov 21 2008 mrueckert@suse.de
- update patches from Dell:
Upstream asked to reduce the logging in the mib module.

View File

@ -15,9 +15,20 @@
### END INIT INFO
SNMPTRAPD=/usr/sbin/snmptrapd
SNMPTRAPD_CONF="/etc/snmp/snmptrapd.conf"
SNMPTRAPD_LOGFILE="/var/log/net-snmp.log"
test -x $SNMPTRAPD || exit 5
# Check for existence of needed config file and read it
SNMPD_CONFIG=/etc/sysconfig/net-snmp
test -r $SNMPD_CONFIG || { echo "$SNMPD_CONFIG not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Read config
. $SNMPD_CONFIG
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
@ -46,11 +57,16 @@ rc_reset
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
if [ $SNMPTRAPD_CONF = "/etc/snmp/snmptrapd.conf" ]; then
SNMPTRAPD_CONF=""
else
SNMPTRAPD_CONF="-c $SNMPTRAPD_CONF"
fi
SNMPTRAPD_LOGFILE="${SNMPTRAPD_LOGFILE:-/var/log/net-snmp.log}"
case "$1" in
start)
echo -n "Starting snmptrapd:"
startproc $SNMPTRAPD -c /etc/snmptrapd.conf -Lf /var/log/net-snmpd.log
startproc $SNMPTRAPD $SNMPTRAPD_CONF -A -Lf ${SNMPD_LOGLEVEL:-d} $SNMPTRAPD_LOGFILE -p /var/run/snmptrapd.pid
rc_status -v
;;
stop)