Re: [Nagios-users] Problem with custom plugin on a remote linux box

2010-09-19 Thread Roderick Andrew Clemente
Benny!

Thank you so much this solved my issue, I can now monitor custom
plugins on a remote linux box!!!

Thanks again,

Roderick

On Fri, Sep 17, 2010 at 9:03 PM, C. Bensend  wrote:
>
>> **On the machine being monitored**
>> I have the perl script I created in /usr/local/nagios/libexec/custom/ (its
>> a
>> modification of
>> http://www.deimos.fr/gitweb/?p=nagios_plugins.git;a=blob;f=check_file_conten
>> t/check_file_content.pl;h=ecf737389fd5a4360ee864eb55aca92056308445;hb=HEAD
>> I
>> have tested it from the command line as the nagios user and it works as
>> expected)
>>
>> in the file: /usr/local/nagios/etc/nrpe.cfg i added
>> command[check_wadmin]=/usr/bin/perl
>> /usr/local/nagios/libexec/custom/check_wadmin.pl -f /tmp/nagiosInput.txt
>> -i
>> wait -n 35
>
> OK, good.
>
>> ***On the monitoring machine***
>> I already had the machine monitoring the remote linux box's basic stats, I
>> did this by creating a remotelinuxhost.cfg file at
>> /usr/local/nagios/etc/objects (and adding a reference in the main config)
>>
>> To remotelinuxhost.cfg I added:
>>
>> define service{
>> use generic-service ; Name of service template to use
>> host_name Sun89
>> service_description Check Feed Handler
>> check_command check_wadmin
>> }
>>
>>
>> I also added commands.cfg (in the same folder)
>>
>> #custom - 'check_wadmin' command definition
>> define command{
>>          command_name   check_wadmin
>>          command_line   check_nrpe
>>        }
>
> Bzzzt.  Here's where it's incorrect.
>
> check_nrpe only checks the status of the NRPE daemon on the remote
> end.  You need to use NRPE on the remote end to invoke your
> check_wadmin test.
>
> So, on your Nagios server, you need to set the command_line for the
> check_wadmin command to something like:
>
> $USER1$/check_nrpe -H $HOSTADDRESS$ -c check_wadmin
>
>
> $USER1$
> ^^^ The path to your local plugins (on the Nagios server)
>
>        check_nrpe
>        ^^ Need to use check_nrpe to check the command on the
>                   remote host
>
>                   -H $HOSTADDRESS$
>                    What host to check
>
>                                     -c check_wadmin
>                                     ^^^ What command to
>                                                    run *ON THE
>                                                    REMOTE HOST*
>
> NRPE only allows you to run plugins designed to be local-only on
> a remote system.  You need to tell it *what* to run, and *how*
> to run it.
>
> Benny
>
>
> --
> "Because you have arms like noodles, while I am vigorous and
> burly."                               -- Hodgins, "Bones"
>
>
>
> --
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> ___
> Nagios-users mailing list
> Nagios-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS when reporting 
> any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>

--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


Re: [Nagios-users] Problem with custom plugin on a remote linux box

2010-09-17 Thread Roderick Andrew Clemente
Hi Benny and Nagios People,

Sorry for my delayed response, my boss pulled me off this project and we
have been so swamped I didn't get to come back to it until today!  
Thanks for your help but I still am not quite there, based on what you
directed below I now have the following configuration:

**On the machine being monitored**
I have the perl script I created in /usr/local/nagios/libexec/custom/ (its a
modification of
http://www.deimos.fr/gitweb/?p=nagios_plugins.git;a=blob;f=check_file_conten
t/check_file_content.pl;h=ecf737389fd5a4360ee864eb55aca92056308445;hb=HEAD I
have tested it from the command line as the nagios user and it works as
expected)

in the file: /usr/local/nagios/etc/nrpe.cfg i added 
command[check_wadmin]=/usr/bin/perl
/usr/local/nagios/libexec/custom/check_wadmin.pl -f /tmp/nagiosInput.txt -i
wait -n 35



***On the monitoring machine***
I already had the machine monitoring the remote linux box's basic stats, I
did this by creating a remotelinuxhost.cfg file at
/usr/local/nagios/etc/objects (and adding a reference in the main config)

To remotelinuxhost.cfg I added: 

define service{
use generic-service ; Name of service template to use
host_name Sun89
service_description Check Feed Handler
check_command check_wadmin
}


I also added commands.cfg (in the same folder) 

#custom - 'check_wadmin' command definition
define command{
 command_name   check_wadmin
 command_line   check_nrpe
   }

*NOTE: I also tried this but when I tried to reload the service it wouldn't
accept it:
define command{
 command_name   check_nrpe
 command_line   /usr/bin/perl
/usr/local/nagios/libexec/custom/check_wadmin.pl -f /tmp/nagiosInput.txt -i
wait -n 35
}


The Nagios web interface now has the error message:
(Return code of 127 is out of bounds - plugin may be missing)

Any ideas on what I am doing wrong here? 

Thanks again,
Roderick

-Original Message-
From: C. Bensend [mailto:be...@bennyvision.com] 
Sent: Thursday, September 02, 2010 7:13 PM
To: nagios-users@lists.sourceforge.net
Subject: Re: [Nagios-users] Problem with custom plugin on a remote linux box


> in the file: vi /usr/local/nagios/etc/nrpe.cfg i added 
> command[check_wadmin]=perl 
> /usr/local/nagios/libexec/custom/check_wadmin.pl
> -f /tmp/nagiosInput.txt -i wait -n 35

Always use the full path to interpreters, as the Nagios environment is not
the same as a normal shell user's.

> I also added commands.cfg (in the same folder)
>
> define command{
> command_name check_wadmin
> command_line perl /usr/local/nagios/libexec/custom/check_wadmin.pl -f 
> /tmp/nagiosInput.txt -i wait -n 35 }

Same with here.

> When I reloaded the service, it accepted the config but the result is 
> as listed above... if anyone has any suggestions it would be greatly 
> appreciated!!!

The command you have created above expects the check command to be on the
local (Nagios) server, *not* the remote client.  I don't think that's what
you intend.  Since your custom plugin is on the remote server and is
configured within NRPE to be run, you need to use check_nrpe on the Nagios
server to test it.

Modify the check_wadmin command on the Nagios server to use the check_nrpe
command to test it on the remote server, and I think you'll probably be OK.

Benny


--
"Because you have arms like noodles, while I am vigorous and
burly."   -- Hodgins, "Bones"




--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


--
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null


[Nagios-users] Problem with custom plugin on a remote linux box

2010-09-02 Thread Roderick Andrew Clemente
Hi All,

Thanks for taking the time to read this. I am currently trying to setup
Nagios to monitor a Feed Handler on a remote Linux box. I am so close I can
taste it! Sadly, the nagios admin doesn't appear to be reading the command
properly. I am new to Nagios so please bear with me, there are a lot of
moving pieces so I thought i would provide as much information as possible
to make it easy to figure out the issue. If there is something I am missing,
please don't hesitate to ask. 

To start with, the admin is successfully monitoring other services on the
box, ping, processes, disk usage, etc. but for the custom plugin I am trying
to read, it fails with a status of CRITICAL and status info of NULL. Here is
what I believe to be the relevant config info.

On the machine being monitored
I added the perl script I created to /usr/local/nagios/libexec/custom/ (its
a modification of
http://www.deimos.fr/gitweb/?p=nagios_plugins.git;a=blob;f=check_file_conten
t/check_file_content.pl;h=ecf737389fd5a4360ee864eb55aca92056308445;hb=HEAD I
have tested it from the command line and it works as expected)

in the file: vi /usr/local/nagios/etc/nrpe.cfg i added 
command[check_wadmin]=perl /usr/local/nagios/libexec/custom/check_wadmin.pl
-f /tmp/nagiosInput.txt -i wait -n 35

On the monitoring machine
I already had the machine monitoring the remote linux box's basic stats, I
did this by creating a remotelinuxhost.cfg file at
/usr/local/nagios/etc/objects (and adding a reference in the main config)

To remotelinuxhost.cfg I added: 

define service{
use generic-service ; Name of service template to use
host_name Sun89
service_description Check Feed Handler
check_command check_wadmin
}


I also added commands.cfg (in the same folder) 

define command{
command_name check_wadmin
command_line perl /usr/local/nagios/libexec/custom/check_wadmin.pl -f
/tmp/nagiosInput.txt -i wait -n 35
}

When I reloaded the service, it accepted the config but the result is as
listed above... if anyone has any suggestions it would be greatly
appreciated!!!

 

〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・

Roderick Andrew Clemente

Multi Wave Co., Ltd. 

9F Kanda Tsukasa-cho Bldg., 2-2-12 Kanda Tsukasa-cho 

Chiyoda-ku, Tokyo 101 0048 Japan 

Tel: +81-3 3258 7080

Fax: +81-3 3258 7085

Email:  <mailto:r...@mwave.co.jp> r...@mwave.co.jp 

〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・〜・

 

--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd___
Nagios-users mailing list
Nagios-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null