Monitor Disk Usage of Windows Mount Points...

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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Monitor Disk Usage of Windows Mount Points...

Post by Box293 »

To add to what @tgriep has provided, I did some tests and it appears as though you need at least NSClient 0.4.2.x versions onwards to be able to check mount points.

Once you have the updated version it will be checked it by default:

Code: Select all

Command:
check_nrpe -H win2008r2-01 -c CheckDriveSize

Output:
OK All 6 drive(s) are ok|'C:\ used'=19.01372GB;47.9203;53.91034;0;59.90038 'C:\ used %'=31%;79;89;0;100 'D:\ used'=0B;0;0;0;0 'E:\ used'=0.08886GB;31.99765;35.99736;0;39.99706 'E:\ used %'=0%;79;89;0;100 'Q:\ used'=0.0884GB;19.99765;22.49736;0;24.99706 'Q:\ used %'=0%;79;89;0;100 '\\?\Volume{791a0772-737e-11e4-98ac-806e6f6e6963}\ used'=29.19921MB;79.99687;89.99648;0;99.99609 '\\?\Volume{791a0772-737e-11e4-98ac-806e6f6e6963}\ used %'=29%;79;89;0;100 'C:\Mounted Disks\A Mounted Disk\ used'=0.08816GB;14.39765;16.19736;0;17.99706 'C:\Mounted Disks\A Mounted Disk\ used %'=0%;79;89;0;100
Or you can target it specifically:

Code: Select all

Command:
check_nrpe -H win2008r2-01 -c CheckDriveSize -a Drive='C:\Mounted Disks\A Mounted Disk'

Output:
OK All 1 drive(s) are ok|'C:\Mounted Disks\A Mounted Disk used'=0.08816GB;14.39765;16.19736;0;17.99706 'C:\Mounted Disks\A Mounted Disk used %'=0%;79;89;0;100
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jasonlehman
Posts: 31
Joined: Wed Jul 29, 2015 7:59 am

Re: Monitor Disk Usage of Windows Mount Points...

Post by jasonlehman »

Sorry for the delay, been putting out fires.
Here is the output to get the version...

I (0,4,1,105 2014-04-28) seem to be doing fine...
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor Disk Usage of Windows Mount Points...

Post by hsmith »

jasonlehman wrote:Sorry for the delay, been putting out fires.
Here is the output to get the version...

I (0,4,1,105 2014-04-28) seem to be doing fine...
Box293 wrote:To add to what @tgriep has provided, I did some tests and it appears as though you need at least NSClient 0.4.2.x versions onwards to be able to check mount points.
Looks like you need to upgrade.
Former Nagios Employee.
me.
jasonlehman
Posts: 31
Joined: Wed Jul 29, 2015 7:59 am

Re: Monitor Disk Usage of Windows Mount Points...

Post by jasonlehman »

Ok, I've updated to...

NSClient++ 0.4.3.143 2015-04-29

I also don't think the check_nrpe plugin is installed on my Nagios server.
Shouldn't it be listed here?

Code: Select all

[root@nagios objects]# cd /usr/local/nagios/libexec/
[root@nagios libexec]# ls
check_apt      check_disk      check_ftp           check_ifstatus  check_mrtg      check_ntp_peer  check_procs    check_spop   check_ups      utils.pm
check_breeze   check_disk_smb  check_game          check_imap      check_mrtgtraf  check_ntp_time  check_real     check_ssh    check_uptime   utils.sh
check_by_ssh   check_dns       check_hpjd          check_ircd      check_nagios    check_nwstat    check_rpc      check_ssmtp  check_users
check_clamd    check_dummy     check_http          check_jabber    check_nntp      check_oracle    check_sensors  check_swap   check_wave
check_cluster  check_file_age  check_icmp          check_load      check_nntps     check_overcr    check_simap    check_tcp    eventhandlers
check_dhcp     check_flexlm    check_ide_smart     check_log       check_nt        check_ping      check_smtp     check_time   negate
check_dig      check_fping     check_ifoperstatus  check_mailq     check_ntp       check_pop       check_snmp     check_udp    urlize
jasonlehman
Posts: 31
Joined: Wed Jul 29, 2015 7:59 am

Re: Monitor Disk Usage of Windows Mount Points...

Post by jasonlehman »

I just found the check_nrpe in /usr/lib64/nagios/plugins/

Sorry for the confusion.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor Disk Usage of Windows Mount Points...

Post by hsmith »

jasonlehman wrote:I just found the check_nrpe in /usr/lib64/nagios/plugins/

Sorry for the confusion.
What happens when you try checking now? Did the upgrade fix it?
Former Nagios Employee.
me.
jasonlehman
Posts: 31
Joined: Wed Jul 29, 2015 7:59 am

Re: Monitor Disk Usage of Windows Mount Points...

Post by jasonlehman »

I was just about to post the results.

I can get results running this...

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize
OK All 5 drive(s) are ok|'C:\ used'=37.26652GB;43.99843;49.49823;0;54.99804 'C:\ used %'=67%;79;89;0;100 'E:\ used'=25.4375MB;197.54999;222.24375;0;246.9375 'E:\ used %'=10%;79;89;0;100 'E:\SQL\Logs\ used'=5.08654GB;59.9976;67.4973;0;74.997 'E:\SQL\Logs\ used %'=6%;79;89;0;100 'E:\SQL\TempDatabases\ used'=1.98883GB;27.9976;31.4973;0;34.997 'E:\SQL\TempDatabases\ used %'=5%;79;89;0;100 'E:\SQL\Databases\ used'=74.58734GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
I cant get results w/ -a option...

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases'
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
So now, I need to figure out how to check each mounted volume listed above; is healthy & how much free space is there.
I'm guessing I'll have to add a command in the commands.cfg
and then add a servce definition in my windows.cfg
That's where I'll need some help, please.
Thanks.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Monitor Disk Usage of Windows Mount Points...

Post by hsmith »

jasonlehman wrote:I was just about to post the results.

I can get results running this...

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize
OK All 5 drive(s) are ok|'C:\ used'=37.26652GB;43.99843;49.49823;0;54.99804 'C:\ used %'=67%;79;89;0;100 'E:\ used'=25.4375MB;197.54999;222.24375;0;246.9375 'E:\ used %'=10%;79;89;0;100 'E:\SQL\Logs\ used'=5.08654GB;59.9976;67.4973;0;74.997 'E:\SQL\Logs\ used %'=6%;79;89;0;100 'E:\SQL\TempDatabases\ used'=1.98883GB;27.9976;31.4973;0;34.997 'E:\SQL\TempDatabases\ used %'=5%;79;89;0;100 'E:\SQL\Databases\ used'=74.58734GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
I cant get results w/ -a option...

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases'
Exception processing request: Request contained arguments (not currently allowed, check the allow arguments option).
So now, I need to figure out how to check each mounted volume listed above; is healthy & how much free space is there.
I'm guessing I'll have to add a command in the commands.cfg
and then add a servce definition in my windows.cfg
That's where I'll need some help, please.
Thanks.
How about adding the following somewhere in your nsclient.ini:

Code: Select all

[/settings/NRPE/server]
allow arguments = true
Former Nagios Employee.
me.
jasonlehman
Posts: 31
Joined: Wed Jul 29, 2015 7:59 am

Re: Monitor Disk Usage of Windows Mount Points...

Post by jasonlehman »

I added that to the nsclient.ini & restarted the NSClient++ service.

I then got different results, but not what we wanted. Am I typing in the wrong syntax?

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases\'
Exception processing request: Request command contained illegal metachars!
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Monitor Disk Usage of Windows Mount Points...

Post by jdalrymple »

In the section:

Code: Select all

[/settings/NRPE/server]
add:

Code: Select all

allow nasty characters = true
Locked