Ad Widget

Collapse

Problem using last function in calculated item

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zapper
    Junior Member
    • Apr 2010
    • 11

    #1

    Problem using last function in calculated item

    Hi All,
    I have an item key which work fine. But when i try to use it as calculated item and i use the formula below it says "not supported". Is there anything wrong with the formula.

    last("myStuff["java-query:name=queryCounterBean,type=QueryCounterResou rce,attribute=queryCounter","{$My_PORT}"]")/30

    I do have a trigger for this which also works fine.

    Tailing server logs:
    error: Can not evaluate function [last(type=QueryCounterResource,attribute=queryCoun ter"])]: item [hostname:jmx["java-query:name=queryCounterBean] not found
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You might need to escape some of your quotes, or get rid of some, as it's hard to figure out what's nested and what's not right now

    try this:

    last(myStuff["java-query:name=queryCounterBean,type=QueryCounterResou rce,attribute=queryCounter","{$My_PORT}"])/30
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • Zapper
      Junior Member
      • Apr 2010
      • 11

      #3
      Thanks nelsonab for your reply. Now i am getting "error: Invalid first parameter in function"on the server log

      Comment

      • Zapper
        Junior Member
        • Apr 2010
        • 11

        #4
        It works fine now. Had to use \ in front of all the double quotes

        Comment

        Working...