http service checks
Russell Scibetti
russell at quadrix.com
Wed Aug 21 19:09:27 CEST 2002
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20020821/8f70c40e/attachment.html>
More information about the Users
mailing list