http service checks

Terry Simons galimore at mac.com
Wed Aug 21 21:58:55 CEST 2002


This is exactly how I do it too.

You don't need to re-define a service for every port you need to check.

The ARG variables come in very handy here.

I'd strongly recommend checking out the macro page: 
http://nagios.sourceforge.net/docs/1_0/macros.html

It talks about all of the available macros, and which ones you can use 
where.  Very nice, and a handy reference.

- Terry

On Wednesday, August 21, 2002, at 11:09 AM, 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.
>
> -Russell
>
> 8lb4fmllhm001 at sneakemail.com wrote:
>
> Max, you're making it unnecessarily hard on yourself.
>
> What you need to do is tweak the checkcommands.cfg to allow you to poke 
> at different http ports.  You tweak services.cfg to leverage these new 
> definitions.  Take a look at what I'm doing, as a baseline.
>
> In my checkcommands.cfg:
>
> # 'check_http' command definition
> define command{
>         command_name    check_http
>         command_line    $USER1$/check_http -H $HOSTADDRESS$
>         }
>
> # 'check_http_8000' command definition
> define command{
>         command_name    check_http_8000
>         command_line    $USER1$/check_http -H $HOSTADDRESS$ -p 8000
>         }
>
> # 'check_http_8080' command definition
> define command{
>         command_name    check_http_8080
>         command_line    $USER1$/check_http -H $HOSTADDRESS$ -p 8080
>         }
>
> And in my services.cfg:
>
> define service{
>         name                            icmp
>         use
>                         generic-service
>         service_description             PING
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           5
>         retry_check_interval            1
>         notification_interval           60
>         notification_period             24x7
>         notification_options            c,r
>         check_command                   check_ping!100.0,20%!500.0,60%
>         register                        0
>         }
>
> define service{
>         name                            http
>         use                             icmp
>         service_description             HTTP
>         notification_options            w,u,c,r
>         check_command                   check_http
>         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
>         }
>
> define service{
>         name                            http_8080
>         use                             http
>         service_description             HTTP_8080
>         notification_options            w,u,c,r
>         check_command                   check_http_8080
>         register                        0
>         }
>
> And further down in services.cfg:
>
> define service{
>         host_name                       host1,host7
>         use                             http
>         contact_groups                  unix-admins
>         }
>
> define service{
>         host_name                       host2,host8,host9
>         use                             http_8000
>
>         contact_groups                  linux-admins
>         }
>
> define service{
>         host_name                       host3,host10
>         use                             http_8080
>         contact_groups                  unix-admins
>         }
>
> (Hostnames changed, just cuz.)
>
> Does this help?  This should save you *lots* of clutter.
>
> Bonus:  If you use hostgroups, you can save more keystrokes by 
> specifying "hostgroup_name" and the name(s) of the hostgroup(s) instead 
> of using "host_name" with a long list of hosts.  (You'll need to have 
> that defined in hostgroups.cfg first.)
>
>
> Max Clark wrote:
>
> I am a brand new nagios user and so far have been able to
> configure and
> use the program without too much difficulty. I am trying to configure
> http service checks for a series of virtual hosts on my web servers.
> What is the best way to do this?
>
> From my understanding I need to create a host, customize the
> check_http
> in check commands like (create check_http_vhost1 - check_http -H
> www.host1.com, check_http_vhost2 - check_http -H
> www.host2.com, etc...),
> and define services where I correlate the service to the host.
>
> Is there a better way to do this?
>
>
>
> -----------------------------------------------------
> 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
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
>
>
>
> --
> Russell Scibetti
> Quadrix Solutions, Inc.
> http://www.quadrix.com
> (732) 235-2335, ext. 7038
>
>



-------------------------------------------------------
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