check_site with username/password

Dan Stromberg strombrg at dcs.nac.uci.edu
Fri Nov 19 19:14:20 CET 2004


On Fri, 2004-11-19 at 10:06 +0100, Andreas Ericsson wrote:
> 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.

This is pretty shell-specific.

Some shells don't require escaping of !.

Some shells will or won't require escaping of ! depending on how they
are configured.

Some shells cannot be configured to escape !.

> > 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
> > 
> > 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://www.monitoring-lists.org/archive/users/attachments/20041119/2029285c/attachment.sig>


More information about the Users mailing list