check_disk

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

check_disk

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_disk

Post 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>
Be sure to check out our Knowledgebase for helpful articles and solutions!
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

Re: check_disk

Post 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]#

User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk

Post 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
Former Nagios employee
https://www.mcapra.com/
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

Re: check_disk

Post by anish »

Many thanks that works.

Can I exclude more than 1?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk

Post 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
Former Nagios employee
https://www.mcapra.com/
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

Re: check_disk

Post by anish »

Thank you. That works!!
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: check_disk

Post by mcapra »

Awesome! Is it alright if we lock this thread and mark the issue as resolved?
Former Nagios employee
https://www.mcapra.com/
anish
Posts: 161
Joined: Tue Jul 19, 2016 5:29 am

Re: check_disk

Post by anish »

Yes please.
Locked