Exclude device nrpe Linux disk check

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Exclude device nrpe Linux disk check

Post by jkinning »

I am running this command

Code: Select all

./check_nrpe -H <host> -c check_disk -a '-w 5% -c 3%'
which includes all mount points but this also includes the /dev whcih I want to exclude. I've tried to exclude this in the check by trying to include -x /dev but that doesn't work. I want to check all the mount points per system which again this check appears to work if I can remove specific mount points like /dev.

Is there a better, more efficient, check to use to accomplish what I am trying to do? I would like a single check to check all the mount points and notify when a mount point reaches the desired limit.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Exclude device nrpe Linux disk check

Post by jdalrymple »

-X accepts type, not name:

Code: Select all

[jdalrymple@localhost /usr/local/libexec/nagios]$ ./check_disk -w 20% -c 10%
DISK CRITICAL - free space: / 29153 MB (98% inode=99%); /dev 0 MB (0% inode=-); /mnt/nfs1 764355 MB (80% inode=99%); /pool0 764355 MB (99% inode=99%); <snip>
[jdalrymple@localhost /usr/local/libexec/nagios]$ ./check_disk -w 20% -c 10% -X devfs
DISK OK - free space: / 29153 MB (98% inode=99%); /mnt/nfs1 764355 MB (80% inode=99%); /pool0 764355 MB (99% inode=99%); <snip>
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Exclude device nrpe Linux disk check

Post by jkinning »

Ok, once again I am doing something wrong. :)

Code: Select all

./check_nrpe -H <host> -c check_disk -a '-w 5% -c 3%' -X devfs
./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.

jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Exclude device nrpe Linux disk check

Post by jolson »

You will need to wrap all of your arguments in quotes. Please give the following a try:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 192.168.x.x -c check_disk -a '-w 20% -c 10% -X devfs'
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Exclude device nrpe Linux disk check

Post by jkinning »

I was able to use the -x /dev -x /dev/shm to exclude these after surrounding the entire command in quotes. :D
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Exclude device nrpe Linux disk check

Post by lmiltchev »

I am glad your issue has been resolved! I am locking this topic now. If you have any more questions/issues, please start a new thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked