Ad Widget

Collapse

Trigger on logfile OK event generation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Zven
    Junior Member
    • Oct 2019
    • 1

    #1

    Trigger on logfile OK event generation

    My goal is to monitor a logfile and to trigger a problem when the string 'Failed to initialize subsystem' appears. I also want the problem to automatically become resolved when the string 'Successfully initialized subsystem' subsequently appears in the logfile.

    For this I've created two items:
    - logrt["C:\ProgramData\MyApp\log_input","Failed to initialize subsystem",,1,skip,,,]
    - logrt["C:\ProgramData\MyApp\log_input","Successfully initialized subsystem",,1,skip,,,]

    I've created a trigger with expression:
    {ZP file monitoring:logrt["C:\ProgramData\MyApp\log_input","Failed to initialize subsystem",,1,skip,,,].str("Failed to initialize subsystem")}=1
    and Recovery:
    {ZP file monitoring:logrt["C:\ProgramData\MyApp\log_input","Successfully initialized subsystem",,1,skip,,,].str("Successfully initialized subsystem")}=1

    Unfortunately this doesn't work. The problem is created, but the status never goes to resolved when a 'Successfully initialized subsystem' line is added to the logfile.

    What could be the problem?
  • gofree
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2017
    • 400

    #2
    You need to have both cases in one item key, than specify recovery expression with OK state. There is a tricky zabbix logic with trigger ok/not OK status that will not make possible to do it your way. I've been struggling with it as well

    Comment

    • factocert1
      Junior Member
      • Oct 2019
      • 1

      #3
      I find that zabbix does the 'action' (send a mail) only when the trigger's status changes.

      So, when the first line comes into the log file, the trigger becomes PROBLEM. And then the trigger's status keeps PROBLEM, so the following lines will not sending a mail.
      http;//factocert.com

      Comment

      Working...