Syed Jahanzaib Personal Blog to Share Knowledge !

December 6, 2016

SNMP on Centos missing few disk in snmp query

Filed under: Linux Related — Tags: , , , — Syed Jahanzaib / Pinochio~:) @ 9:43 AM

Image result for knowledge is power

If you have done a deep dive into the Ubuntu Ocean, and then start using Centos, you may realize that a quote “Ubuntu: made for Humans” is quite true indeed. z@ib

Recently I was configuring rrdtool/mrtg for remote Centos servers to to graphs disk storage , and found the difference between  MIb/OID of Windows/Ubuntu and Centos structure, therefore just sharing some notes for personnel references.

The problem I was getting in centos snmp querying that it was unable to see htStorageUsed.x counters. plus all mounted disks were not showing, only single disk was appearing in the for query result.

[for centos] To show all the disks , first edit the snmpd config file

nano /etc/snmp/snmpd.conf

add the following in end

disk /
includeAllDisks 10%

Restart the snmp service by

service snmpd restart

after a break, query the disk and you will find your missing disks 🙂

(Showing relevant Data only)

#df -h
/dev/sdX1 829G 310G 519G 38% /X/folder1
/dev/sdX2 3.6T 69M 3.4T 1% /X/folder2
/dev/sdX3 1.9T 1.9T 4.7G 100% /X/folder3

#snmpwalk -v1 -c PUBLIC localhost .1.3.6.1.4.1.2021 |grep dskDevice
UCD-SNMP-MIB::dskDevice.8  = STRING: /dev/sdX1
UCD-SNMP-MIB::dskDevice.10 = STRING: /dev/sdX2
UCD-SNMP-MIB::dskDevice.11 = STRING: /dev/sdX3


# snmpwalk -v1 -c PUBLIC -m /cfg/mibs/UCD-SNMP-MIB 192.168.0.1 dskPercent
UCD-SNMP-MIB::dskPercent.8 = INTEGER: 96
UCD-SNMP-MIB::dskPercent.10 = INTEGER: 58
UCD-SNMP-MIB::dskPercent.11 = INTEGER: 12


CFG File Examples :

I used 2 different methods to to plot disk storage.


# 192.168.200.1 / 4 TB disk
Target[192.168.200.1_4tb]: ( dskUsed.10&dskUsed.10:public@192.168.200.1 ) * 100 / ( dskTotal.10&dskTotal.10:public@192.168.200.1 ) / 8
Title[192.168.200.1_4tb]: Disk usage for FTP Portal 192.168.200.1 / 4 TB Disk
PageTop[192.168.200.1_4tb]: <H1> Disk usage for FTP Portal 192.168.200.1 / 4 TB Disk</H1>
MaxBytes[192.168.200.1_4tb]: 100
AbsMax[192.168.200.1_4tb]: 100
ShortLegend[192.168.200.1_4tb]: %
YLegend[192.168.200.1_4tb]: % of DISK
Legend1[192.168.200.1_4tb]: Used DISK
LegendI[192.168.200.1_4tb]: Used :
LegendO[192.168.200.1_4tb]:
Options[192.168.200.1_4tb]: growright,gauge,integer,nobanner,printrouter,pngdate,nopercent
#Unscaled[192.168.200.1_4tb]: ymwd

# 192.168.200.1 / 2 TB disk - dskPercent.x
Target[192.168.200.1_2tb]: dskPercent.8&dskPercent.8:public@192.168.200.1 / 8
Title[192.168.200.1_2tb]: Disk usage for FTP Portal 192.168.200.1 / 2 TB Disk / FOLDER1
PageTop[192.168.200.1_2tb]: <H1> Disk usage for FTP Portal 192.168.200.1 / 2 TB Disk / FOLDER1</H1>
MaxBytes[192.168.200.1_2tb]: 100
AbsMax[192.168.200.1_2tb]: 100
ShortLegend[192.168.200.1_2tb]: %
YLegend[192.168.200.1_2tb]: % of DISK
Legend1[192.168.200.1_2tb]: Used DISK
LegendI[192.168.200.1_2tb]: Used :
LegendO[192.168.200.1_2tb]:
Options[192.168.200.1_2tb]: growright,gauge,integer,nobanner,printrouter,pngdate,nopercent
#Unscaled[192.168.200.1_2tb]: ymwd


Graphs Example:

ftp-disk-usage

combined


 

Create a free website or blog at WordPress.com.