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
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 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!
Syntax is fine.

If you get illegal metachars or similar errors you are sending characters which are considered harmful through NRPE. This is a security measure inherited from the regular NRPE client.

Change

Code: Select all

[/settings/NRPE/server]
allow arguments = true


To

Code: Select all

[/settings/NRPE/server]
allow arguments = true
allow nasty characters = 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 »

jdalrymple wrote:In the section:

Code: Select all

[/settings/NRPE/server]
add:

Code: Select all

allow nasty characters = true

What a name for a setting.
I added it & it worked, thanks.

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases\'
OK All 1 drive(s) are ok|'E:\SQL\Databases\ used'=74.58831GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
Any suggestions on how to create a command and or service for this; so Nagios can start monitoring this?
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:
jdalrymple wrote:In the section:

Code: Select all

[/settings/NRPE/server]
add:

Code: Select all

allow nasty characters = true

What a name for a setting.
I added it & it worked, thanks.

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases\'
OK All 1 drive(s) are ok|'E:\SQL\Databases\ used'=74.58831GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
Any suggestions on how to create a command and or service for this; so Nagios can start monitoring this?
Feel free to do these however makes sense to you, here's a quick example I have for you though:

Command:

Code: Select all

define command {
       command_name                             check_mp
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Service:

Code: Select all

define service {
        host_name                       hostname
        service_description             Testing NRPE stuff
        use                             generic-service
        check_command                   check_mp!CheckDriveSize!E:\SQL\Databases!!!!!!
        check_period                    24x7
        register                        1
        }

Mine might look slightly different because I did it on XI :? , but the same ideas apply.
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 »

hsmith wrote:
jasonlehman wrote:
jdalrymple wrote:In the section:

Code: Select all

[/settings/NRPE/server]
add:

Code: Select all

allow nasty characters = true

What a name for a setting.
I added it & it worked, thanks.

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases\'
OK All 1 drive(s) are ok|'E:\SQL\Databases\ used'=74.58831GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
Any suggestions on how to create a command and or service for this; so Nagios can start monitoring this?
Feel free to do these however makes sense to you, here's a quick example I have for you though:

Command:

Code: Select all

define command {
       command_name                             check_mp
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Service:

Code: Select all

define service {
        host_name                       hostname
        service_description             Testing NRPE stuff
        use                             generic-service
        check_command                   check_mp!CheckDriveSize!E:\SQL\Databases!!!!!!
        check_period                    24x7
        register                        1
        }

Mine might look slightly different because I did it on XI :? , but the same ideas apply.
This looks great, thank you!
I will test it later today.
Meetings all day :cry:
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 »

Thanks, just let us know!
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 »

hsmith wrote:
jasonlehman wrote:
jdalrymple wrote:In the section:

Code: Select all

[/settings/NRPE/server]
add:

Code: Select all

allow nasty characters = true

What a name for a setting.
I added it & it worked, thanks.

Code: Select all

[root@nagios plugins]# ./check_nrpe -H xxx.xxx.xxx.xxx -c CheckDriveSize -a Drive='E:\SQL\Databases\'
OK All 1 drive(s) are ok|'E:\SQL\Databases\ used'=74.58831GB;239.9976;269.9973;0;299.997 'E:\SQL\Databases\ used %'=24%;79;89;0;100
Any suggestions on how to create a command and or service for this; so Nagios can start monitoring this?
Feel free to do these however makes sense to you, here's a quick example I have for you though:

Command:

Code: Select all

define command {
       command_name                             check_mp
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Service:

Code: Select all

define service {
        host_name                       hostname
        service_description             Testing NRPE stuff
        use                             generic-service
        check_command                   check_mp!CheckDriveSize!E:\SQL\Databases!!!!!!
        check_period                    24x7
        register                        1
        }

Mine might look slightly different because I did it on XI :? , but the same ideas apply.
I put the command & the service in, but I'm getting a critical status message of...

(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_nrpe, ...) failed. errno is 2: No such file or directory

Could the location of your plugin & my plugin be different?
I copied the exact command_line in as you posted it.
Also, is there a way to alert a warning size & critical size for this check?
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 »

Where is your check_nrpe at?

Code: Select all

find / -name check_nrpe
Lets figure that out before we move on to the warning and critical part.
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 »

hsmith wrote:Where is your check_nrpe at?

Code: Select all

find / -name check_nrpe
Lets figure that out before we move on to the warning and critical part.

Code: Select all

[root@nagios objects]# find / -name check_nrpe
/usr/lib64/nagios/plugins/check_nrpe
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 »

The reason that your command is failing is because...

Code: Select all

define command {
       command_name                             check_mp
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Inside of here $USER1$ is pointing at /usr/local/nagios/libexec since it is defined in resource.cfg as pointing at that.

You need to either move check_nrpe or change the command_line part of the command.

Make sense?
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 »

hsmith wrote:The reason that your command is failing is because...

Code: Select all

define command {
       command_name                             check_mp
       command_line                             $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -a $ARG2$
}
Inside of here $USER1$ is pointing at /usr/local/nagios/libexec since it is defined in resource.cfg as pointing at that.

You need to either move check_nrpe or change the command_line part of the command.

Make sense?
Make's perfect sense. I changed the command_line to point to the correct path; which is for me /usr/lib64/nagios/plugins/
I'm not sure why mine is different.

I now need to understand how to put in the correct path to the mount point in the check_command.
Using what was suggested... check_mp!CheckDriveSize!E:\SQL\Databases!!!!!!

I now get this result from Nagios...
Filter processing failed: Error: Failed to get size for: 3: The system cannot find the path specified.

Do I really need 6 exclamation points after my path? I'm not sure why there are so many.
Thanks
Locked