Ad Widget

Collapse

Setup Zabbix 2.0 check for Website with Apache Digest authentication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Glukich
    Junior Member
    • Apr 2011
    • 3

    #1

    Setup Zabbix 2.0 check for Website with Apache Digest authentication

    Is there way to setup Web monitoring for web site protected with Apache Digest Authentication?
    I can get normal response from such a site using any browser through http://'user':'pass'@site.com/index or doing the same with curl:

    curl -I --digest http://'user':'pass'@site.com/index
    HTTP/1.1 401 Authorization Required
    Date: Tue, 24 Dec 2013 14:26:37 GMT
    Server: Apache
    WWW-Authenticate: Digest realm="Realm", nonce="nT44iEjuBAA=5b87dc167dce728dcdab948fafbc7b3 826e2c1a2", algorithm=MD5, domain="/", qop="auth"
    Vary: Accept-Encoding
    Content-Type: text/html; charset=iso-8859-1

    HTTP/1.1 200 OK
    Date: Tue, 24 Dec 2013 14:26:37 GMT
    Server: Apache
    Authentication-Info: rspauth="8f74d38ed4d4ccd245a1be7764ba5847", cnonce="MTcwNzI0", nc=00000001, qop=auth
    X-Powered-By: PHP/5.2.6-1+lenny9
    Vary: Accept-Encoding
    Content-Type: text/html

    If I will remove "-I" from curl command above, I will get full contents of the "index" page I had requested.

    Unfortunately, when I set Web check using the same URL request I get to the first 401 response and seems to not be able pass authentication.
    I do not get final 200 response on the first request as it shown on second part of curl output.
    Neither does any consequent request in step 2 which, if auth would be passed in step 1, was supposed to get status code 200 and allow check "index" page contents.
    So the step 2 to the same URL gets the same 401 response.
    Am I missing something?

    Or maybe there is other way to verify that page contents by Zabbix?
    Last edited by Glukich; 25-12-2013, 12:38.
  • Glukich
    Junior Member
    • Apr 2011
    • 3

    #2
    Still need a solution for it

    No responces at all???
    No one from big Zabbix guru's has an idea how to setup properly Zabbix check for Web Page with Apache Digest authentication???
    Or this is totally unsupported?

    Just some details about my Zabbix install in case someone will try to read it maybe come up with some advice or solution:
    Zabbix Version 2.0.1
    Both, server and monitored host are Debian Wheezy boxes with Apache 2.2.9 on the host with a digest authentication.
    Last edited by Glukich; 07-01-2014, 12:41. Reason: Added details

    Comment

    • jan.garaj
      Senior Member
      Zabbix Certified Specialist
      • Jan 2010
      • 506

      #3
      Unfortunately, digest authentication is not supported by Zabbix (checked in current trunk version of Zabbix 2.2):
      Code:
      httptest.c:			
      switch (httptest->httptest.authentication)
      {
      	case HTTPTEST_AUTH_BASIC:
      		curlauth = CURLAUTH_BASIC;
      		break;
      	case HTTPTEST_AUTH_NTLM:
      		curlauth = CURLAUTH_NTLM;
      		break;
      	default:
      		THIS_SHOULD_NEVER_HAPPEN;
      		break;
      }
      Curl supports these authentications: CURLAUTH_BASIC, CURLAUTH_DIGEST, CURLAUTH_GSSNEGOTIATE, CURLAUTH_NTLM, but only CURLAUTH_BASIC and CURLAUTH_NTLM authentications are supported by Zabbix.

      You can vote for this feature ZBXNEXT-1778

      Solution:
      You can edit/compile source code of Zabbix (systemless solution) or
      you can create custom script with "curl -I --digest http://'user':'pass'@site.com" and then you will parse output from your script to Zabbix (standard workaround for this case :-)).

      Conclusion: Zabbix in any version can't handle digest authentication at the moment.
      Devops Monitoring Expert advice: Dockerize/automate/monitor all the things.
      My DevOps stack: Docker / Kubernetes / Mesos / ECS / Terraform / Elasticsearch / Zabbix / Grafana / Puppet / Ansible / Vagrant

      Comment

      Working...