On Jun 3, 2009, at 2:59 PM, Justin T Pryzby wrote:

> Hello,
>
> Is there any way to monitor host A's externally-available service from
> host B, while still having it "grouped with" the rest of A's services
> (many of which are not available from other hosts)?
>
> I want to monitor one hosts IMAP service.  We're using NRPE, however
> testing from a 2ndary host asserts that the service is available
> remotely (that networking works, firewall is allowing the packets,
> etc.).  So for externally-accessible services, I'd like the checks to
> happen on a 2ndary host (probably the same host running the nagios
> service).


If you're wanting to check IMAP on a remote machine from the nagios  
machine then that's nothing special. Just define a service for hostA  
that calls check_imap without using NRPE.

If you have something more complex like nagios -> hostB -> hostA then  
something like this is what you need --

define command {
        command_name    check_imap_special
        command_line    $USER1$/check_nrpe $ARG1$ -c check_imap ...
}

define service {
        host_name       hostA
        service_description IMAP
        ...
        check_command   check_imap_special!<ip or hostname of hostB>
}

This presumes that nrpe.cfg on hostB has a command definition of  
check_imap that has the IP or name of hostA hard-coded into it. If  
you've enabled command arguments for NRPE, you could pass that IP  
using the $HOSTADDRESS$ macro like --


define command {
        command_name    check_imap_special
        command_line    $USER1$/check_nrpe $ARG1$ -c check_imap -a $HOSTADDRESS 
$ ...
}

nrpe.cfg --

command[check_imap]=/usr/local/nagios/libexec/check_imap -H $ARG1$ -w  
10 -c 30 ...

--
Marc


------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Nagios-users mailing list
[email protected]
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

Reply via email to