Ad Widget

Collapse

API: how to get a trigger based on the expanded expression?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mojah
    Member
    • Apr 2010
    • 60

    #1

    API: how to get a trigger based on the expanded expression?

    Hi,

    I'm using a query like this (simplified by zabbixapi in ruby):

    Code:
    result = zbx.client.api_request(
          :method => "trigger.get",
          :params => {
            :filter => {
              :expression => "{13360}#0.2"
            },
            :output => "extend",
            :expandExpression => true,
            :expandDescription => true,
          }
        )
    The above works, as I refer to the expression in the 'short' unexpanded version of '{13360}#0.2' where {13360} is the ID that refers to an item.

    However, I would like to use this way:

    Code:
    result = zbx.client.api_request(
          :method => "trigger.get",
          :params => {
            :filter => {
              :expression => "{hostname:nginx.config_version.last(0)}#0.2"
            },
            :output => "extend",
            :expandExpression => true,
            :expandDescription => true,
          }
        )
    In the last example, the :expression contains the full expression that would also be visible in the WebUI. However, I can't find a way where this epxression filter would yield any results.

    Does anyone have any idea? Or is the :expression parameter only supporting the short, non-expanded, version?
  • Pavels
    Member
    • Oct 2011
    • 83

    #2
    There's currently no way to retrieve triggers by expanded expression. Filter parameters only accept values as they are stored in the database, and expressions are stored in a "compact" format.

    Comment

    Working...