How to monitor the disk usage by size using Nrpe

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
vyasdevaguddi
Posts: 21
Joined: Fri Jan 27, 2017 11:30 am

How to monitor the disk usage by size using Nrpe

Post 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
Attachments
Capture.PNG
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
vyasdevaguddi
Posts: 21
Joined: Fri Jan 27, 2017 11:30 am

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

Post 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$
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
vyasdevaguddi
Posts: 21
Joined: Fri Jan 27, 2017 11:30 am

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

Post 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.
vyasdevaguddi
Posts: 21
Joined: Fri Jan 27, 2017 11:30 am

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

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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.
Former Nagios Employee
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

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

Post 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?
Former Nagios employee
Locked