Ad Widget

Collapse

Script type item get other item values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aleksander237
    Junior Member
    • Apr 2022
    • 13

    #1

    Script type item get other item values

    Hello,

    Is it possible to use other item's values in a script item? Let's say that I would like to have an script item which uses bunch of other item's values, like (system.name, system.uptime, system.version) and create a script which uses them internally and give a result. My first attempt was to pass them as parameters:

    parameter name: systemName
    parameter value: last(//system.name)

    and use parameters in script. But this does not work.

    Any solutions?


  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    You cannot use other item values in any of item types... You can use some macros, like {HOST.NAME} for example (search for "Item key parameters" in https://www.zabbix.com/documentation...ed_by_location)

    Comment

    • aleksander237
      Junior Member
      • Apr 2022
      • 13

      #3
      Well, this is not entirely true. You can use other item values in the calculated items. So I Was thinking that you can do "the same" in the script by calling some methods from the global Zabbix JavaScript object. Something like this:

      Code:
      var lastValue = Zabbix.avg("/Zabbix Server/zabbix[wcache,values]","10m");
      It would be usefull or at least possibility to pass selected values to the script via parameters.

      Thanks, anyway.

      Comment

      Working...