Ad Widget

Collapse

Create triggers with sql query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chaouki
    Junior Member
    • Nov 2011
    • 10

    #1

    Create triggers with sql query

    I would like to create a trigger via a sql query but it does not work.
    By typing the following command, I get a success response but the trigger does not appear in my web page zabbix.

    zabbix=# INSERT INTO triggers VALUES (14264,'{24175}=2 & {24174}=1 & {24173}>1 ','Port {ITEM.VALUE3} on {HOSTNAME} Status Change','',0,2,3,0,0,'','Trigger just added. No status update so far.',0,0);
    INSERT 47188954 1


    The triggerid '14264 'was not used
    This itemids match items
    24173 : ifdescr.60
    24174 : ifAdminStatus.60
    24175 : ifOperStatus.60

    When I run the application to look at what makes up my new trigger, the ID has changed expression.

    zabbix=# select * from triggers where triggerid=14264;
    triggerid | expression | description | url | status | valu
    e | priority | lastchange | dep_level | comments | error | templateid | type
    -----------+-------------------------------------+------------------------------------------------+-----+--------+-----
    --+----------+------------+-----------+----------+----------------------------------------------+------------+------
    14264 | {13742}=2 & {13743}=1 & {13744}>1 | Port {ITEM.VALUE3} on {HOSTNAME} Status Change | | 0 |
    2 | 3 | 0 | 0 | | Trigger just added. No status update so far. | 0 | 0
    (1 ligne)


    Have you ever encountered this problem?

    thank you
    Last edited by chaouki; 30-04-2012, 18:30.
  • chaouki
    Junior Member
    • Nov 2011
    • 10

    #2
    I found the solution:
    must create links between the trigger and the items in the table function.

    Comment

    • ke_sheng_jie
      Member
      • Aug 2011
      • 40

      #3
      Api

      You (or anyone who is adding triggers, etc. through SQL queries) might try using the API to avoid problems do to dependencies like this.

      Comment

      Working...