Ad Widget

Collapse

Web Scenario Reponse Time API?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wesley
    Junior Member
    • Jan 2014
    • 3

    #1

    Web Scenario Reponse Time API?

    I'm trying to grab the response time of a web scenario with an API call. I found this topic which suggested to use history.get: https://www.zabbix.com/forum/showthread.php?t=40684

    Here's a screenshot of what the data looks like in the Zabbix control panel:


    Here's the parameters in my history.get call:
    Code:
            'limit' => 1000,
            'sortfield' => 'clock',
            'sortorder' => 'DESC',
    And here are the only results with the time '17:58:29':
    Code:
    itemid:23692 clock:Tue, 14 Jan 2014 17:58:29 +0000 value:0 ns:533846034
    itemid:23696 clock:Tue, 14 Jan 2014 17:58:29 +0000 value:200 ns:533418879
    itemid:23309 clock:Tue, 14 Jan 2014 17:58:29 +0000 value:0 ns:738818601
    Can someone help me with the history.get results? I don't know how to get the response time of '7s 81.8ms' as shown in the control panel screenshot.
  • EnigmA-X
    Senior Member
    Zabbix Certified Specialist
    • Oct 2010
    • 116

    #2
    What version of Zabbix are you using?

    If it's >=2.0, please check: https://www.zabbix.com/documentation...i/webcheck/get

    Comment

    • Wesley
      Junior Member
      • Jan 2014
      • 3

      #3
      Originally posted by EnigmA-X
      What version of Zabbix are you using?

      If it's >=2.0, please check: https://www.zabbix.com/documentation...i/webcheck/get
      I'm using version 2.2.

      Thanks but I saw webcheck.get already from the thread that I linked to. Doesn't that command only show the configuration of a web monitoring scenario, not the latest values?

      Comment

      • EnigmA-X
        Senior Member
        Zabbix Certified Specialist
        • Oct 2010
        • 116

        #4
        Ok, I misunderstood your question.

        I guess the reason you only get 3 items as query output, is that you don't select a history 'type' in your query. The default for this is 'integer' whereas the information you are looking for might not be saved as an integer value.

        Please have a close look at the top-section in the table on this page:


        I'm not using webscenarios myself, but I would definitly try to use type 1,2 and 4 to see if that might return the wanted values.

        Please share if this works for you.

        Comment

        • Wesley
          Junior Member
          • Jan 2014
          • 3

          #5
          Thanks EnigmA-X!

          I changed the history type to 0 (float), and it displayed the data I was looking for!

          Here's my new parameters:
          Code:
              	'itemids' => '23713',
                  'limit' => 100,
                  'sortfield' => 'clock',
                  'sortorder' => 'DESC',
                  'history' => 0,
          Response sample:
          Code:
          stdClass Object
          (
              [itemid] => 23713
              [clock] => 1389902041
              [value] => 9.9895
              [ns] => 152484298
          )
          The "itemid" is the web scenario step that I want to see data for. The "value" is the number of seconds it took to load the web page in that web scenario.

          Comment

          Working...