A question on check_http to over 100 sites

Assaf Flatto nagios at flatto.net
Tue May 11 17:37:53 CEST 2010


steve f wrote:
> I have a need to verify that vendor urls for my company do not change. 
> Since we only allow our locations to see approved urls, this is important.
>
> I was hoping there was some way I could use a macro to do the 
> check_http and have all of the urls for the sites listed as the macro 
> contents .  Something like this -
>
> define url{
> 	url_name	www.test.com,www.test2.com,www.test3.com.....
> 	check_command	check_http
> 	...
> 	}
>   
>
>
> define command{
> 	command_name    check_http
> 	command_line    /usr/local/nagios/plugins/check_http -L $URL$ -c
>  $ARG1$ -w $ARG2$
>         }
>
> Can I create a $URL$ macro for use here?  Would doing something like this work?
>
> Is there an easier way for me to have a single host ( localhost) to verify the list of 100 + urls ?  
> The plan is to do it 1 time a day & send a notification of it fails to get there.  
> They can then update the approved list of the new url.
>
> Is it not " advisable" to use check_http in this manner?  I am using it to watch a corporate now 
> & it has been reliable.
>
> Thanks,
> Steve
>   
you can make it with a hostgroup and -I in the check_http request .

that way you do not need to define a macro , but use existing 
configuration and capabilities with in nagios .

use a template for all the base definitions and just add the "url" in 
the host name

example:
define host{
        name                   url-host
        hostgroups         url-hosts
        check_period            24x7
        check_interval          5
        retry_interval          1
        max_check_attempts      3
        passive_checks_enabled  1
        active_checks_enabled   0
        notification_period     24x7
        notification_interval   60
        notification_options    d,r
        contact_groups          admins
        check_command        check-url
        register                0
        }


define command{
        command_name    check-url
        command_line    $USER1$/check_http -I $HOSTADDRESS$ $ARG1$ 
$ARG2$ $ARG3$
        }


define host{
        use             url-host
        host_name     foo.bar
        alias           just some site
        address      www.foo.bar
  }



-- 
Never,Ever Cut A Deal With a Dragon 


I am doing a Charity Bike ride On the 27 of June for the
Capital to Coast Charity. Please help by Donating
http://www.justgiving.com/Lovefilm-capital-to-coast



------------------------------------------------------------------------------

_______________________________________________
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