Ad Widget

Collapse

Zabbix API calls automated.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JulianC
    Junior Member
    • Feb 2024
    • 4

    #1

    Zabbix API calls automated.

    Hey all,

    I could use insights on this situation.

    We have an device management system which has API functionality.

    We can call each device by f.e. https://server:xxx/(serialnumber_of_device) via this api call we can receive information about the state of the device. I woudl like to monitor this. However the problem that I think I am facing is that I need to manually create the hosts for every device. (it will contain around 22.000 devices).

    This means I need to make hosts as follows:
    https://server:xxx/(00001)
    https://server:xxx/(00002)
    https://server:xxx/(00003)
    etc...


    Is there a way I can automate this part in Zabbix without needing to manual create these hosts?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Answer is in your topic subject.. Create those over the Zabbix API ... https://www.zabbix.com/documentation...ce/host/create
    A little loop that counts to 22k ... And if you are already there, then add your template(s) to host during creation also...​

    Comment

    • yau
      Junior Member
      • Dec 2023
      • 16

      #3
      Not much beef... so a generic answer:
      In most cases it is possible. E.g. you convert your list into a JSON (or a CSV). Then you create a new 1st template with a discovery rule for host creation. The host creation is done out of the JSON. Next you create a 2nd template for measuring the host items. The 2nd template is used in the discovery rule of template 1.

      Comment

      Working...