Ad Widget

Collapse

one item - multiple triggers

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbw
    Junior Member
    • Jan 2015
    • 2

    #1

    one item - multiple triggers

    Hi community helpers! You're beautiful, and fantastic people! (hope I'm not overdoing it, maybe just a little but then, that's just a little).
    So I'm trying something. I have built a script that feeds a logfile every minute, for testing purposes.
    Basically, it writes 3 types of lines:
    [timestamp] - <Random Number> - INF - number is even
    [timestamp] - <Random Number> - WRN - number is odd
    [timestamp] - <Random Number> - ERR - number is a multiple of 3

    So then I created an Item: log[/var/log/test_log_zbx.log]
    It just feeds zabbix with the lines.

    And then I tried creating 3 triggers, one for each kind of line:
    High test-log-ERR {00_test_template_it1:log[/var/log/test_log_zbx.log].str(ERR,1)}=1 Enabled
    Information test-log-INF {00_test_template_it1:log[/var/log/test_log_zbx.log].str(INF,1)}=1 Enabled
    Warning test-log-WRN {00_test_template_it1:log[/var/log/test_log_zbx.log].str(ERR,1)}=1 Enabled

    But then, I get this:
    13 Feb 2015 14:55:23 ubt-nde test-log-INF Information 3m No -
    13 Feb 2015 14:55:23 ubt-nde test-log-WRN Warning 3m No -
    13 Feb 2015 14:55:23 ubt-nde test-log-ERR High 3m No -

    All 3 of them are triggered simutaneously, when I know all of them can't happen at the same time.
    What am I doing wrong there ?

    Jean-Bernard
  • ingus.vilnis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2014
    • 908

    #2
    Hi,

    What is the update interval of your log item?
    If it is set to e.g. 60 seconds but the log lines are added within the interval then at the next log item update they all will match your triggers and fire.

    Additionally you are using second parameter to your trigger functions like .str(ERR,1)

    I'd say you should be enough with such one .regexp(ERR)=1

    Best Regards,
    Ingus

    Comment

    Working...