LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-18-2011, 06:00 AM   #1
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416
Blog Entries: 2

Rep: Reputation: 12
NRPE problem


Hi all

I've followed this tutorial for installing and configuring NRPE Daemon
link
and everything works (when i follow the tutorial)

now i've added a plugin of mine (so i did the changes from page 13 to 14)
and i restarted everything, but how can i execute a check from the monitor host?

For example, i have a check called check_file_age which checks the age of a file (ofcourse) on the remote host. When i execute this on the remote host itself everything is fine
Code:
 ./check_file_age -w 100 -c 200 -f filename
but HOW do i run this FROM the monitor host?

Can someone please help me with this? It's probably something easy, but i can't figure out what to do

Thanks in advance

Kind regards

Brownie
 
Old 04-18-2011, 06:53 AM   #2
stoggy
Member
 
Registered: Jun 2008
Location: Dallas, TX
Distribution: Slackware and FC
Posts: 113

Rep: Reputation: 22
check page 10 in the link you provided.
 
Old 04-18-2011, 07:22 AM   #3
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
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
 
Old 04-18-2011, 07:36 AM   #4
brownie_cookie
Member
 
Registered: Mar 2011
Location: Belgium
Distribution: CentOS release 5.5 (Final), Red Hat Enterprise Linux ES release 4 (Nahant Update 8)
Posts: 416

Original Poster
Blog Entries: 2

Rep: Reputation: 12
oke guys

i already found the solution

when you do
Code:
./configure
on the REMOTE host, USE
Code:
./configure --enable-command-args
and than do the other things that are described in the link and then you should fine

maybe nice to know, if you did that special configure and want to use a check from the monitor host, use
Code:
./check_nrpe -H remote_host -c check_file_age -a 100 1000 /filename.txt
in order to your needs, you might to need to change the filenames, arguments

Kind regards

P.S.: link

Last edited by brownie_cookie; 04-18-2011 at 07:41 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Nagios NRPE problem babaqga Linux - Software 5 09-08-2010 04:08 AM
[SOLVED] NRPE problem with Nagios babaqga Linux - Software 1 08-27-2010 10:49 AM
Installing Nagios agent nrpe, problems following nrpe install steps rfreiberger Linux - Newbie 3 04-19-2010 08:43 AM
NRPE Problem patoy Linux - Newbie 5 09-08-2008 04:49 AM
Nagios NRPE twantrd Linux - Software 1 10-20-2004 08:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration