Page 1 of 2

check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 3:12 am
by emi65
Hi

I'm using nagios core 4.2.1 and check_snmp_storage
Version : 1.3.3
# Date : Jun 1 2007

On the Linux machine I got this info
[root@sgsvrasjdcs51lx:/]# df -kh
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/vg00-lv_slash ext4 5.0G 3.0G 1.7G 65% /
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
/dev/sda1 ext4 477M 67M 385M 15% /boot
/dev/mapper/vg00-lv_home ext4 976M 902M 24M 98% /home
/dev/mapper/vg00-lv_tmp ext4 976M 1.4M 924M 1% /tmp
/dev/mapper/vg00-lv_var ext4 5.0G 557M 4.2G 12% /var
/dev/mapper/vg00-lv_backup ext4 2.0G 1.8G 47M 98% /var/backup


I do this check
check_snmp_storage -H X.x.x.x -S0,1 -C public -m / -q "FixedDisk|NetworkDisk/other" -w95 -c98 -o 20000 -t 60
OK : (<95%) All selected storages

Why the check didn't show the CRITICAL for /var/backup and /home ?

Thanks for the help
Emilio

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 4:10 am
by rhassing
I do this check
check_snmp_storage -H X.x.x.x -S0,1 -C public -m / -q "FixedDisk|NetworkDisk/other" -w95 -c98 -o 20000 -t 60
OK : (<95%) All selected storages
The -m / tells the script to only check /.

Please try the folowiing:

Code: Select all

check_snmp_storage -H X.x.x.x -S0,1 -C public -m ^/ -q "FixedDisk|NetworkDisk/other" -w95 -c98 -o 20000 -t 60
The only character I changed was the ^ before the /

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 4:49 am
by emi65
Nothing is change

I attemped to decrease the WARN and CRITICAL Limit
check_snmp_storage -H 10.211.30.89 -S0,1 -C SGS-MGMT-01 -m ^/ -q "FixedDisk|NetworkDisk" -w5 -c8 -o 20000 -t 60
CRITICAL : (>8%) /var/backup: 95%used(1848MB/1952MB) /var: 11%used(557MB/5102MB) /boot: 14%used(67MB/476MB) /home: 92%used(901MB/976MB) /: 61%used(3060MB/5038MB)

[nagios@sgsvrasjdcs51lx:~]$ df -k
Filesystem Type 1024-blocks Used Available Capacity Mounted on
/dev/mapper/vg00-lv_slash ext4 5158520 3133140 1756700 65% /
tmpfs tmpfs 4026680 0 4026680 0% /dev/shm
/dev/sda1 ext4 487652 68273 393779 15% /boot
/dev/mapper/vg00-lv_home ext4 999320 923108 23784 98% /home
/dev/mapper/vg00-lv_tmp ext4 999320 1380 945512 1% /tmp
/dev/mapper/vg00-lv_var ext4 5224056 569924 4385476 12% /var
/dev/mapper/vg00-lv_backup ext4 1998672 1892356 1472 100% /var/backup

So you can see that "df -k" comand show /var/backup 100% used
the check show /var/backup: 95%used(1848MB/1952MB)

seems that df -k usign a different way to calculate the used space from the check

Why this difference ?

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 9:01 am
by mcapra
Can you share the full output of this command executed from the CLI of your Nagios Core machine:

Code: Select all

snmpwalk -mALL -v2c -cSGS-MGMT-01 10.211.30.89 1.3.6.1.2.1.25.2.3
My guess is that net-snmp isn't correctly reporting disk sizes. There are a few Red Hat errata out there that describe similar such problems relating to block size, though I don't recall them off-hand.

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 9:50 am
by emi65
here the requested info

HOST-RESOURCES-MIB::hrStorageIndex.31 = INTEGER: 31
HOST-RESOURCES-MIB::hrStorageIndex.35 = INTEGER: 35
HOST-RESOURCES-MIB::hrStorageIndex.36 = INTEGER: 36
HOST-RESOURCES-MIB::hrStorageIndex.37 = INTEGER: 37
HOST-RESOURCES-MIB::hrStorageIndex.38 = INTEGER: 38
HOST-RESOURCES-MIB::hrStorageIndex.39 = INTEGER: 39
HOST-RESOURCES-MIB::hrStorageIndex.40 = INTEGER: 40
HOST-RESOURCES-MIB::hrStorageType.1 = OID: HOST-RESOURCES-TYPES::hrStorageRam
HOST-RESOURCES-MIB::hrStorageType.3 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageType.6 = OID: HOST-RESOURCES-TYPES::hrStorageOther
HOST-RESOURCES-MIB::hrStorageType.7 = OID: HOST-RESOURCES-TYPES::hrStorageOther
HOST-RESOURCES-MIB::hrStorageType.10 = OID: HOST-RESOURCES-TYPES::hrStorageVirtualMemory
HOST-RESOURCES-MIB::hrStorageType.31 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.35 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.36 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.37 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.38 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.39 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
HOST-RESOURCES-MIB::hrStorageType.40 = OID: HOST-RESOURCES-TYPES::hrStorageFixedDisk
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.10 = STRING: Swap space
HOST-RESOURCES-MIB::hrStorageDescr.31 = STRING: /
HOST-RESOURCES-MIB::hrStorageDescr.35 = STRING: /dev/shm
HOST-RESOURCES-MIB::hrStorageDescr.36 = STRING: /boot
HOST-RESOURCES-MIB::hrStorageDescr.37 = STRING: /home
HOST-RESOURCES-MIB::hrStorageDescr.38 = STRING: /tmp
HOST-RESOURCES-MIB::hrStorageDescr.39 = STRING: /var
HOST-RESOURCES-MIB::hrStorageDescr.40 = STRING: /var/backup
HOST-RESOURCES-MIB::hrStorageAllocationUnits.1 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.3 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.6 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.7 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.10 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.31 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.35 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.36 = INTEGER: 1024 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.37 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.38 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.39 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageAllocationUnits.40 = INTEGER: 4096 Bytes

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 10:14 am
by mcapra
Hmm, the snmpwalk output is missing some important fields. Most importantly, hrStorageUsed and hrStorageSize. What's the output of these:

Code: Select all

snmpwalk -mALL -v2c -cSGS-MGMT-01 10.211.30.89 1.3.6.1.2.1.25.2.3.1.5
snmpwalk -mALL -v2c -cSGS-MGMT-01 10.211.30.89 1.3.6.1.2.1.25.2.3.1.6

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 10:36 am
by emi65
here

snmpwalk -mALL -v2c -cSGS-MGMT-01 10.211.30.89 1.3.6.1.2.1.25.2.3.1.5
HOST-RESOURCES-MIB::hrStorageSize.1 = INTEGER: 8053360
HOST-RESOURCES-MIB::hrStorageSize.3 = INTEGER: 9101932
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 8053360
HOST-RESOURCES-MIB::hrStorageSize.7 = INTEGER: 757976
HOST-RESOURCES-MIB::hrStorageSize.10 = INTEGER: 1048572
HOST-RESOURCES-MIB::hrStorageSize.31 = INTEGER: 1289630
HOST-RESOURCES-MIB::hrStorageSize.35 = INTEGER: 1006670
HOST-RESOURCES-MIB::hrStorageSize.36 = INTEGER: 487652
HOST-RESOURCES-MIB::hrStorageSize.37 = INTEGER: 249830
HOST-RESOURCES-MIB::hrStorageSize.38 = INTEGER: 249830
HOST-RESOURCES-MIB::hrStorageSize.39 = INTEGER: 1306014
HOST-RESOURCES-MIB::hrStorageSize.40 = INTEGER: 499668


snmpwalk -mALL -v2c -cSGS-MGMT-01 10.211.30.89 1.3.6.1.2.1.25.2.3.1.6
HOST-RESOURCES-MIB::hrStorageUsed.1 = INTEGER: 1748880
HOST-RESOURCES-MIB::hrStorageUsed.3 = INTEGER: 1748880
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 294700
HOST-RESOURCES-MIB::hrStorageUsed.7 = INTEGER: 757976
HOST-RESOURCES-MIB::hrStorageUsed.10 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.31 = INTEGER: 783285
HOST-RESOURCES-MIB::hrStorageUsed.35 = INTEGER: 0
HOST-RESOURCES-MIB::hrStorageUsed.36 = INTEGER: 68273
HOST-RESOURCES-MIB::hrStorageUsed.37 = INTEGER: 376
HOST-RESOURCES-MIB::hrStorageUsed.38 = INTEGER: 345
HOST-RESOURCES-MIB::hrStorageUsed.39 = INTEGER: 235806
HOST-RESOURCES-MIB::hrStorageUsed.40 = INTEGER: 768


thank a lot for your time !!!

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 1:39 pm
by tgriep
Your command

Code: Select all

check_snmp_storage -H 10.211.30.89 -S0,1 -C SGS-MGMT-01 -m ^/ -q "FixedDisk|NetworkDisk" -w5 -c8 -o 20000 -t 60
Seems to be working, as the output,

Code: Select all

CRITICAL : (>8%) /var/backup: 95%used(1848MB/1952MB) /var: 11%used(557MB/5102MB) /boot: 14%used(67MB/476MB) /home: 92%used(901MB/976MB) /: 61%used(3060MB/5038MB)
is generating a critical state because the drives used space is over 8% which is correct.

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 4:57 pm
by emi65
The problem is not the critical state in my example but the difference from df -k output e the check_snmp_storage

[nagios@sgsvrasjdcs51lx:~]$ df -k
Filesystem Type 1024-blocks Used Available Capacity Mounted on
/dev/mapper/vg00-lv_slash ext4 5158520 3133140 1756700 65% /
tmpfs tmpfs 4026680 0 4026680 0% /dev/shm
/dev/sda1 ext4 487652 68273 393779 15% /boot
/dev/mapper/vg00-lv_home ext4 999320 923108 23784 98% /home
/dev/mapper/vg00-lv_tmp ext4 999320 1380 945512 1% /tmp
/dev/mapper/vg00-lv_var ext4 5224056 569924 4385476 12% /var
/dev/mapper/vg00-lv_backup ext4 1998672 1892356 1472 100% /var/backup

So you can see that "df -k" comand show /var/backup 100% used
the check_snmp_storage shows
CRITICAL : (>8%) /var/backup: 95%used(1848MB/1952MB) /var: 11%used(557MB/5102MB) /boot: 14%used(67MB/476MB) /home: 92%used(901MB/976MB) /: 61%used(3060MB/5038MB)

seems that df -k uses a different way to calculate the used space then the check_snmp_storage

So the unix administrator asks me why the var/backup is full and the nagios check show me /var/backup is 95% used

I hope to explained better the question/problem

Thanks
Emilio

Re: check_snmp_storage doesn't check all FS

Posted: Thu Jun 15, 2017 10:18 pm
by mcapra
I think it's a discrepancy in the block sizes. df -k seems to be using 1024 byte blocks where as net-snmp is reporting the block size for /var/backup as 4096 bytes. As shown here:

Code: Select all

HOST-RESOURCES-MIB::hrStorageDescr.40 = STRING: /var/backup
HOST-RESOURCES-MIB::hrStorageAllocationUnits.40 = INTEGER: 4096 Bytes