Ad Widget

Collapse

Calculated formula doesn't accept perf_counter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kaimor777
    Junior Member
    • Oct 2020
    • 2

    #1

    Calculated formula doesn't accept perf_counter

    Hi,
    I'm trying to create a calculated item based on the performance counter.
    I tried to use this formula

    last("perf_counter["\Process(w3wp#4)\% Processor Time",10]")/last(system.cpu.num)

    But received an error

    Cannot evaluate function "last()": item "MNN FR: perf_counter["\Process(w3wp#4)\% Processor Time",10]" does not exist.

    I tried another syntax:
    last("perf_counter[\Process(w3wp#4)\% Processor Time,10]")/last(system.cpu.num)
    With same result.

    I saw pretty same problem from 2010 at this topic https://www.zabbix.com/forum/zabbix-...-perf_counterf
    but the solution used there didn't work for me neither.

    Any help will be appreciated.
  • Hamardaban
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • May 2019
    • 2713

    #2
    Use the exactly the same key in the expression as in the item. Escape inner quotes using \.

    Comment

    • Kaimor777
      Junior Member
      • Oct 2020
      • 2

      #3
      Which quotes are inner? Those before perf_counter and after ] also counts as inner?

      Comment


      • Hamardaban
        Hamardaban commented
        Editing a comment
        Inner (internal) - this is part of the key
    • Nariman_tj
      Junior Member
      • Jan 2021
      • 4

      #4
      Kaimor777

      as Hamardaban said, you should remove " in the parts which have been not include in your key

      for instance you have an item like: grpsum["sherab","xc1",last]

      you must make a formula that contain
      2*last("grpsum["sherab","xc1",last]") and as you see the parts that have not containted quotation before calculated item would have not contain any quotation after using calculated items.


      as an other example i can say if you want to add these two items : net.if.out["ens160"] +net.if.in["ens160"]


      for last("net.if.out["ens160"]")+last(net.if.in["ens160"]")
      Last edited by Nariman_tj; 06-03-2022, 07:47.

      Comment

      Working...