Page 3 of 5

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

Posted: Mon Aug 24, 2015 2:57 pm
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

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

Posted: Mon Aug 24, 2015 3:02 pm
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?

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

Posted: Mon Aug 24, 2015 3:19 pm
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.

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

Posted: Tue Aug 25, 2015 7:42 am
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:

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

Posted: Tue Aug 25, 2015 9:20 am
by hsmith
Thanks, just let us know!

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

Posted: Tue Aug 25, 2015 2:40 pm
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,

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

Posted: Tue Aug 25, 2015 2:54 pm
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.

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

Posted: Tue Aug 25, 2015 3:04 pm
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

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

Posted: Tue Aug 25, 2015 3:28 pm
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?

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

Posted: Wed Aug 26, 2015 7:49 am
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