Ad Widget

Collapse

How to retrieve the itemid of a web scenario to use it with history.get

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zoveress
    Junior Member
    • May 2019
    • 4

    #1

    How to retrieve the itemid of a web scenario to use it with history.get

    Is there a way to retrieve the itemid of a certain web scenario to be able to pull history using get.history API call?
    The issue is to get history for example of a response code you need to have an itemid.

    Click image for larger version

Name:	Image 1.jpg
Views:	1100
Size:	190.5 KB
ID:	410917

    If you pull data using
    httptest.get it doesn't provide the itemid. I can access the history from the GUI but I need to be able to get that data using the API.
    Any suggestions?

    Last edited by zoveress; 15-10-2020, 21:22.
  • Aravindhan
    Junior Member
    • Aug 2022
    • 1

    #2
    Get the Item IDs of Web Scenarios by using following request by adding Web Items

    {
    "jsonrpc": "2.0",
    "method": "item.get",
    "params": {
    "output": "extend",
    "hostids": "10585",
    "webitems": true,
    "sortfield": "name"
    },
    "auth": "93216dc4bffd00d6d2af1ddaa909d0bf8b0e8ac22b50e eb62 6bfd05d3c9c3b3d",
    "id": 1
    }​

    Comment

    • likvi
      Junior Member
      • Apr 2022
      • 2

      #3
      I have the same problem. I'm even not enable to get data from computed item! Only data I can get are from "Failed step of scenario xxx".
      Here is a code I'am using. Please can anyone help?

      $params = array(
      'itemids' => array('61730'),
      'sortfield' => array('clock'),
      'sortorder' => array('DESC'),
      'limit' => 10
      );


      $result = $zbx->call('history.get',$params);​

      Comment

      Working...