Using double slashes ?

David Olbersen DOlbersen at stbernard.com
Wed Nov 12 00:19:22 CET 2003


Danny,
 
<on the fly> When in doubt, quote it out </on the fly>
 
As a general UNIX practice, I put quotes around anything I'm suspicious of causing problems like this. 99.99% of the time having quote won't break anything, but not having them is much more likely to cause problems.

  _____  

David Olbersen
iGuard Engineer
St. Bernard Software
15015 Avenue of Sciences
San Diego, CA 92127
x2152


-----Original Message-----
From: Danny Wigmans [mailto:danny.wigmans at solcorp.com]
Sent: Tuesday, November 11, 2003 2:51 PM
To: David Olbersen; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Using double slashes ?


Hi David,
 
Thanks !! It works like a charm !! Does this go for other privileged chars as well?? Might solve a lot of headaches is this is put in the documentation ?? As far as I remember, the Nagios docs mention double quotes.....
 
Danny

-----Original Message-----
From: David Olbersen [mailto:DOlbersen at stbernard.com]
Sent: Tuesday, November 11, 2003 23:49
To: Danny Wigmans; nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] Using double slashes ?


Danny,
 
Put it in single-quotes. An example from my configuration
 
command_line    $USER1$/check_http $HOSTADDRESS$ -p $ARG1$ -u 'http://www.yahoo.com' -e 'HTTP/1.0 200 OK' -w 10 -c 20


  _____  

David Olbersen
iGuard Engineer
St. Bernard Software
15015 Avenue of Sciences
San Diego, CA 92127
x2152




-----Original Message-----
From: Danny Wigmans [mailto:danny.wigmans at solcorp.com]
Sent: Tuesday, November 11, 2003 1:17 PM
To: 'nagios-users at lists.sourceforge.net'
Subject: [Nagios-users] Using double slashes ?



Hi, 

I am trying to get the check_http plug-in to work, so I can check a proxy server. 

The command I try to use is: 

./check_http -H $HOSTADDRESS$ -u http://www.yahoo.com -e HTTP/1.1 200 

Though the command works fine from the bash shell on RH 9 under the nagios user account, it doesn't work through the scripts...

When executing from the shell I get a HTTP Ok response, from the scripts it returns a HTTP CRITICAL. 

I am using nagios-1.1 and nagios-plugins-1.3.1 (check_http (1.24.2.4) from SourceForge... 

My hunch is that the // in the URL are not taken literal but are being interpreted by nagios. Anyone any ideas, or a possible workaround? I have already tried using \ as escape char, using %47%47, creating a macro in resources.cfg, double quoting the URL, and passing it from services to a $ARG1$ macro in my check_command, and combinations of these. Nothing worked so far..

Ideas anyone??? 

Thanks, 

Danny 



My files look as follows: 

checkcommands.cfg: 

define command{ 
        command_name    check_http_proxy 
        command_line    $USER1$/check_http -I $HOSTADDRESS$ -u http://www.yahoo.com -e HTTP/1.1 200 
        } 

services.cfg: 

define service { 
name                            generic-service-template 
active_checks_enabled           1       
passive_checks_enabled          1       
parallelize_check               1      
obsess_over_service             1       
check_freshness                 0       
notifications_enabled           1       
event_handler_enabled           1       
flap_detection_enabled          1      
process_perf_data               1       
retain_status_information       1       
retain_nonstatus_information    1      
max_check_attempts              3 
normal_check_interval           5 
retry_check_interval            2 
check_period                    24x7 
notification_interval           240 
notification_period             24x7 
notification_options            w,c 
register                        0 
} 

define service { 
        name                    http-proxy-template 
        service_description     HTTP Proxy 
        check_command           check_http_proxy 
        use                     generic-service-template 
        register                0 
        } 

define service { 
        hostgroup_name          proxy-srv 
        contact_groups          admin-group 
        use                     http-proxy-template 
        } 





  _____  

This e-mail message has been scanned for Viruses and Content and cleared. 
  _____  


  _____  

Teach CanIt if this mail (ID 182567) is spam:
Spam <http://mail02.stbernard.com/b.php?c=s&i=182567&m=1bf58beaf387> 
Not  <http://mail02.stbernard.com/b.php?c=n&i=182567&m=1bf58beaf387> spam
Forget  <http://mail02.stbernard.com/b.php?c=f&i=182567&m=1bf58beaf387> previous vote

  _____  

This e-mail message has been scanned for Viruses and Content and cleared. 
  _____  


  _____  

This e-mail message has been scanned for Viruses and Content and cleared. 
  _____  

  _____  

Teach CanIt if this mail (ID 182809) is spam:
Spam <http://mail02.stbernard.com/b.php?c=s&i=182809&m=e5ded3941ef0> 
Not  <http://mail02.stbernard.com/b.php?c=n&i=182809&m=e5ded3941ef0> spam
Forget  <http://mail02.stbernard.com/b.php?c=f&i=182809&m=e5ded3941ef0> previous vote

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20031111/189cba06/attachment.html>


More information about the Users mailing list