0

I have multiple Zabbix agents (Windows agent) and I need to check software license's details on each agent via a localhost JSON URL.

On each agent we can see license information on local web URL like this http://localhost/license/GetAllActiveLicenses And this URL shows details in JSON format like this:

{"GetAllActiveLicenseResult":
    {"Licenses":[
        {"LicenseName":"ImageServer","Enabled":true,"Remaining":"383 Day","StringExpireDate":"27-4-2020 00:00:00"},
        {"LicenseName":"WebReview","Enabled":true,"Remaining":"383 Day","StringExpireDate":"27-4-2020 00:00:00"},
        {"LicenseName":"Portal","Enabled":true,"Remaining":"774 Day","StringExpireDate":"23-5-2021 00:00:00"}
    ]}
}

I need to create a discovery rule to read each license field.

Kredns
  • 496
  • 1
  • 8
  • 15
Abbas.Kh
  • 11
  • 1
  • Is this an actual output of the service? It's not valid JSON. – Lenniey Apr 09 '19 at 07:18
  • 1
    anyway this is my url output. are you have any recommendation ? – Abbas.Kh Apr 09 '19 at 07:33
  • You don't state what's not working. I won't write the zabbix template/item for you, just wanted to point out that your posted information is no valid JSON array, so that might cause some trouble. – Lenniey Apr 09 '19 at 07:37
  • 1
    Maybe i can generate vali json data, But i need help to create discovery rule for this. Can you help me about this ? – Abbas.Kh Apr 09 '19 at 07:51
  • Looks like the only thing messing up the JSON is the missing doublequote before the second "Remaining". – Richlv Apr 09 '19 at 08:39

1 Answers1

0

This site is not geared towards writing solutions for you, but we can look at the possible approaches to solve this.

  • If you have Zabbix 4.2 or later, you can use pre-processing in LLD rules to turn this JSON into a Zabbix LLD JSON (after ensuring it is a valid JSON, see comments on the question).
  • If you have an older version, you might need a script to perform that conversion.
Richlv
  • 2,334
  • 1
  • 13
  • 17