Page 1 of 1

check_disk

Posted: Sat Sep 10, 2016 2:10 am
by anish
Hello,

I am using check_nrpe –H localhost –t 30 –c check_disk –a ‘-w 20% -c10%’

Can I exclude paths like /boot etc while using the above

Thanks,
Anish

Re: check_disk

Posted: Mon Sep 12, 2016 11:54 am
by lmiltchev
You should be able to use:

Code: Select all

./check_nrpe –H localhost –t 30 –c check_disk –a ‘-w 20% -c10% -x "/boot"’
From the plugin's usage:
-x, --exclude_device=PATH <STRING>

Re: check_disk

Posted: Wed Sep 14, 2016 3:32 am
by anish

Code: Select all

[root@SESKLNGCOREPD02 libexec]# ./check_nrpe –H localhost –t 30 –c check_disk –a ‘-w 20% -c10% -x "/boot"’
./check_nrpe: invalid option -- 'x'

NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad ([email protected])
Version: 2.15
Last Modified: 09-06-2013
License: GPL v2 with exemptions (-l for more info)
SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required

Usage: check_nrpe -H <host> [ -b <bindaddr> ] [-4] [-6] [-n] [-u] [-p <port>] [-t <timeout>] [-c <command>] [-a <arglist...>]

Options:
 -n         = Do no use SSL
 -u         = Make socket timeouts return an UNKNOWN state instead of CRITICAL
 <host>     = The address of the host running the NRPE daemon
 <bindaddr> = bind to local address
 -4         = user ipv4 only
 -6         = user ipv6 only
 [port]     = The port on which the daemon is running (default=5666)
 [timeout]  = Number of seconds before connection times out (default=10)
 [command]  = The name of the command that the remote daemon should run
 [arglist]  = Optional arguments that should be passed to the command.  Multiple
              arguments should be separated by a space.  If provided, this must be
              the last option supplied on the command line.

Note:
This plugin requires that you have the NRPE daemon running on the remote host.
You must also have configured the daemon to associate a specific plugin command
with the [command] option you are specifying here.  Upon receipt of the
[command] argument, the NRPE daemon will run the appropriate plugin command and
send the plugin output and return code back to *this* plugin.  This allows you
to execute plugins on remote hosts and 'fake' the results to make Nagios think
the plugin is being run locally.

[root@SESKLNGCOREPD02 libexec]#


Re: check_disk

Posted: Wed Sep 14, 2016 10:00 am
by mcapra
Try this syntax:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H <host> -t 30 -c check_disk -a '-w 20% -c 10% -x /boot'

Code: Select all

[root@localhost libexec]# ./check_nrpe -H 192.168.67.97 -t 30 -c check_disk -a '-w 20% -c 10% -x /boot'
DISK OK - free space: / 15103 MB (84% inode=99%); /dev 1886 MB (100% inode=99%); /dev/shm 1895 MB (100% inode=99%); /run 1708 MB (90% inode=99%); /sys/fs/cgroup 1895 MB (100% inode=99%); /var/www/clients/client0/web1/log 15103 MB (84% inode=99%); /run/user/5001 379 MB (100% inode=99%); /run/user/0 379 MB (100% inode=99%);| /=2774MB;14302;16090;0;17878 /dev=0MB;1508;1697;0;1886 /dev/shm=0MB;1516;1705;0;1895 /run=186MB;1516;1705;0;1895 /sys/fs/cgroup=0MB;1516;1705;0;1895 /var/www/clients/client0/web1/log=2774MB;14302;16090;0;17878 /run/user/5001=0MB;303;341;0;379 /run/user/0=0MB;303;341;0;379

Re: check_disk

Posted: Wed Sep 14, 2016 10:26 am
by anish
Many thanks that works.

Can I exclude more than 1?

Re: check_disk

Posted: Wed Sep 14, 2016 10:32 am
by mcapra
Sure! Running off of the previous example:

Code: Select all

[root@localhost libexec]# /usr/local/nagios/libexec/check_nrpe -H 192.168.67.97 -t 30 -c check_disk -a '-w 20% -c 10% -x /boot -x /run -x /sys/fs/cgroup'
DISK OK - free space: / 15101 MB (84% inode=99%); /dev 1886 MB (100% inode=99%); /dev/shm 1895 MB (100% inode=99%); /var/www/clients/client0/web1/log 15101 MB (84% inode=99%); /run/user/5001 379 MB (100% inode=99%); /run/user/0 379 MB (100% inode=99%);| /=2776MB;14302;16090;0;17878 /dev=0MB;1508;1697;0;1886 /dev/shm=0MB;1516;1705;0;1895 /var/www/clients/client0/web1/log=2776MB;14302;16090;0;17878 /run/user/5001=0MB;303;341;0;379 /run/user/0=0MB;303;341;0;379

Re: check_disk

Posted: Wed Sep 14, 2016 10:38 am
by anish
Thank you. That works!!

Re: check_disk

Posted: Wed Sep 14, 2016 10:53 am
by mcapra
Awesome! Is it alright if we lock this thread and mark the issue as resolved?

Re: check_disk

Posted: Wed Sep 14, 2016 11:06 am
by anish
Yes please.