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
Check_http with authentication failing
-
bolson
Re: Check_http with authentication failing
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!
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
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?
-
bolson
Re: Check_http with authentication failing
Check_http only supports basic authentication. This one may provide the functionality you need:
https://exchange.nagios.org/directory/P ... te/details
https://exchange.nagios.org/directory/P ... te/details
Re: Check_http with authentication failing
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.
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
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!
Thanks for all your help!
- tacolover101
- Posts: 432
- Joined: Mon Apr 10, 2017 11:55 am
Re: Check_http with authentication failing
gotta love when that's an optionmeatzie 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!
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Check_http with authentication failing
Ah, yes, default on our XI systems is to use the full "<?php" glad it is resolved.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!