Ad Widget

Collapse

Calculated items based on external checks

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BernyeCZ
    Junior Member
    • Apr 2015
    • 6

    #1

    Calculated items based on external checks

    I am working with Zabbix 3.0 LTS. I monitor specific keys (limit and used count) from API (JSON) source throught external check with *.sh script. If I make own script for each key (curl + jq) (merk_cz_exp-hits.sh, merk_cz_exp-limit.sh) and than specify new calculated item for percentual count based on used amount. Everything woks perfect.

    calculated item: 100*last(merk_cz_exp-hits.sh)/last(merk_cz_exp-limit.sh) - work perfect

    Now I try to change keys for limit and used items to use same script with parameters for jq:

    Item1:
    type: external check
    key: merk.sh["cz","details_limit"]
    information type: number (unsigned)

    Item2:
    type: external check
    key: merk.sh["cz","details_hits"]
    information type: number (unsigned)

    Item3:
    type: calculated
    formula: last(merk.sh["cz","details_hits"])/(merk.sh["cz","details_limit"])
    information type: number (float)


    Item1 and Item2 work perfect

    Item3 report me back "Not supported" (Incorrect function 'last' expression. Check expression part starting from: "details_hits").

    When I try modify Item3 to (merk.sh["cz","details_hits"])/(merk.sh["cz","details_limit"]) zabbix report me back "Not supported" (Incorrect function expression: merk.sh["cz","details_hits"])/(merk.sh["cz","details_limit"]))

    Can anyone explain me, where I make a mistake.

    Thanks
  • BernyeCZ
    Junior Member
    • Apr 2015
    • 6

    #2
    I have an answer.

    Good formula is: last("merk.sh["cz","details_hits"]")/last("merk.sh["cz","details_limitq"]")

    I forget to add \ inside (" ")

    Comment

    Working...