Ad Widget

Collapse

API get trigger. What's in the expression?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jefftang
    Junior Member
    • Apr 2010
    • 6

    #1

    API get trigger. What's in the expression?

    What I do a trigger.get through the api, the expressions that come back look like:

    {26009}>0

    instead of

    {hostname:mykey.last{0}}>0


    it does not seem to correspond to an itemid. What is that number? And how do I get an expanded expression. I'd rather modify the api call to have it expand it, but I'll look it up if I have to.
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    Originally posted by jefftang
    {26009}>0
    That is a reference to the function table. When the Zabbix server comes across that item it will reference the function table looking for function 26009, and it's last value, which is then substituted in and the statement is evaluated.

    Have you tried adding the parameter "select_fuctions":"extend" or "refer" to your query? Looking at the docs this might give you what you are looking for. Otherwise there does not look to be a way to do this right now with the API.
    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

    • jefftang
      Junior Member
      • Apr 2010
      • 6

      #3
      Originally posted by nelsonab
      That is a reference to the function table. When the Zabbix server comes across that item it will reference the function table looking for function 26009, and it's last value, which is then substituted in and the statement is evaluated.

      Have you tried adding the parameter "select_fuctions":"extend" or "refer" to your query? Looking at the docs this might give you what you are looking for. Otherwise there does not look to be a way to do this right now with the API.
      Thanks for the pointer. select_functions and select_items really give me what I want, which is the itemids associated with the triggers.

      Comment

      • nelsonab
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2006
        • 1233

        #4
        Cool, glad to know it worked.
        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

        Working...