Ad Widget

Collapse

SQL script for triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • saulosilva
    Junior Member
    • Jun 2005
    • 8

    #1

    SQL script for triggers

    Hello all ,

    I starting to use Zabbix to monitoring Network devices using SNMP . I already create a SQL script templates to items. Now I start with triggers.

    One expample from this scripts are :

    insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (18416,4,'public','1.3.6.1.2.1.2.2.1.16.1',161,100 08,'Port Trafic - Out - Port 1 Unit 1','ifOutOctects.Port1.Unit1',60,270,365,0,NULL,NU LL,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0 ,'',0,0);
    insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (18417,4,'public','1.3.6.1.2.1.2.2.1.16.2',161,100 08,'Port Trafic - Out - Port 2 Unit 1','ifOutOctects.Port2.Unit1',60,270,365,0,NULL,NU LL,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0 ,'',0,0);
    insert into `items` (`itemid`,`type`,`snmp_community`,`snmp_oid`,`snmp _port`,`hostid`,`description`,`key_`,`delay`,`hist ory`,`trends`,`nextcheck`,`lastvalue`,`lastclock`, `prevvalue`,`status`,`value_type`,`trapper_hosts`, `units`,`multiplier`,`delta`,`prevorgvalue`,`snmpv 3_securityname`,`snmpv3_securitylevel`,`snmpv3_aut hpassphrase`,`snmpv3_privpassphrase`,`formula`,`er ror`,`lastlogsize`,`logtimefmt`,`templateid`,`valu emapid`) values (18418,4,'public','1.3.6.1.2.1.2.2.1.16.3',161,100 08,'Port Trafic - Out - Port 3 Unit 1','ifOutOctects.Port3.Unit1',60,270,365,0,NULL,NU LL,NULL,0,3,'','bits',1,2,NULL,'',0,'','','8','',0 ,'',0,0);

    and its working fine .With triggers after I great one for start the creation of the base script I have problem because I dont know how to find the ID from expression to great the script . The example :

    The trigger in Zabbix GUI

    ({BS470_t:ifOutOctects.Port6.Unit1.last(0)}) > 10000K

    The trigger in SQL

    '({11240}) > 10000K'

    How can I associat the ID 11240 to BS470_t:ifOutOctects.Port6 ?

    Best Regards,

    Saulo Silva
Working...