[Nagiosplug-help] How must I define this in checkcommands.cfg and services.cfg?

Ben O'Hara bohara at gmail.com
Wed Aug 3 01:07:55 CEST 2005


On 8/3/05, Ralph.Grothe at itdz-berlin.de <Ralph.Grothe at itdz-berlin.de> wrote:
> Hi,
> 
> as long as I cannot find a way how to see what the nagios
> scheduler is actually substituting and executing as a check_nrpe
> command, I am stuck, and I have to treat Nagios as a black box.
> I find this very unsatisfactory.
> 
> I tried all to me conceivable command and service definition
> variants but all don't work,
> and all I get is CRC32 errors that result in UNKNOWN states.
> 
> 
> I want exactly a check_nrpe command line like the one below
> (issued manually from the Nagios server daisy against the remote
> host nemesis) to be run by the nagios daemon.
> 
> 
> [nagios at daisy:~/etc]
> $ /opt/sw/nagios/libexec/check_nrpe -H nemesis -c
> check_vcs_sg\!evo1\!nemesis
> 
> OK: hagrp evo1 is ONLINE
> 
> 
> 
> 
> How should a command and service object definition look like for
> it to work?
>

First off, define "nemesis" in etc/hosts.cfg as follows

define host{
        use                     generic-host
        host_name               nemeis
        alias                   Nemesis
        address                 1.2.3.4
        max_check_attempts      10
        notification_interval   120
        notification_period     24x7
        notification_options    d,u,r
        }

Also add it to a hostgroup in etc/hostgroups.cfg

define hostgroup{
        hostgroup_name  nemesisgroup
        alias           ServerGroup
        contact_groups  admins
        members         nemesis
       }

Add a check_nrpe command into etc/checkcommands.cfg

define command{
        command_name    check_nrpe
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
        }

and then add the service into etc/services.cfg

define service{
        use                             generic-service
        host_name                       nemesis
        service_description             EVO
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              5
        normal_check_interval           3
        retry_check_interval            1
        contact_groups                  admins
        notification_interval           120
        notification_period             24x7
        notification_options            w,u,c,r
        check_command                   check_nrpe!check_vcs_sg\!evo1\!nemesis
        }

Looksl ike NRPE is already configured correctly with the check command
setup in nrpe.cfg so this should be all thats required.

Regards

Ben




More information about the Help mailing list