Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
+++ This bug was initially created as a clone of Bug #532672 +++
Created an attachment (id=367291)
Proposed patch for net-snmp 5.1.2
Description of problem:
The indexes of the filesystems as reported by hrStorage are not persistent across mount/umoumts.
That breaks third party tools that rely on persistent indexes, as specified in the RFC1514:
http://tools.ietf.org/html/rfc1514#page-6
hrFSIndex OBJECT-TYPE
SYNTAX INTEGER (1..2147483647)
ACCESS read-only
STATUS mandatory
DESCRIPTION
"A unique value for each file system local to this
host. The value for each file system must remain
constant at least from one re-initialization of
the agent to the next re-initialization."
Version-Release number of selected component (if applicable):
net0snmp-5.1.2
How reproducible:
Always
Steps to Reproduce:
1. Make sure the MIB for hrStorage is available:
# cat /etc/snmp/snmpd.conf
com2sec notConfigUser default public
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1
access notConfigGroup "" any noauth exact systemview none none
2. Make sure different filesystems are mounted:
# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/hda1 on /boot type ext3 (rw)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sda1 on /mnt/sda1 type ext3 (rw)
/dev/sdb1 on /mnt/sdb1 type ext3 (rw)
/dev/sda2 on /mnt/sda2 type ext3 (rw)
/dev/sdb2 on /mnt/sdb2 type ext3 (rw)
/dev/sda3 on /mnt/sda3 type ext3 (rw)
/dev/sdb3 on /mnt/sdb3 type ext3 (rw)
/dev/sda5 on /mnt/sda5 type ext3 (rw)
/dev/sdb5 on /mnt/sdb5 type ext3 (rw)
3. query the hrStorage MIB with snmpwalk
# snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorage
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /sys
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /proc/sys/fs/binfmt_misc
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.11 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sda2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.17 = STRING: /mnt/sdb5
4. umoung one of the file systems in the middle and remount it
# umount /mnt/sda2
# mount /dev/sda2 /mnt/sda2
5. query the hrStorage MIB with snmpwalk again
Actual results:
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /sys
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /proc/sys/fs/binfmt_misc
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.11 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sdb5
HOST-RESOURCES-MIB::hrStorageDescr.17 = STRING: /mnt/sda2
=> Notice all indexes are shifted, and /mnt/sda2 now appearas in pos 14 instead of 12 previously
Expected results:
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.5 = STRING: /sys
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /proc/sys/fs/binfmt_misc
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.11 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sda2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.17 = STRING: /mnt/sdb5
=> indexes are persistent across umounts/mounts.
Additional info:
Later versions of net-snmp implement persistent storage indexes, but that introduces another bug:
http://sourceforge.net/tracker/index.php?func=detail&aid=1689551&group_id=12694&atid=112694
Basically, indexes are now stored in a slist, but as the filesystems are taken from the mtab, and that the mtab reproduces the mounts order, unmouting/remouting a filesystem makes it appear last with a lower index, which is rejected because the index have to increase monotonically.
This is due to a side effect of the "monotonically increasing" index, a filesystem that had a lower index does not show when remounted because its index is smaller than the latest filesystem listed (as the filesystems are evaluated in the mtab order).
The following patch avoids that problem by using a replacement for the system's getmntent() which works as follow:
- It looks first in the list for the next entry based on an index that we increment each time. The index is used to search first in the slist "filesys" that ensures persistent index values.
- If there is no value for that index, it's the end of the slist, the function returns the next getmntent() as usual.
- However, if there is an entry in the slist for that index, then it searches in the fstab for that name. This is because the filesystem might have been unmounted, yet we still have it in the slist.
- If it's found, the function returns the corresponding entry. If not, it returns the next getmntent() as usual, as it means that the entry in the list is ought to be ignored as it's not mounted.
So in the end, the order is preserved, even across mounts and umounts.
Example with net-snmp 5.1.2 with the patch included:
# snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorage
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.11 = STRING: /mnt/sda2
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sdb5
# mount /dev/sda2 /mnt/sda2
# snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorage
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sdb5
=> notice that the indexes are preserved. there is no index 11 (previously /mnt/sda2 that is now unmounted)
# umount /mnt/sda2
# snmpwalk -v1 -c public localhost HOST-RESOURCES-MIB::hrStorage
HOST-RESOURCES-MIB::hrStorageDescr.1 = STRING: Memory Buffers
HOST-RESOURCES-MIB::hrStorageDescr.2 = STRING: Real Memory
HOST-RESOURCES-MIB::hrStorageDescr.3 = STRING: Swap Space
HOST-RESOURCES-MIB::hrStorageDescr.4 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: /proc/bus/usb
HOST-RESOURCES-MIB::hrStorageDescr.7 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.8 = STRING: /var/lib/nfs/rpc_pipefs
HOST-RESOURCES-MIB::hrStorageDescr.9 = STRING: /mnt/sda1
HOST-RESOURCES-MIB::hrStorageDescr.10 = STRING: /mnt/sdb1
HOST-RESOURCES-MIB::hrStorageDescr.11 = STRING: /mnt/sda2
HOST-RESOURCES-MIB::hrStorageDescr.12 = STRING: /mnt/sdb2
HOST-RESOURCES-MIB::hrStorageDescr.13 = STRING: /mnt/sda3
HOST-RESOURCES-MIB::hrStorageDescr.14 = STRING: /mnt/sdb3
HOST-RESOURCES-MIB::hrStorageDescr.15 = STRING: /mnt/sda5
HOST-RESOURCES-MIB::hrStorageDescr.16 = STRING: /mnt/sdb5
=> notice that the index are still preserved, and /mnt/sda2 remains at the same position 11
There is finally working re-implementation upstream, see:
agent/mibgroup/hardware/fsys/*
agent/mibgroup/host/hrh_filesys.*
agent/mibgroup/host/hrh_storage.*
include/net-snmp/agent/hardware/fsys.h
(too many SVN revisions to count)
Comment 2RHEL Program Management
2010-05-24 11:46:04 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
inclusion.
Comment 10releng-rhel@redhat.com
2010-11-10 21:12:10 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.