I have a web site that I would like to verify is up and it uses basic authentication, and I can get in with any browser. The server is IIS and it hosts three sites with subdomains and HTTP->HTTPS upgrades. site1.example.com, site2.example.com etc.
I have many other web scenarios but this is the first one I've attempted with basic authentication so I set it up like any other site plus the basic authentication. The details come back:
Looking deeper I don't think this is a Zabbix failure because when I go to CLI on that server and attempt a curl with user/password I get similar error;
Things get more interesting if I use wget, it works after a couple 401's and pulls down the file I wanted successfully (valid content);
So is there something I can do in Zabbix to make it behave more like wget instead of curl? If you have a clue on what I need to change on the IIS server also let me know.
I have many other web scenarios but this is the first one I've attempted with basic authentication so I set it up like any other site plus the basic authentication. The details come back:
response code; 401 (unauthorized) Status; Error: required pattern "information" was not found on https://site.example.com
curl https://myuser:[email protected]/index.html
~
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
~
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
myuser@ubnt20-04-zbxv5:~$ wget --http-user=myuser --http-password=mypassword https://site.example.com/staging.html
--2021-09-29 07:54:03-- https://site.example.com/staging.html
Resolving site.example.com (site.example.com)... 100.18.169.148
Connecting to site.example.com (site.example.com)|100.18.169.148|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: NTLM
Reusing existing connection to site.example.com:443.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: NTLM TlRMTVNTUAACAAAABQAFADgAAAA~~~~~~~wAbwBjAGEAbAAHAA gArOzURSi11wEAAAAA
Reusing existing connection to site.example.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 3679 (3.6K) [text/html]
Saving to: ‘staging.html’
staging.html 100%[================================================== ================================================== ================================================== ==============================================>] 3.59K --.-KB/s in 0s
2021-09-29 07:54:03 (1.04 GB/s) - ‘staging.html’ saved [3679/3679]
--2021-09-29 07:54:03-- https://site.example.com/staging.html
Resolving site.example.com (site.example.com)... 100.18.169.148
Connecting to site.example.com (site.example.com)|100.18.169.148|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: NTLM
Reusing existing connection to site.example.com:443.
HTTP request sent, awaiting response... 401 Unauthorized
Authentication selected: NTLM TlRMTVNTUAACAAAABQAFADgAAAA~~~~~~~wAbwBjAGEAbAAHAA gArOzURSi11wEAAAAA
Reusing existing connection to site.example.com:443.
HTTP request sent, awaiting response... 200 OK
Length: 3679 (3.6K) [text/html]
Saving to: ‘staging.html’
staging.html 100%[================================================== ================================================== ================================================== ==============================================>] 3.59K --.-KB/s in 0s
2021-09-29 07:54:03 (1.04 GB/s) - ‘staging.html’ saved [3679/3679]
Comment