checking http with UN PW

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

checking http with UN PW

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: checking http with UN PW

Post 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
Former Nagios Employee
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: checking http with UN PW

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: checking http with UN PW

Post by rkennedy »

Can you show us a screenshot of the page?
Former Nagios Employee
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: checking http with UN PW

Post 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 ...
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: checking http with UN PW

Post 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"
Former Nagios Employee
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: checking http with UN PW

Post 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
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: checking http with UN PW

Post by thenomad »

It is not password related. I cant authenticate from the command line of the nagios server using wget
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: checking http with UN PW

Post 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?
Former Nagios Employee
thenomad
Posts: 35
Joined: Thu Mar 03, 2016 10:55 am

Re: checking http with UN PW

Post by thenomad »

to be clear ... I CANNOT log in with wget or using web inject either
dont know were to go with this
Locked