http service checks

8lb4fmllhm001 at sneakemail.com 8lb4fmllhm001 at sneakemail.com
Wed Aug 21 19:57:20 CEST 2002


Touché.  :)

You may still wish to use service templates as follows, so that you know at a glance which port is down.  Depends on whether you want simpler config files, or more meaningful notifications:

define service{
        name                            http
        use                             icmp
        service_description             HTTP
        notification_options            w,u,c,r
        check_command                   check_http!80
        register                        0
        }

define service{
        name                            http_8000
        use                             http
        service_description             HTTP_8000
        notification_options            w,u,c,r
        check_command                   check_http!8000
        register                        0
        }

Sidebar:  It's great to see some dialogue (with examples) regarding how to finesse the config files.  I remember when I first looked at Nagios, I was dreading the horrors of creating H x S entries in the services.cfg file (where H is the total number of hosts, and S is the total number of services -- worst case scneario, of course).  Once I realized how templates worked, and once I looked at the "Time-Saving Tricks For Template-Based Object Definitions" (http://yournagiosservername/nagios/docs/templatetricks.html) I was able to trim *lots* of fat from my config.


Russell Scibetti wrote:
> Save yourself more clutter:
> 
> define command {
>     command_name    check_http_port
>     command_line       $USER1$/check_http -H $HOSTADDRESS$ -p $ARG1$
> }
> 
> then in your service definitions, the check_command line can be:
>     check_command    check_http_port!80
> or
>     check_command    check_http_port!8000
> 
> or whatever port you want to check.  Now you only have one entry in the checkcommands.cfg > and the same number of entries you would have in the services.cfg.


-----------------------------------------------------
Protect yourself from spam, use http://sneakemail.com


-------------------------------------------------------
This sf.net email is sponsored by: OSDN - Tired of that same old
cell phone?  Get a new here for FREE!
https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390




More information about the Users mailing list