All disk without tmpfs types in check_snmp_storage.pl

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

All disk without tmpfs types in check_snmp_storage.pl

Post 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
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: All disk without tmpfs types in check_snmp_storage.pl

Post by mbellerue »

This might be done with the -e flag. Try adding -e tmpfs to your command, and see what it returns.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

Re: All disk without tmpfs types in check_snmp_storage.pl

Post by biswajit.banerjee »

did not help and no change in out put
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: All disk without tmpfs types in check_snmp_storage.pl

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

Re: All disk without tmpfs types in check_snmp_storage.pl

Post by biswajit.banerjee »

No , Did not work Out .
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: All disk without tmpfs types in check_snmp_storage.pl

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

Re: All disk without tmpfs types in check_snmp_storage.pl

Post 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 .
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: All disk without tmpfs types in check_snmp_storage.pl

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
biswajit.banerjee
Posts: 152
Joined: Fri Dec 08, 2017 10:24 pm

Re: All disk without tmpfs types in check_snmp_storage.pl

Post by biswajit.banerjee »

Thanks
This Strategy works out to the nearest .
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: All disk without tmpfs types in check_snmp_storage.pl

Post by tgriep »

Your welcome.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked