Config help for webserver

Daniel Budde II dbuddeii at leadergraphics.com
Fri Mar 18 00:28:26 CET 2005


Marc,

Thanks for your help.  One last question for the moment.  What do the "!" do
in your "check_ping!www.site2.com!127.0.0.2"?  Is this how you pass
individual arguments? Last, is it not better to use "check_http" rather than
"check_ping"?  If you can tell me this, that will be my last questions
hopefully pertaining to host and service configs.

Thanks,

Daniel



-----Original Message-----
From: Marc Powell [mailto:marc at ena.com] 
Sent: Thursday, March 17, 2005 5:07 PM
To: Daniel Budde II; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Config help for webserver

> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users- 
> admin at lists.sourceforge.net] On Behalf Of Daniel Budde II
> Sent: Thursday, March 17, 2005 4:55 PM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Config help for webserver
> 
> I am new to nagios and the only question I have thus far is with the 
> configs.  I have one host technically speaking, but it has multiple 
> addresses assigned to it for multiple websites.  I want to perform a 
> service check on each website.  Do I have to create a separate host 
> for each website? Or is there a way to specify with each service check 
> what IP address is used?  I do know I can assign one host multiple 
> IP's, but I
am
> unsure if this is the practice I am looking for.  Please let me know
what
> would be the proper host and service config for this situation.

I'd probably go with the following as a basic example --

# 'check_http' command definition
# you should add or remove arguments to check_http as necessary define
command{
        command_name    check_http
        command_line    $USER1$/check_http  -H $ARG1$ -I $ARG2$ -s
\/html
        }

# Generic host definition template
# adjust these values as you see fit
define host{
        name                            generic-host
        notifications_enabled           1
        event_handler_enabled           0
        flap_detection_enabled          1
        process_perf_data               0
        retain_status_information       0
        retain_nonstatus_information    1
        max_check_attempts              1
        notification_interval           0
        notification_period             24x7
        notification_options            d,r

        register                        0
        }

# Generic service definition template
# adjust these values as you see fit.
define service{
        name                            generic-service
        notifications_enabled           1
        active_checks_enabled           1
        passive_checks_enabled          0
        parallelize_check               1
        obsess_over_service             0
        check_freshness                 0
        event_handler_enabled           0
        flap_detection_enabled          1
        process_perf_data               0
        retain_status_information       0
        retain_nonstatus_information    1
        is_volatile                     0
        check_period                    24x7
        max_check_attempts              5
        normal_check_interval           5
        retry_check_interval            3
        notification_interval           0
        notification_period             24x7
        notification_options            c,r

        register                        0
        }

# master host definition
define host{
        use                     generic-host
        host_name               your-master-host
        alias                   Whatever
        address                 master.ip.address.here
        }
# Service definition for ping
define service{
        use                             generic-service
        host_name                       your-master-host
        service_description             PING
        retry_check_interval            3
        contact_groups                  whoever
        check_command                   check_ping
        }
# Service definition for website1
define service{
        use                             generic-service
        host_name                       your-master-host
        service_description             SITE1
        contact_groups                  whoever
        check_command
check_http!www.site1.com!127.0.0.1
        }
# Service definition for website2
define service{
        use                             generic-service
        host_name                       your-master-host
        service_description             SITE2
        contact_groups                  whoever
        check_command
check_ping!www.site2.com!127.0.0.2
        }
Etc...

Substitute valid/correct IPs, hostnames, etc as necessary...

--
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_id=6595&alloc_id=14396&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