Ad Widget

Collapse

Consume Zabbix API inside 'Script' item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • victoroldani
    Junior Member
    • Jan 2023
    • 1

    #1

    Consume Zabbix API inside 'Script' item

    Hey guys.

    I'm building a template (that will be applied in hosts from group 'A') that uses an 'script' item. The JS script would need to perform an action for each host that exists in group 'B' (it's an http request).

    I can solve the problem using the parameters in the script item, manually inserting the information, but i would like to do something automatic.

    I was thinking about that Zabbix API methods, never used them a lot but i know exists something like hostgroups.get. Do you know any way to use this methods inside the script item? os any other idea how to solve this?

    Thanks.
  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    I have used Zabbix API from an auto registration script, but that script ran on the server, not the host, to update inventory information for charge back. If you're going to run this as an external script on an item, I think your script would be limited by the zabbix timeout, which might cause problems.

    Comment

    Working...