Ad Widget

Collapse

Web monitoring - login

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • erv
    Junior Member
    • Feb 2005
    • 19

    #1

    Web monitoring - login

    Although I have several years of experience with Zabbix, I hadn't tried Web Monitoring yet and today decided to give it a try. Initially I created a scenario for monitoring of Zabbix GUI, loosely following the manual and it all works like a charm.
    Now I want to go further and monitor Web interface of our Intranet server and it is where the fun begins.
    It is based on MS Sharepoint (IIS, that is) and user authentication is done by presenting a popup window which asks for username and password. For Windows client its just the regular login window, like one you get when you try to connect to some share over the net, etc.
    So, I am wondering if it is possible to feed the credentials to that thing somehow?
    Should be no problems when I get past this point.

    Thanks in advance,
    Ervins
  • Calimero
    Senior Member
    • Nov 2006
    • 481

    #2
    You could use a "debugging proxy" (like Fiddler) to see exactly what URLs are queried.

    AFAIK zabbix_server doesn't support cookies so an advanced scenario may bit a bit difficult to implement.

    Wish I had time to dig into the code to take advantage of libcurl's "cookie jar" option so that cookies persist over web monitoring steps and see how to patch zabbix_server.

    Comment

    • erv
      Junior Member
      • Feb 2005
      • 19

      #3
      Thanks for the suggestion! Will check if the connection can be "debugged" on the proxy server and if not will give Fiddler a try.

      Comment

      • aivarss
        Junior Member
        • Jan 2009
        • 17

        #4
        Cookies are supported

        Calimero, why you think, that zaabix doesn't support cookies?
        Info from manual:
        Scenario is set of HTTP requests (steps), which will be periodically executed by
        ZABBIX server. Normally a scenario is defined for one particular part of
        functionality of a WEB application. Scenarios are very convenient way of
        monitoring user experience.
        WEB Scenario is linked to a host application for grouping.
        WEB Scenario is periodically executed and consists of one or more Steps.
        All cookies are preserved during execution of a single scenario.

        Comment

        • Calimero
          Senior Member
          • Nov 2006
          • 481

          #5
          You're right.

          Last time I quickly browsed the source code I didn't find anything regarding cookies.

          But after a new check, there is indeed cookie support from at least version 1.4.6.

          libcurl's cookie parser is enabled (see the curl_easy_setopt call that sets CURLOPT_COOKIEFILE in src/zabbix_server/httppoller/httptest.c).

          I was probably half asleep last time I "greped" around.

          Comment

          • gdrew
            Junior Member
            • Feb 2009
            • 2

            #6
            I have about zero experience with SharePoint, but if it is using "basic" http authentication, try a url in the form of http://userw@host/whatever. This is not terribly secure, since anyone who has access to the configure pages on Zabbix can see the password in the clear, but if you create a very limited user that can just read a few test pages, you might be OK. If you go to https, the url, including the password and UID are encrypted in transit.
            --GDD

            Comment

            • erv
              Junior Member
              • Feb 2005
              • 19

              #7
              Originally posted by gdrew
              I have about zero experience with SharePoint, but if it is using "basic" http authentication, try a url in the form of http://userw@host/whatever. This is not terribly secure, since anyone who has access to the configure pages on Zabbix can see the password in the clear, but if you create a very limited user that can just read a few test pages, you might be OK. If you go to https, the url, including the password and UID are encrypted in transit.
              --GDD
              This is just to say that this method worked in my case and now I am monitoring my intranet as well, thanks

              Comment

              • lucman
                Junior Member
                • Oct 2010
                • 8

                #8
                Hi, ppl,
                I'm new in Zabbix.
                I would like to monitor a website (made in Java-ZK).
                How can i do a step that make login in a site?
                I tried follow what is writen in manual, but doest not work, I mean dont do login.
                Any help? Pls

                Comment

                • vitorfarias
                  Junior Member
                  • May 2016
                  • 2

                  #9
                  Hi all,


                  I implemented the auto login funcionality using cookies

                  First I use the API userLogin thats return the auth code, and then I set the cookie ..

                  PHP Code:

                   $api 
                  = new ZabbixApi('http://your_host/zabbix/api_jsonrpc.php');
                          
                  $user $api->userLogin(array('user' => 'USER, 'password'=> 'notSee'));
                          setcookie( "zbx_sessionid", $user, strtotime( '
                  +1 month' ), "/zabbix/" ); 
                  this works for me

                  Comment

                  Working...