Page 1 of 1

Problems with disk size checks on Windows virtual machines

Posted: Mon Aug 26, 2019 2:18 am
by admincauce
Good Morning,

I have monitored several Linux virtual machines and several more Windows on my Nagios system. Checks on Windows machines work perfectly, but from time to time and on some windows machines, the check "check_disksize" gives me the following output:


Filter processing failed: Failed to get size for \? \ Volume {e69b2f28-217f-11e6-80d3-806e6f6e6963} \: 87: The parameter is incorrect.

This output is correctly recovered in the next check. But as I have everything notified by mail, emails come from this unkwnow state. Why are these checks on the size of the disk of Windows virtual machines?

Here is the definition of the service:

define service {
use generic-service, srv-pnp
hostgroup_name windows-servers
service_description Disks usage
check_command check_nrpe! check_drivesize "warn = free <20%" "crit = free <10%" drive = *
}

Thank you very much in advance.

Re: Problems with disk size checks on Windows virtual machin

Posted: Mon Aug 26, 2019 1:51 pm
by mbellerue
Do you see any corresponding errors on the Windows side if you look in the file C:\Program Files\NSClient++\nsclient.txt ?

Re: Problems with disk size checks on Windows virtual machin

Posted: Tue Aug 27, 2019 1:35 pm
by mcapra
Which version of NSClient++ is running on the Windows VMs? It's going to influence how filters for your check_nrpe executions are written.

Here's a thread from the customer support section in which @lmiltchev offers some logic to filter out \\?\Volume records from the check_drivesize results:
https://support.nagios.com/forum/viewto ... 5&p=281424

Code: Select all

./check_nrpe -u -H 10.110.4.24 -t 60 -c check_drivesize -a "warn=used>=60%" "crit=used>=70%" drive=* "filter=drive_or_id not like 'Volume' and type not in ('CDROM')"
The filter argument is the "secret sauce" in this case:

Code: Select all

"filter=drive_or_id not like 'Volume' and type not in ('CDROM')"
That should just return non-CDROM drives that have an alphabetical label (A, B, C, D, etc). Not sure what if anything your hypervisor is doing with \\?Volume records that is perhaps special in some way.

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 7:40 am
by scottwilkerson
Thanks @mcapra

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 9:16 am
by admincauce
Thank you very much for both answers.

I am looking at the version I have in one of the virtual machines where it is giving me check problems, and the version of the NSClient ++ is 0.5.0.62.

I am checking that the latest stable version is version 0.5.2.35 for Windows. I also understand that it is because of this version that the filter in the check does not work for me:

[root @ GESNAG00 bin] $ / usr / local / nagios / libexec / check_nrpe -n -H 10.200.5.3 -c check_drivesize -a drive = * "filter = drive_or_id not like 'Volume' and type not in ('CDROM') "
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

It would be advisable to update to the latest version of NSCliente on my Windows machines !?

Best regards.

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 9:24 am
by scottwilkerson
You need to allow arguments under the following section of your nsclient.ini

under

Code: Select all

[/settings/NRPE/server]
edit/add

Code: Select all

allow arguments = 1
then restart nsclient

this is the cause of

Code: Select all

Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 9:46 am
by admincauce
Thanks for the reply.

Make changes in nrpe.ini and restart the service, execute again the comand and get the next error:

[root@GESNAG00 etc]$ /usr/local/nagios/libexec/check_nrpe -n -H 10.200.6.3 -c check_drivesize -a drive=* "filter=drive_or_id not like 'Volume'"
Exception processing request: Request command contained illegal metachars!


Something wrong in the filter options?

Regards

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 10:00 am
by scottwilkerson
Let's also add this line to the same section

Code: Select all

allow nasty characters = 1
It's because you have a * and ' in there

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 10:15 am
by admincauce
Thanks you so much!!!

It's work fine.

[root@GESNAG00 site]$ /usr/local/nagios/libexec/check_nrpe -n -H 10.200.6.3 -c check_drivesize -a drive=* "filter=name not like '?'"
OK All 3 drive(s) are ok|'\\?\Volume{735c63a6-1ce6-11e6-80d0-806e6f6e6963}\ used'=33.84375MB;279.99687;314.99648;0;349.99609 '\\?\Volume{735c63a6-1ce6-11e6-80d0-806e6f6e6963}\ used %'=10%;80;90;0;100 'C:\ used'=46.53652GB;47.72499;53.69062;0;59.65624 'C:\ used %'=78%;80;90;0;100 'D:\ used'=0B;0;0;0;0


Thanks you!!!!

Re: Problems with disk size checks on Windows virtual machin

Posted: Wed Aug 28, 2019 10:20 am
by scottwilkerson
admincauce wrote:Thanks you so much!!!

It's work fine.

[root@GESNAG00 site]$ /usr/local/nagios/libexec/check_nrpe -n -H 10.200.6.3 -c check_drivesize -a drive=* "filter=name not like '?'"
OK All 3 drive(s) are ok|'\\?\Volume{735c63a6-1ce6-11e6-80d0-806e6f6e6963}\ used'=33.84375MB;279.99687;314.99648;0;349.99609 '\\?\Volume{735c63a6-1ce6-11e6-80d0-806e6f6e6963}\ used %'=10%;80;90;0;100 'C:\ used'=46.53652GB;47.72499;53.69062;0;59.65624 'C:\ used %'=78%;80;90;0;100 'D:\ used'=0B;0;0;0;0


Thanks you!!!!
Great!

Locking