The web site doesn´t take the credencials

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

The web site doesn´t take the credencials

Post by jguzzetti »

Hi there! I´m trying to check the state of a internal web site in our company. The site needs to be authenticated by username and password but it doesn't have a login screen, it takes the credencials from the session of the user that is authenticated against the local pc or the browser, i´m not sure. When i passed my credencials by the param -a username:password the site doesn't take them as is expected. It allways return 401 (Not Authorized). The question is: is there a chance to pass the credencial like a cookie session? Or what is the way to authenticate against a site with this carateristic?
I´m using the plugin check_http

Thanks in advance.
Best regards!
You do not have the required permissions to view the files attached to this post.
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: The web site doesn´t take the credencials

Post by cdienger »

The site looks to be expecting NTLM authentication and the plugin is using basic. Try using:

https://exchange.nagios.org/directory/P ... lm/details
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: The web site doesn´t take the credencials

Post by jguzzetti »

All rigth, now I could authenticate against the site, but I don´t get the HTTP STATUS CODE, wich ir required by Opers to get them known if the site is running ok or not. Is there a way to authenticate with this protocal but get the status code too?
Output:
|ntlm=0;1;0;0OK
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: The web site doesn´t take the credencials

Post by ssax »

Please see here:

https://support.nagios.com/forum/viewto ... 07#p229207
-- Let us know if you have trouble viewing it

Use the plugin attached though.

Let us know if you have any questions.
You do not have the required permissions to view the files attached to this post.
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: The web site doesn´t take the credencials

Post by jguzzetti »

OK, i can authenticate now against the site but i¿m steel not getting the HTTP STATUS CODE wich is required to be sure about the page's health.
Attached the command and the output. I don't see an option at the plugin to get the status code, i search for it by passing the search string with -s argument.
You do not have the required permissions to view the files attached to this post.
User avatar
mbellerue
Posts: 1403
Joined: Fri Jul 12, 2019 11:10 am

Re: The web site doesn´t take the credencials

Post by mbellerue »

The best way to get the status code from the page is by using the -s argument the way that you used it. There isn't a specific flag for grabbing the status code. Will -s not work for your purposes?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
jguzzetti
Posts: 17
Joined: Wed Mar 13, 2019 9:09 am

Re: The web site doesn´t take the credencials

Post by jguzzetti »

Thanks a million! I could get the search string 'HTTP/1.1 200' and with this plugin I can authenticate at the site.
You can close this issue, very appreciate your help.
Locked