Page 1 of 1
All disk without tmpfs types in check_snmp_storage.pl
Posted: Tue Jan 21, 2020 3:51 pm
by biswajit.banerjee
Is there any way to avoid listing tmpfs or devtmpfs type disk while using check_snmp_storage.pl plugin for displaying all disks
for example
./check_snmp_storage.pl -H xxx.xxxxxxx.xxx.com -C xxxxxxxxxx --v2c -m zzzz -e -w 90 -c 95 -f
This show tmpfs disk like /dev/shm etc .
Please help .
TIA
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Tue Jan 21, 2020 4:37 pm
by mbellerue
This might be done with the -e flag. Try adding -e tmpfs to your command, and see what it returns.
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Thu Jan 23, 2020 2:47 pm
by biswajit.banerjee
did not help and no change in out put
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Thu Jan 23, 2020 5:33 pm
by mbellerue
Alright, I think we may have to alter the script itself. I think we can comment out one of two very small sections in the code, and one of them might get us what we're looking for.
Lines 36 and 37
Code: Select all
$hrStorage{"Other"} = '1.3.6.1.2.1.25.2.1.1';
$hrStorage{"1.3.6.1.2.1.25.2.1.1"} = 'Other';
Or lines 40 and 41
Code: Select all
$hrStorage{"VirtualMemory"} = '1.3.6.1.2.1.25.2.1.3';
$hrStorage{"1.3.6.1.2.1.25.2.1.3"} = 'VirtualMemory';
I want to say virtual memory will be for like swap space, but it could be tmpfs.
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Fri Jan 24, 2020 9:54 am
by biswajit.banerjee
No , Did not work Out .
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Fri Jan 24, 2020 4:06 pm
by tgriep
To exclude /dev/shm, you would run this example.
Code: Select all
/usr/local/nagios/libexec/check_snmp_storage.pl -H 192.168.1.6 -C public --v2c -m /dev/shm -e -w 90 -c 95 -f -q FixedDisk
The -e says means to not show what is specified with the -m option.
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Sat Jan 25, 2020 3:57 am
by biswajit.banerjee
There are multiple tmpfs file systems like /run , /dev/cgroups etc . So it is not one file system .
Can I have any work around .
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Mon Jan 27, 2020 9:42 am
by tgriep
To ignore more file systems for the check, just add them to the -m option as a regex OR.
The following will ignore all the file systems /dev and /run from the check.
Code: Select all
/usr/local/nagios/libexec/check_snmp_storage.pl -H 192.168.1.6 -C public --v2c -m "/dev/*|/run/*" -e -w 90 -c 95 -f -q FixedDisk
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Mon Jan 27, 2020 1:41 pm
by biswajit.banerjee
Thanks
This Strategy works out to the nearest .
Re: All disk without tmpfs types in check_snmp_storage.pl
Posted: Mon Jan 27, 2020 3:44 pm
by tgriep
Your welcome.