check_site with username/password

Andreas Ericsson ae at op5.se
Fri Nov 19 10:06:12 CET 2004


joost at informatiefabriek.nl wrote:
> check_http_auth!www.site.nll!/page/to/check!username:password\!
> 
> gives
> 
> CRITICAL 11-19-2004 09:54:22 0d 0h 3m 7s 4/4 (No output!) 
> 

Sorry. shell considers ! to be a control char (sort of). You'll need to 
triple-escape it, as such;
username:password\\\!
The first \ is to escape the second \, which gets executed along with 
the command and effectively escapes it for the shell. The third \ is to 
escape the ! to nagios, so it doesn't break it up.

> grtz.
> 
> joost
> 
> 
> 
> 
> Andreas Ericsson <ae at op5.se> 
> Sent by: nagios-users-admin at lists.sourceforge.net
> 19-11-2004 09:43
> 
> To
> nagios-users at lists.sourceforge.net
> cc
> 
> Subject
> Re: [Nagios-users] check_site with username/password
> 
> 
> 
> 
> 
> 
> joost at informatiefabriek.nl wrote:
> 
>>Hi,
>>
>>I tried to use the following check_command. 
>>
>>check_command 
>>check_http_auth!www.site.nll!/page/to/check!username:password!
>>
>>This command checks of a page with username/password is alive. The 
> 
> problem 
> 
>>is that my password ends with a !-character (password = " password!"). 
> 
> In 
> 
>>he syntax of check_commands this is a seperator of a variable. Is there 
> 
> a 
> 
>>way to use the !-character. Because nagios gives this result:
>>
>>HTTP WARNING: HTTP/1.1 401 Unauthorized 
>>
> 
> 
> Escape the last ! as such
> username:password\!
> 
> 
>>Thx in advance..
>>
>>grtz.
>>Joost
>>
>>http://www.informatiefabriek.nl
> 
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
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