[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-bugs
Subject:    [ net-snmp-Bugs-1696044 ] hrFSStorageIndex incorrect
From:       "SourceForge.net" <noreply () sourceforge ! net>
Date:       2007-05-10 20:42:37
Message-ID: E1HmFTB-0005H0-4O () sc8-sf-web21 ! sourceforge ! net
[Download RAW message or body]

Bugs item #1696044, was opened at 2007-04-07 13:44
Message generated for change (Comment added) made by dprunier
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1696044&group_id=12694

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: mibs
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dennis Jacobfeuerborn (themarvin2k)
Assigned to: Nobody/Anonymous (nobody)
Summary: hrFSStorageIndex incorrect

Initial Comment:
It seems net-snmp does not set the hrFSStorageIndex values correctly. I'm running \
this on net-snmp 5.4 on Fedora Core Rawhide.

This is what hrFS* has to say about my filesystems:

HOST-RESOURCES-MIB::hrFSMountPoint.1 = STRING: "/"
HOST-RESOURCES-MIB::hrFSMountPoint.2 = STRING: "/sys"
HOST-RESOURCES-MIB::hrFSMountPoint.3 = STRING: "/boot"
HOST-RESOURCES-MIB::hrFSMountPoint.4 = STRING: "/mnt/windata"
HOST-RESOURCES-MIB::hrFSMountPoint.5 = STRING: "/mnt/windows"
HOST-RESOURCES-MIB::hrFSMountPoint.6 = STRING: "/proc/sys/fs/binfmt_misc"
HOST-RESOURCES-MIB::hrFSMountPoint.7 = STRING: "/var/lib/nfs/rpc_pipefs"

HOST-RESOURCES-MIB::hrFSStorageIndex.1 = INTEGER: 4
HOST-RESOURCES-MIB::hrFSStorageIndex.2 = INTEGER: 5
HOST-RESOURCES-MIB::hrFSStorageIndex.3 = INTEGER: 6
HOST-RESOURCES-MIB::hrFSStorageIndex.4 = INTEGER: 7
HOST-RESOURCES-MIB::hrFSStorageIndex.5 = INTEGER: 8
HOST-RESOURCES-MIB::hrFSStorageIndex.6 = INTEGER: 9
HOST-RESOURCES-MIB::hrFSStorageIndex.7 = INTEGER: 10

This is what hrStorage* has to say:

HOST-RESOURCES-MIB::hrMemorySize.0 = INTEGER: 1933176 KBytes
HOST-RESOURCES-MIB::hrStorageIndex.1 = INTEGER: 1
HOST-RESOURCES-MIB::hrStorageIndex.3 = INTEGER: 3
HOST-RESOURCES-MIB::hrStorageIndex.6 = INTEGER: 6
HOST-RESOURCES-MIB::hrStorageIndex.7 = INTEGER: 7
HOST-RESOURCES-MIB::hrStorageIndex.8 = INTEGER: 8
HOST-RESOURCES-MIB::hrStorageIndex.10 = INTEGER: 10
HOST-RESOURCES-MIB::hrStorageIndex.31 = INTEGER: 31
HOST-RESOURCES-MIB::hrStorageIndex.32 = INTEGER: 32
HOST-RESOURCES-MIB::hrStorageIndex.33 = INTEGER: 33
HOST-RESOURCES-MIB::hrStorageIndex.34 = INTEGER: 34
HOST-RESOURCES-MIB::hrStorageIndex.35 = INTEGER: 35
HOST-RESOURCES-MIB::hrStorageIndex.36 = INTEGER: 36
HOST-RESOURCES-MIB::hrStorageIndex.37 = INTEGER: 37

HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Physical memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Virtual memory
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: Memory buffers
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: Cached memory
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: Shared memory
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: Swap space
HOST-RESOURCES-MIB::hrStorageDescr.31 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.32 = STRING: /sys
HOST-RESOURCES-MIB::hrStorageDescr.33 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.34 = STRING: /mnt/windata
HOST-RESOURCES-MIB::hrStorageDescr.35 = STRING: /mnt/windows
HOST-RESOURCES-MIB::hrStorageDescr.36 = STRING: /proc/sys/fs/binfmt_misc
HOST-RESOURCES-MIB::hrStorageDescr.37 = STRING: /var/lib/nfs/rpc_pipefs

Notice how the hrFSStorageIndex values do not point to the appropriate hrStorageIndex \
values. This makes relating the Filesystem data to the corresponding date in the \
StorageTable problematic.


----------------------------------------------------------------------

Comment By: Dominique Prunier (dprunier)
Date: 2007-05-10 20:42

Message:
Logged In: YES 
user_id=1790347
Originator: NO

I have written a quick patch to fix it for the 5.4 release. It seems that
some headers got out of sync.
It would be cool to review it and eventually commit it into trunk.

--- net-snmp-5.4/agent/mibgroup/host/hr_filesys.c.orig  2006-08-05
20:01:01.000000000 -0400
+++ net-snmp-5.4/agent/mibgroup/host/hr_filesys.c       2007-05-10
15:25:43.000000000 -0400
@@ -45,6 +45,9 @@
 #include <sys/statfs.h>
 #endif
 
+#include <net-snmp/agent/net-snmp-agent-includes.h>
+#include <net-snmp/agent/hardware/memory.h>
+
 #if defined(bsdi4) || defined(freebsd3) || defined(freebsd4) ||
defined(freebsd5) || defined(darwin)
 #if HAVE_GETFSSTAT && defined(MFSNAMELEN)
 #define MOUNT_NFS      "nfs"
@@ -533,7 +536,7 @@
             long_return = 2;    /* others probably aren't */
         return (u_char *) & long_return;
     case HRFSYS_STOREIDX:
-        long_return = fsys_idx + HRS_TYPE_FIXED_MAX;
+        long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX;
         return (u_char *) & long_return;
     case HRFSYS_FULLDUMP:
         return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len);
--- net-snmp-5.4/agent/mibgroup/host/hr_filesys.h.orig  2007-05-10
15:27:37.000000000 -0400
+++ net-snmp-5.4/agent/mibgroup/host/hr_filesys.h       2007-05-10
15:27:50.000000000 -0400
@@ -5,6 +5,8 @@
 #ifndef _MIBGROUP_HRFSYS_H
 #define _MIBGROUP_HRFSYS_H
 
+config_arch_require(linux, hardware/memory)
+
 extern void     init_hr_filesys(void);
 extern void     Init_HR_FileSys(void);
 extern FindVarMethod var_hrfilesys;
--- net-snmp-5.4/agent/mibgroup/host/hr_storage.c.orig  2007-05-10
14:54:22.000000000 -0400
+++ net-snmp-5.4/agent/mibgroup/host/hr_storage.c       2007-05-10
14:54:52.000000000 -0400
@@ -491,15 +491,6 @@
         *
         *********************/
 
-static const char *hrs_descr[] = {
-    NULL,
-    "Memory Buffers",           /* HRS_TYPE_MBUF */
-    "Real Memory",              /* HRS_TYPE_MEM */
-    "Swap Space"                /* HRS_TYPE_SWAP */
-};
-
-
-
 u_char         *
 var_hrstore(struct variable *vp,
             oid * name,
--- net-snmp-5.4/agent/mibgroup/host/hr_storage.h.orig  2007-05-10
14:54:31.000000000 -0400
+++ net-snmp-5.4/agent/mibgroup/host/hr_storage.h       2007-05-10
14:55:03.000000000 -0400
@@ -11,12 +11,6 @@
 extern void     init_hr_storage(void);
 extern FindVarMethod var_hrstore;
 
-
-#define        HRS_TYPE_MBUF           1
-#define        HRS_TYPE_MEM            2
-#define        HRS_TYPE_SWAP           3
-#define        HRS_TYPE_FIXED_MAX      3     /* the largest fixed type
*/
-
 #ifdef WIN32
 /* linux-compatible values for fs type */
 #define MSDOS_SUPER_MAGIC     0x4d44


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=1696044&group_id=12694

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-bugs mailing list
Net-snmp-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-bugs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic