Hello Net-SNMP developers and maintainers,
Here at Portland State University we wanted to monitor
the disk usage on over 50 solaris servers (Solaris 8). As
all the servers have various different partitions, it was
getting difficult to manage the snmpd.conf
configuration file
across the servers. In order to have a single version of
net-snmp version running on all the servers and to have a
common snmpd.conf configuration file across all our
servers, we decided to patch the net-snmp package
(ver 5.0.6) so that it parses a 'includeAllDisks' in
conjunction with the already existing 'disk' directive
from
the snmpd.conf file.
The behavior of this directive is as follows:
1) The 'includeAllDisks' directive has the following
usage:
includeAllDisks <minimum_percent%>
2) There can only be one 'includeAllDisks' directive in
the
snmpd.conf file.
3) The 'disk path [ minspace | minpercent% ]' directives
and the 'includeAllDisks' directive can be used in any
order.
4) The 'includeAllDisks' directive adds all the disks that
can be found on the system using the
setmntent(3) and getmntent(3),
or
fopen(3) and getmntent(3),
or
setfsent(3) and getfsent(3)
system calls. If none of the above system calls are available then the 'includeAllDisks' adds on the root partition "/", \(which is assumed to exist on any UNIX based system\) using the statfs\(2\) system call.
5) The disk usage to be monitored, specified by the
'disk path [ minspace | minpercent% ]' directive
overrides the disk usage specified by the
'includeAllDisks' directive, no matter in which
order they are specified in the snmpd.conf file.
----------------------------------------------------------------
Patch Information:
----------------------------------------------------------------
Version Patched against: 5.0.6
Known Issues:
The 'includeAllDisks' only includes the disks that are
mounted when the snmpd daemon is started. It cannot
include disks that are loadable dynamically, such as
with
automount. So the preferred way is to mount all the
disks
that will ever need to be monitored before starting the
snmpd daemon.
Operating Systems Tested On:
Linux:
Kernel: 2.4.18-10 and 2.4.18-18.7.x
Distro: Redhat 7.3
Uname output:
Linux <hostname1>.pdx.edu 2.4.18-18.7.x #1 Wed Nov
13 20:29:30 EST 2002 i686 unknown
Solaris:
SunOS <hostname2>.pdx.edu 5.8 Generic_108528-13
sun4u sparc SUNW,Ultra-4
Patch against Net-SNMP(ver 5.0.6) for monitoring all disks on a system with a single directive 'includeAllDisks <minpercent%>'
Logged In: YES
user_id=34587
Some might wonder why this patch is needed, when the
HOST-RESOURCES-MIB includes the hrStorageTable, which
seemingly provides this information.
The reason is that the hrStorageTable does not provide a way
to expose the amount of space on a volume available to non-
superusers (i.e. the f_bavail member of struct statfs).
Therefore, one can determine the total amount of available
space, but some percentage of this is often reserved for the
superuser, and it is not possible to know how much by using
only the hrStorageTable. The UCD-MIB's dskTable does
provide this information, and this patch provides a way of
automatically populating the dskTable with all volumes in the
system.
Logged In: YES
user_id=625688
Please excuse me for not including the reasons to justify the
patch. Thank you razor for comment above. --Sri.
Logged In: YES
user_id=76242
I've applied it for the next major release (5.1). Thanks for the
patch. If you're willing, it'd be great if you could supply a
snmpd.conf manual page patch as well.
Logged In: YES
user_id=625688
I have made changes to the man page as well to include the
usage of 'includeAllDisks' directive. I have included the
patch file which contains modifications to both the agent
and the man page.
agent patch along with man page patch