Problems with disk size checks on Windows virtual machines

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
admincauce
Posts: 34
Joined: Wed Sep 19, 2018 3:20 am

Problems with disk size checks on Windows virtual machines

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

Re: Problems with disk size checks on Windows virtual machin

Post by mbellerue »

Do you see any corresponding errors on the Windows side if you look in the file C:\Program Files\NSClient++\nsclient.txt ?
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!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Problems with disk size checks on Windows virtual machin

Post 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.
Former Nagios employee
https://www.mcapra.com/
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with disk size checks on Windows virtual machin

Post by scottwilkerson »

Thanks @mcapra
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
admincauce
Posts: 34
Joined: Wed Sep 19, 2018 3:20 am

Re: Problems with disk size checks on Windows virtual machin

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with disk size checks on Windows virtual machin

Post 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).
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
admincauce
Posts: 34
Joined: Wed Sep 19, 2018 3:20 am

Re: Problems with disk size checks on Windows virtual machin

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with disk size checks on Windows virtual machin

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
admincauce
Posts: 34
Joined: Wed Sep 19, 2018 3:20 am

Re: Problems with disk size checks on Windows virtual machin

Post 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!!!!
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Problems with disk size checks on Windows virtual machin

Post 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
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked