yeah, i've found it too
this is what i do now
Code:
./check_nrpe -H host -c check_file_age
so it's working
But now i want to go a little further, in the file nrpe.cfg (located at /usr/local/nagios/etc/ (in my case)) you can add commands (see page 13)
so i've added:
Code:
command[check_file_age]=/usr/local/nagios/libexec/check_file_age -w 100 -c 1000 -f filename
but in that same file (nrpe.cfg) there is something in comment
Quote:
# 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'. This poses a potential security risk, so
# make sure you read the SECURITY file before doing this.
#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$
|
the piece I've put in bold i have also changed into 1 (it was in the same file).
Ok, with everything set up (and xinetd restarted) i go to my monitoring host and type something like:
Code:
./check_nrpe -H 193.191.168.59 -c check_file_age -w 100 -c 1000 -f /cronjob.txt
but then i get the following error:
Code:
./check_nrpe: invalid option -- w
./check_nrpe: invalid option -- f
NRPE Plugin for Nagios
Copyright (c) 1999-2008 Ethan Galstad (nagios@nagios.org)
Version: 2.12
Last Modified: 03-10-2008
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> [-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
[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.
i've read this (i don't understand everything, like the Note..??) so i thought it got to do something with the '-a' or arglist, so then i tried this:
Code:
#./check_nrpe -H 193.191.168.59 -c check_file_age -a 100 -a 1000 -a /cronjob.txt
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
[root@monitor2 plugins]# ./check_nrpe -H 193.191.168.59 -c check_file_age -a 100 1000 /cronjob.txt
CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.
you see the error i get , i tried a couple of possibilities but i don't know what i'm doing wrong.
I know it's a lot of information and maybe hard to understand, but if you know it, feel free to help me
in the meantime i'll try to find the solution and if i do, i'll post it here
Kind regards
Brownie