Special characters in services.cfg file

Patrick Morris patrick.morris at hp.com
Wed Apr 23 23:38:23 CEST 2008


On Wed, 23 Apr 2008, Chris Dos wrote:

> I'm having problem getting a command to run in services.cfg file when it works fine from the command line.
> 
> >From the command line:
> /usr/lib/nagios/plugins/check_http -H 10.20.40.41 -w 2 -c 5 -t 10 -u
> http://cleopatra/userservice/signup/getstates.flx -T 'text/xml' -P '<request foruser="1" forgroup="1"
> fordomain="1" basedomain="1" cultureinfo="en-US" coreproductid="1" products="" systemtypeid="1"
> timezoneinfo="1|Mountain Standard Time (US & Canada & Mexico)|MST|Mountain Daylight
> Time|-7|0|1|0|3|0|1|2|0|11|0|0|2|0"> <getStates countryid="1" /> </request>' -s 'Colorado'
> 
> results in:
> HTTP OK HTTP/1.1 200 OK - 0.004 second response time
> 
> Putting in services.cfg:
> define service{
>         use                             generic-service         ; Name of service template to use
>         host_name                       Cleopatra
>         service_description             HTTP_Post_States
>         is_volatile                     0
>         check_period                    24x7
>         max_check_attempts              3
>         normal_check_interval           1
>         retry_check_interval            1
>         contact_groups                  Admins_E-mails,Admins_Pagers
>         notification_interval           30
>         notification_period             24x7
>         notification_options            w,u,c,r
>         check_command                   check_http!-w 2 -c 5 -t 10 -u
> http://cleopatra/userservice/signup/getstates.flx -T 'text/xml' -P '<request foruser="1" forgroup="1"
> fordomain="1" basedomain="1" cultureinfo="en-US" coreproductid="1" products="" systemtypeid="1"
> timezoneinfo="1|Mountain Standard Time (US & Canada & Mexico)|MST|Mountain Daylight
> Time|-7|0|1|0|3|0|1|2|0|11|0|0|2|0"> <getStates countryid="1" /> </request>'
>         }

Wow. That may be the ugliest check command I've ever seen. :)

What's your definition for the check_http check command look like?

I'd normally suggest you set up a specialized check command for this
rather than to try to pass all those parameters in the service
definition, but that's up to you.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
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