I am trying to universally exclude CD-ROM and other removable drives from my drive check monitors. Here is the command line that I am using:
/usr/lib64/nagios/plugins/check_nrpe -H host.domain.local -n -c check_drivesize "crit=free<1g" "filter=type out ('CDROM')"
I have also tried
/usr/lib64/nagios/plugins/check_nrpe -H host.domain.local -n -c check_drivesize "crit=free<1g" drive=* "filter=type in ('REMOVEABLE')"
I realize that I could go through each server and custom exclude the CD drive drive (some are D some are E) but for the similicity of tempmlatizeing this feature would be extremely useful.
Both result in the D:\ drive coming back critical as it is a CD with 100 usage. Any help someone could offer would be appreciated. I'm running the nightly built of NNSClient++ an Nagios Plugins 4.2.0
Unable to Filter Disk Types with CHECK_DRIVESIZE
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
Have you tried filtering by 'FIXED' instead? This worked in my testing environment to exclude optical disk drives:
Also make sure to use the -a directive when passing arguments.
Code: Select all
./check_nrpe -H 192.168.67.99 -c check_drivesize -a "filter=type in ('FIXED')" "crit=free<1g"
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
So that dealt with my original issue (a DVD drive being instered cauing an aert to go off) but now my disk checks all show the \?\\.... System Volume partitions. I tried the following:
/usr/lib64/nagios/plugins/check_nrpe -n --host wsus.chimera.local --command check_drivesize -a "filter=type in ('FIXED', 'MOUNTED')"
To include only Mounted drives but that results in this error:
Filter processing failed: Failed to convert type: mounted, Failed to convert type: fixed, mounted: 3 in convert(0)
I feel like i'm close!
/usr/lib64/nagios/plugins/check_nrpe -n --host wsus.chimera.local --command check_drivesize -a "filter=type in ('FIXED', 'MOUNTED')"
To include only Mounted drives but that results in this error:
Filter processing failed: Failed to convert type: mounted, Failed to convert type: fixed, mounted: 3 in convert(0)
I feel like i'm close!
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
And it would seem that that didn't fix the issue because at least one of my systems throw back that one of the \?\\ etc partitions has no file system and so the scripts kicks it back b/c it cant get a size. Can the filter be written to EXCLUDE rather than include? Like exclude CDROM? I went through the source code and I see that MOUNTED is no longer a drive type so thats what that was.
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
You could give this a try:
Also what version of NSClient++ is running on the remote machine? You should be able to find this with:
Code: Select all
[root@localhost libexec]# ./check_nrpe -H 192.168.67.99 -c check_drivesize -a "filter=type not in ('CDROM', 'REMOVABLE')" "crit=free<1g"
OK All 1 drive(s) are ok|'C:\ free'=29.34105GB;0;0;0;50.23241 'C:\ free %'=58%;0;0;0;100 'C:\ used'=20.89136GB;40.18593;0;0;50.23241 'C:\ used %'=41%;79;0;0;100
Code: Select all
./check_nrpe -H <host/ip>
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
Running a nightly but for this particular situation I doubt it makes a difference, this looks like a feature request to the NSClient++ team. There are two hidden volumes with no mount points on one of my systems that when I add in those filters suddenly get "exposed" to be counted and NRPE throws:
Filter processing failed: Failed to get size for \\?\Volume{26934313-ef77-11e5-9a9b-806e6f6e6963}\: 1005: The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.
: 0 > convert(0)
It does, however, properly filter out my CDROM drive if i point it at just about any other system that I have.
I really appreciate your help and especially the speed at which you responded.
Filter processing failed: Failed to get size for \\?\Volume{26934313-ef77-11e5-9a9b-806e6f6e6963}\: 1005: The volume does not contain a recognized file system.
Please make sure that all required file system drivers are loaded and that the volume is not corrupted.
: 0 > convert(0)
It does, however, properly filter out my CDROM drive if i point it at just about any other system that I have.
I really appreciate your help and especially the speed at which you responded.
Re: Unable to Filter Disk Types with CHECK_DRIVESIZE
You could also try excluding the \\? path, but I don't have a system to test this against unfortunately.
Code: Select all
./check_nrpe -H 192.168.67.99 -c check_drivesize -a "filter=type not in ('CDROM', 'REMOVABLE')" "crit=free<1g" "exclude=\\?"
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/