Page 1 of 1

HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Fri Jun 30, 2017 8:02 am
by sgoffar
Hi Team,

We are trying to add http://peoplefinder into monitoring with below details. But we are getting error HTTP WARNING: HTTP/1.1 401 Unauthorized - 1908 bytes in 0.007 second response time
However with the given credentials we are able to login without any issue. Please help on this.

Command:
$USER1$/check_http -H $HOSTADDRESS$ $ARG1$
$ARG1$:
-f ok -I 172.26.x.x -u "/" -p 80 -a "username:password"

FYI: we are using Nagios Xi 5.4.2 version

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Fri Jun 30, 2017 8:09 am
by eloyd
Can you try clicking the "Run Check Command" and pasting the resulting command line here? You can obfuscate username, password, and IP address if you'd like, but leave all other formatting, please.

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Fri Jun 30, 2017 9:07 am
by cdienger
Also, do you know if the site is requiring basic or ntlm auth? check_http only does basic but https://exchange.nagios.org/directory/P ... lm/details does ntml and may help in this situation.

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Tue Jul 04, 2017 9:07 am
by sgoffar
Please find below the input on running from check command:

/usr/local/nagios/libexec/check_http -H peoplefinder -f ok -I 172.X.X.X -u "/" -p 80 -a "levi\XXXX:XXXX" HTTP WARNING: HTTP/1.1 401 Unauthorized - 1908 bytes in 0.008 second response time |time=0.007510s;;;0.000000 size=1908B;;;0.

Output on curl:

####====>>> curl -s -S --ntlm -D /tmp/curlTest -u levi\xxxx:xxxx http://peoplefinder

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>You are not authorized to view this page</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">
BODY { font: 8pt/12pt verdana }
H1 { font: 13pt/15pt verdana }
H2 { font: 8pt/12pt verdana }
A:link { color: red }
A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0 cellspacing=10><TR><TD>

<h1>You are not authorized to view this page</h1>
You do not have permission to view this directory or page using the credentials that you supplied.
<hr>
<p>Please try the following:</p>
<ul>
<li>Contact the Web site administrator if you believe you should be able to view this directory or page.</li>
<li>Click the <a href="javascript:location.reload()">Refresh</a> button to try again with different credentials.</li>
</ul>
<h2>HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.<br>Internet Information Services (IIS)</h2>
<hr>
<p>Technical Information (for support personnel)</p>
<ul>
<li>Go to <a href="http://go.microsoft.com/fwlink/?linkid=8180">Microsoft Product Support Services</a> and perform a title search for the words <b>HTTP</b> and <b>401</b>.</li>
<li>Open <b>IIS Help</b>, which is accessible in IIS Manager (inetmgr),
and search for topics titled <b>Authentication</b>, <b>Access Control</b>, and <b>About Custom Error Messages</b>.</li>
</ul>

</TD></TR></TABLE></BODY></HTML>

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Wed Jul 05, 2017 10:44 am
by cdienger
As the message points out a 401 means the site requires authentication. Before going down one path too far, we should confirm what type of authentication it requires and that information is something the site admins should be able to provide.

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Thu Jul 06, 2017 8:48 am
by sgoffar
Thanks for your reply.

you want the information ..Type of authentication means NTLM or not ??

Re: HTTP WARNING: HTTP/1.1 401 Unauthorized error

Posted: Thu Jul 06, 2017 11:36 am
by cdienger
Correct, is it NTLM, Basic, Kerberos, something else? The site is rejecting the connection due to authentication failure. We need to know what the site expects.