Page 1 of 2

checking http with UN PW

Posted: Tue Mar 22, 2016 3:34 pm
by thenomad
so we have a site the requires a un & password
the command that I am using looks like this

Code: Select all

check_http  -f ok -H mysite.net -u "/sub/login.ashx" -p 80 -a "my_monitoring:password"
I am getting a 401 access denied. I know the user and password is correct. Is the underline in the user name causing me issues ??

thanks

Re: checking http with UN PW

Posted: Tue Mar 22, 2016 3:51 pm
by rkennedy
The -a is only meant for basic auth, which is what the core interface would use (pops up asking for user/pass). I do see that your -u is a login page, are you attempting to have it full out a page and login?

I don't think the underscore is an issue -

Code: Select all

[root@suse11 libexec]# ./check_http -H 192.168.3.42 -u "/nagios/" -a "nagiosadmin:my_password"
HTTP OK: HTTP/1.1 200 OK - 1094 bytes in 0.001 second response time |time=0.000913s;;;0.000000 size=1094B;;;0

Re: checking http with UN PW

Posted: Tue Mar 22, 2016 4:03 pm
by thenomad
The page that this is trying to get a reply from is the diagnostic page of a larger app.
When that url is hit it asks for a UN and password to continue

Re: checking http with UN PW

Posted: Tue Mar 22, 2016 4:15 pm
by rkennedy
Can you show us a screenshot of the page?

Re: checking http with UN PW

Posted: Tue Mar 22, 2016 4:33 pm
by thenomad
Hang on ... One of our web guys just told me that it is not the un/pw that is failing it is the user agent - ie User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)

They will add it in the AM ...

Re: checking http with UN PW

Posted: Tue Mar 22, 2016 4:35 pm
by rkennedy
Sounds good, let us know if you need further assistance from us.

For the record, you should be able to switch the useragent with -A.
-A, --useragent=STRING
String to be sent in http header as "User Agent"

Re: checking http with UN PW

Posted: Wed Mar 23, 2016 8:43 am
by thenomad
Ok changing the agent didn't work

the url that I am trying to hit is as I say a diagnostic page that is part of an application
when the url is hit it returns a standard "authentication required" dialog
Image

When the UN/PW is authenticated a XML is returned that has "operation successful" in the first line

We have about 15 different servers that we run this against with SiteScope . I am wanting to move it to Nagios

Re: checking http with UN PW

Posted: Wed Mar 23, 2016 10:18 am
by thenomad
It is not password related. I cant authenticate from the command line of the nagios server using wget

Re: checking http with UN PW

Posted: Wed Mar 23, 2016 11:46 am
by rkennedy
Weird, it should be working as that looks to be basic auth. Can you show us the command you ran with wget to get the authentication working?

Re: checking http with UN PW

Posted: Wed Mar 23, 2016 1:45 pm
by thenomad
to be clear ... I CANNOT log in with wget or using web inject either
dont know were to go with this