Page 1 of 1

Check_http with authentication failing

Posted: Fri Sep 01, 2017 7:03 am
by meatzie
Hello,

I've got an old AudioCode box that I'd like to get proper http monitoring on through Nagio but I'm running into one hell of a time getting the basic authentication to work. The username and password are correct and I'm pretty positive from the response that this server is using basic auth. I'm not familiar with the inner workings of RomPager webservers though. I'd appreciate any help in getting this functional. Here is the check and its verbose results:

[[email protected] ~]$ /usr/local/nagios/libexec/check_http -v -H 192.168.10.123 -a User:User
GET / HTTP/1.1
User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)
Connection: close
Host: 192.168.10.123
Accept: */*
Authorization: Basic VXNlcjpVc2Vy


http://192.168.10.123:80/ is 539 characters
STATUS: HTTP/1.1 401 Unauthorized
**** HEADER ****
WWW-Authenticate: Digest realm="Realm1", nonce="2763da3aa78d8c65faa3ae450d5249bc", qop=auth
Content-Type: text/html
Transfer-Encoding: chunked
Server: Allegro-Software-RomPager/3.10
Connection: close
**** CONTENT ****
125
<HTML>
<HEAD>
<TITLE>Protected Object</TITLE>
</HEAD>
<BODY>
<H1>Unauthorized</H1>
Correct authorization is required for this area. Either your browser does not perform authorization, or your authorization has failed. RomPager server.<P>
Return to <A HREF="">last page</A><P>

</BODY>
</HTML>

0


HTTP WARNING: HTTP/1.1 401 Unauthorized - 539 bytes in 0.085 second response time |time=0.085088s;;;0.000000 size=539B;;;0

Re: Check_http with authentication failing

Posted: Fri Sep 01, 2017 10:56 am
by bolson
Please place the output of the following commands run on 192.168.10.123 in a Code block:

cat /etc/httpd/conf/httpd.conf
tail -100 /var/log/messages
tail -40 /var/log/httpd/access_log
tail -40 /var/log/httpd/error_log

Thank you!

Re: Check_http with authentication failing

Posted: Fri Sep 01, 2017 1:34 pm
by meatzie
I'm still looking for a way to access those logs, but I think I noticed something in my first post. It looks like the server is responding asking for Digest Authentication instead of Basic. Does the native check_http plugin support digest authentication at all?

Re: Check_http with authentication failing

Posted: Fri Sep 01, 2017 2:33 pm
by bolson
Check_http only supports basic authentication. This one may provide the functionality you need:

https://exchange.nagios.org/directory/P ... te/details

Re: Check_http with authentication failing

Posted: Wed Sep 06, 2017 8:05 am
by meatzie
Thanks,

I had actually found that one and was trying to get it to work but for some reason all I can get it to do is write the content of the script to the console, not actually run.

Re: Check_http with authentication failing

Posted: Wed Sep 06, 2017 8:25 am
by meatzie
Looks like I solved that bit myself. That script uses a short open tag ("<?" instead of "<?php") which can be made to work if you enable short tags. However they are depreciated so I just modified the script. This is working fine for me now and the check does what I need.

Thanks for all your help!

Re: Check_http with authentication failing

Posted: Wed Sep 06, 2017 8:50 am
by tacolover101
meatzie wrote:Looks like I solved that bit myself. That script uses a short open tag ("<?" instead of "<?php") which can be made to work if you enable short tags. However they are depreciated so I just modified the script. This is working fine for me now and the check does what I need.

Thanks for all your help!
gotta love when that's an option :D

Re: Check_http with authentication failing

Posted: Wed Sep 06, 2017 8:52 am
by scottwilkerson
meatzie wrote:Looks like I solved that bit myself. That script uses a short open tag ("<?" instead of "<?php") which can be made to work if you enable short tags. However they are depreciated so I just modified the script. This is working fine for me now and the check does what I need.

Thanks for all your help!
Ah, yes, default on our XI systems is to use the full "<?php" glad it is resolved.