LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Monitoring Disks with SNMP (https://www.linuxquestions.org/questions/linux-networking-3/monitoring-disks-with-snmp-929489/)

mrm5102 02-15-2012 09:52 AM

Monitoring Disks with SNMP
 
Hello All,

I am trying to monitor disk usage on a Linux server with 3 partitions (sda1, sda2, sda3) but the OIDs I found only gives information for /home, which I believe is sda1...
So after Googling a bit I came across this site here (look for the heading labeled "Disk Statistics") --> http://www.debianadmin.com/linux-snm...tatistics.html

It seems like what I found should be the correct thing to do... It says to edit "/etc/snmp/snmpd.conf" and add the line "includeAllDisks 10%".
So I added that line to the conf file and ran the command "/etc/init.d/snmpd restart". After I ran that I tried running the OIDs they give that should now contain all the partitions on the disk. But they still return the same data as before I entered that line into the file.


Here is a portion of that conf file. It is the last line shown here. And the line just before it was what was there, but I commented it out and added the next:
Code:

###########################################################################
# SECTION: Monitor Various Aspects of the Running Host
#
#  The following check up on various aspects of a host.

# proc: Check for processes that should be running.
#    proc NAME [MAX=0] [MIN=0]
#
#    NAME:  the name of the process to check for.  It must match
#            exactly (ie, http will not find httpd processes).
#    MAX:  the maximum number allowed to be running.  Defaults to 0.
#    MIN:  the minimum number to be running.  Defaults to 0.
#
#  The results are reported in the prTable section of the UCD-SNMP-MIB tree
#  Special Case:  When the min and max numbers are both 0, it assumes
#  you want a max of infinity and a min of 1.


# disk: Check for disk space usage of a partition.
#  The agent can check the amount of available disk space, and make
#  sure it is above a set limit.
#
#    disk PATH [MIN=100000]
#
#    PATH:  mount path to the disk in question.
#    MIN:  Disks with space below this value will have the Mib's errorFlag set.
#          Can be a raw byte value or a percentage followed by the %
#          symbol.  Default value = 100000.
#
#  The results are reported in the dskTable section of the UCD-SNMP-MIB tree

#disk  /home

includeAllDisks 10%


I was wondering if anyone has tried to do this or if I am NOT doing it correctly?
Any suggestions would be much appreciated.


Thanks in Advance,
Matt

mrm5102 02-15-2012 10:26 AM

Hello All,

It seems that the rest of the "mount" points ARE showing...
I just ran a MIB Walk application that gets every OID on the machine and puts it in an excel file...

Previously I could only see these OIDs for disk usage:
Code:

1.3.6.1.4.1.2021.9.1.2.1        dskPath.1        /home
1.3.6.1.4.1.2021.9.1.3.1        dskDevice.1        /dev/mapper/SysVG-homeLV
1.3.6.1.4.1.2021.9.1.4.1        dskMinimum.1        100000
1.3.6.1.4.1.2021.9.1.5.1        dskMinPercent.1        -1
1.3.6.1.4.1.2021.9.1.6.1        dskTotal.1        3096336
1.3.6.1.4.1.2021.9.1.7.1        dskAvail.1        2021004
1.3.6.1.4.1.2021.9.1.8.1        dskUsed.1        918048
1.3.6.1.4.1.2021.9.1.9.1        dskPercent.1        31

But now for each one of those OIDs up there, there are 14 total for each... (i.e. dskTotal.1, dskTotal.2, dskTotal.3... all the way to to dskTotal.14).
So I guess it is working correctly. But not quite what I wanted to see.

I would rather deal in terms of say monitoring "sda1", "sda2", and "sda3" (total, used, free, etc...) instead of using the mount points.
If there is a better command I could use or something other then SNMP to get partition usage information, I have no problem writing a script to get/process that data.

I tried using the "df" command but that too uses mount points. For example the output of fdisk is pretty close to what I want to see except that it only shows the total size of each partition and not the usage of that partition.

If anyone has any ideas at all, please feel free to throw it out there...

Thanks in Advance,
Matt


All times are GMT -5. The time now is 03:57 AM.