Ad Widget

Collapse

HTTP agent POST request, based on another HTTP agent POST request

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Belfigor
    Member
    • Jul 2016
    • 69

    #1

    HTTP agent POST request, based on another HTTP agent POST request

    Hi! On one of services my corporation use, I have some weired API interface. To retrieve data I that need, I must do 2 steps.
    1) I need to make 1st POST request and retrieve ID of the session
    2) I need to make 2nd POST request using ID retrieved in 1s step, as parameter. After that i will reciave my data.

    Each time ID retrieved in 1st step in unique, so i cannot get ID one time and than use is all time, it changes every 10 minutes
    I have 2 HTTP agent items that perfectrly work separately. I can get session IDs, than i copypaste that ID into 2nd HTTP agent item and it perfectly fetch data based on ID that i copypaste to it.

    How i can automaticaly pass ID retrieved in step 1, as parameter to step 2 using zabbix?

    I know i can create script with 2 curl commands and everything will be OK, i allready have it. But how i can solve my problem with zabbix only?
  • oreldm
    Junior Member
    • Apr 2019
    • 6

    #2
    I have the same problem, vSphere API is working like that.

    Comment

    • Belfigor
      Member
      • Jul 2016
      • 69

      #3
      So, does any one know da way? How we can resolve our problem?

      Comment

      • wimdecorte
        Junior Member
        • May 2019
        • 6

        #4
        Looking for a way to do this with the new javascript preprocessing but I am having no luck so far. Using an HTTP Agent to make the first call and get a token, but then adding javascript preprocessing errors out at the use of XMLHttpRequest
        in the javascript.

        Comment

        • wimdecorte
          Junior Member
          • May 2019
          • 6

          #5
          I ended up going with a UserParameter and deploy a Powershell script to the Windows servers and a Python script to the macOS and Linux servers. Not ideal, I'd rather be able to do this from inside Zabbix.

          Comment

          Working...