Page 1 of 1

How to monitor the disk usage by size using Nrpe

Posted: Fri Jan 27, 2017 11:42 am
by vyasdevaguddi
i would like to monitor my AIX server disk usage by size using NRPE but i am receiving false alerts

here the sample of /usr/local/nagios/etc/objects


define service{
use local-service ; Name of service template to use
host_name entest
service_description Tmp Partition
check_command check_nrpe!check_disk '-a -c98% -u GB /tmp' -n
#notification_interval 10
#contact_groups Aix admins
}

define service{
use local-service ; Name of service template to use
host_name entest
service_description tmp Partition
check_command check_nrpe!check_disk '-a -w95% -u GB /tmp' -n


can you please help to monitor my filesystem by disk and space

Re: How to monitor the disk usage by size using Nrpe

Posted: Fri Jan 27, 2017 1:20 pm
by rkennedy
Please also show us how check_nrpe is defined, and also how check_disk is defined on the client machine in the NRPE configuration.

Re: How to monitor the disk usage by size using Nrpe

Posted: Fri Jan 27, 2017 2:15 pm
by vyasdevaguddi
# The following examples use hardcoded command arguments...

command[check_aix_disks]=/usr/local/nagios/libexec/check_disk -w 10m -c 2m -x /proc
command[check_aix_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_aix_swap]=/usr/local/nagios/libexec/check_swap -w 30% -c 10%
command[check_aix_procs]=/usr/local/nagios/libexec/check_procs -w 100 -c 200
command[check_aix_users]=/usr/local/nagios/libexec/check_users -w 20 -c 50

# The following examples allow user-supplied arguments and can
# only be used if the NRPE daemon was compiled with support for
# command arguments *AND* the dont_blame_nrpe directive in this
# config file is set to '1'...

#command[check_users]=/usr/local/nagios/libexec/check_users -w $ARG1$ -c $ARG2$
#command[check_load]=/usr/local/nagios/libexec/check_load -w $ARG1$ -c $ARG2$
#command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
#command[check_procs]=/usr/local/nagios/libexec/check_procs -w $ARG1$ -c $ARG2$ -s $ARG3$

command[check_users]=/usr/local/nagios/libexec/check_users 5 50 -n
command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
command[check_procs]=/usr/local/nagios/libexec/check_procs
command[check_swap]=/usr/local/nagios/libexec/check_swap 20 10 -n
#command[check_disk]=/usr/local/nagios/libexec/check_disk -c $ARG1$ -p $ARG3$

Re: How to monitor the disk usage by size using Nrpe

Posted: Fri Jan 27, 2017 2:36 pm
by rkennedy
vyasdevaguddi wrote:# The following examples use hardcoded command arguments...
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$

Code: Select all

check_command check_nrpe!check_disk '-a -c98% -u GB /tmp' -n
Based on how you have it defined here, you're passing invalid options. You'll want to adjust it to something like -

Code: Select all

check_command check_nrpe!check_disk -a "arg1" "arg2" "arg3"
That way everything populates correctly. Right now, what you're passing is everything in $ARG1$ which ignores the -c and -p.

Re: How to monitor the disk usage by size using Nrpe

Posted: Fri Jan 27, 2017 3:49 pm
by vyasdevaguddi
can you please tell me how to pass the arguments correctly for the check disk values .with the values that will be helpful.

Re: How to monitor the disk usage by size using Nrpe

Posted: Mon Jan 30, 2017 9:31 am
by vyasdevaguddi
As you said i have passed the parameters and iam still getting alerts

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
check_command check_nrpe!check_disk '-w95% - c98% - p /tmp'

please let me know if i am passing arguments incorrectly

Re: How to monitor the disk usage by size using Nrpe

Posted: Mon Jan 30, 2017 11:10 am
by rkennedy
vyasdevaguddi wrote:As you said i have passed the parameters and iam still getting alerts

command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
check_command check_nrpe!check_disk '-w95% - c98% - p /tmp'

please let me know if i am passing arguments incorrectly
rkennedy wrote:
vyasdevaguddi wrote:# The following examples use hardcoded command arguments...
command[check_disk]=/usr/local/nagios/libexec/check_disk -w $ARG1$ -c $ARG2$ -p $ARG3$
Based on how you have it defined here, you're passing invalid options. You'll want to adjust it to something like -

Code: Select all

check_command check_nrpe!check_disk -a "arg1" "arg2" "arg3"
That way everything populates correctly. Right now, what you're passing is everything in $ARG1$ which ignores the -c and -p.
See what I posted above. '-w95% - c98% - p /tmp' is not correct because you've already passed -w and -c in your NRPE definition.

Re: How to monitor the disk usage by size using Nrpe

Posted: Wed Mar 01, 2017 2:11 pm
by tmcdonald
Just checking in since we have not heard from you in a while. Did @rkennedy's post clear things up or has the issue otherwise been resolved?