Nagios HTTP monitoring

Jerad Riggin jriggin at gmail.com
Mon Jun 25 16:05:28 CEST 2007


Any idea why this -a switch isn't working?

If I do this in a command prompt it works fine: ./check_http -S -H
url.com-a username:password it returns an OK.

The same command in nagios won't work (unauthorized).


On 6/22/07, Jerad Riggin <jriggin at gmail.com> wrote:
>
> It's still giving me an unauthorized message.  I've verified the
> credentials work for me to get in through a browser.  Is there something
> else I could be missing?
>
> On 6/22/07, GJP <gjp at gpnet.nl> wrote:
> >
> > Jerad,
> >
> > No entirely, because you feed the arguments to the actual command with
> > $ARGn$
> >
> > So in de service definition:
> >
> > check_http!site.com!5!admin:password
> >
> > And the command_line format in command definition (probably
> > in: /etc/nagios-plugins/config/http.cfg) should be:
> >
> > command_line    /usr/lib/nagios/plugins/check_http -H $ARG1$ -t $ARG2$
> > -a
> > $ARG3$
> >
> > Be carefull with that "-t 5" btw. That is a very low value to timeout.
> >
> > Hope it helps.
> >
> > Regards,
> >
> > Gerard.
> >
> > On Friday 22 June 2007 19:17:29 Jerad Riggin wrote:
> > > So check_http!-H site.com -t 5 -a admin:password
> > >
> > > should be
> > >
> > > check_http!-H site.com!-t 5!-a admin:password?
> > >
> > > On 6/22/07, GJP <gjp at gpnet.nl > wrote:
> > > > Jerad,
> > > >
> > > > I didn't understand that either. That's why I customized the the
> > > > check_http
> > > > command definition. That way (in my previous example) you can have
> > your
> > > > http
> > > > checks from any Nagios client. Usefull for instance for  off-site
> > checks.
> > > >
> > > > Regarding the -a switch. The -a $ARG1$ (or whatever) should be in
> > your
> > > > command
> > > > definition. And your parms as you 'feed' them to the command in your
> > > > service
> > > > definition seperated with "!".
> > > >
> > > > Regards,
> > > >
> > > > Gerard.
> > > >
> > > > On Friday 22 June 2007 16:59:30 Jerad Riggin wrote:
> > > > > If I change the hosts.cfg from the IP of the server (10.10.10.7)
> > to the
> > > >
> > > > URL
> > > >
> > > > > I'm specifying in services.cfg, it works fine.  The default site
> > for
> > > > > 10.10.10.7 is a CRM site which requires basic auth.  So even
> > though i'm
> > > > > specifying a URL in services.cfg, it looks like it's be overridden
> > by
> > > >
> > > > the
> > > >
> > > > > hosts.cfg so it can't auth.  What is the point of the -H switch in
> >
> > > > > services.cfg if it always uses the IP for the host in hosts.cfg
> > ?  I
> > > >
> > > > tried
> > > >
> > > > > that format (-a admin:password) at the end of the check in
> > > > > services.cfgbut it still failed with unauthorized.
> > > > >
> > > > > On 6/22/07, Marc Powell <marc at ena.com> wrote:
> > > > > > > -----Original Message-----
> > > > > > > From: nagios-users-bounces at lists.sourceforge.net [mailto:
> > > >
> > > > nagios-users-
> > > >
> > > > > > > bounces at lists.sourceforge.net] On Behalf Of Jerad Riggin
> > > > > > > Sent: Friday, June 22, 2007 8:41 AM
> > > > > > > To: GJP
> > > > > > > Cc: nagios-users at lists.sourceforge.net
> > > > > > > Subject: Re: [Nagios-users] Nagios HTTP monitoring
> > > > > > >
> > > > > > > I have a check_http command that works perfectly at the
> > command
> > > >
> > > > prompt
> > > >
> > > > > > > ./check_http -H lagarde -t 5 -s "LaGarde Intranet site"
> > > > > > >
> > > > > > > However in nagios, check_http!-H lagarde -t 5 -s "LaGarde
> > Intranet
> > > > > >
> > > > > > site"
> > > > > >
> > > > > > > still returns an unauthorized.  So basically why would it work
> > in a
> > > > > > > command prompt but not in nagios?
> > > > > >
> > > > > > Perhaps some difference in environment? Did you test as the
> > nagios
> > > >
> > > > user?
> > > >
> > > > > > Is that the _exact_ way it's defined in the config?
> > > > > >
> > > > > > > And what is the syntax for the -a
> > > > > > > (basic auth) switch?  Thanks again for everyones help.
> > > > > >
> > > > > > -a username:password.
> > > > > >
> > > > > > --
> > > > > > Marc
> > > >
> > > >
> > -------------------------------------------------------------------------
> > > >
> > > > > > This SF.net email is sponsored by DB2 Express
> > > > > > Download DB2 Express C - the FREE version of DB2 express and
> > take
> > > > > > control of your XML. No limits. Just data. Click to get it now.
> > > > > > http://sourceforge.net/powerbar/db2/
> > > > > > _______________________________________________
> > > > > > 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
> >
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070625/c1e71489/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
-------------- next part --------------
_______________________________________________
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