How to define remote passive check commands in Nagios cfg file.

Marc Powell marc at ena.com
Fri Mar 11 19:09:29 CET 2005



> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Braun Brelin
> Sent: Friday, March 11, 2005 11:51 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] How to define remote passive check commands in
> Nagios cfg file.
> 
> Hello,
> 
> I've written a program that checks an application log file for some
data
> and sends the data to the send_nsca program which transmits it to the
nsca
> daemon I have running on the Nagios server.
> 
> What I'm unclear on is how to define the command and service in the
> appropriate configuration files.  For instance, what would I put into
the
> 'command line' entry of a checkcommand template?

There are basically two possible scenarios here --

1) You do not want to perform freshness checks of the service from your
central host. In this case, set check_period to 'none' in your service
definition and your check_command can be any defined check_command
(check_dummy for example). The command will never be executed so it
doesn't matter what it is.

2) You do want to perform freshness checks of the service from your
central host IFF you do not receive timely passive results. In this
case, enable check_freshness and its associated options and define a
check_command that will validly determine the state of the service from
your central host. This command _will_ be executed if passive results
aren't timely.

> 
> Does anyone have any examples of a configuration file that defines a
> service which is a remote passive check?

I use option 1 above --

# 'always-true' command definition
define command{
        command_name    always-true
        command_line    $USER1$/check_dummy 0
        }

# Generic service definition template
define service{
        name                            generic-service
        active_checks_enabled           1       
        passive_checks_enabled          1               
	  parallelize_check               1       
        obsess_over_service             1       
        check_freshness                 0       
        notifications_enabled           1       
        event_handler_enabled           1       
        flap_detection_enabled          1       
        process_perf_data               1       
        retain_status_information       0       
        retain_nonstatus_information    1       
        is_volatile                     0
        check_period                    none
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            3
        notification_interval           10080
        notification_period             24x7
        notification_options            c,r
        register                        0       
        }

#Service definition
define service {
        use                     generic-service
        host_name               some-example-host
        service_description     PING
        contact_groups          tnops
        check_command           check_dummy
        }

--
Marc


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at 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





More information about the Users mailing list