Ad Widget

Collapse

Getting error messages from log files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • luissma
    Junior Member
    • Jul 2008
    • 16

    #1

    Getting error messages from log files

    Hi,

    I defined following trigger to look for "error" in /var/log/messages: Template_A:log[/var/log/messages,error].nodata(1)}=0

    For the moment, it works fine; whenever the word "error" is written in the log file, Zabbix activates the trigger and a message is sent.


    I have a question regarding this trigger subject: Is it possible to include error lines, extracted from log file, in the message configured in Actions?


    I've been working on this for long but I'm not able to get to a solution.

    Thanks in advance.
    Last edited by luissma; 15-07-2009, 14:39.
  • luissma
    Junior Member
    • Jul 2008
    • 16

    #2
    After some time playing around I found a reasonable solution for this "problem".

    This is the item I use to look for new "error" entries in /var/log/messages:

    Type: ZABBIX agent (active)
    Key: log[/var/log/messages,[eE][rR][rR][oO][rR]]
    Type of information: Log


    and this, the trigger expression:
    {host_example:log[/var/log/messages,[eE][rR][rR][oO][rR]].nodata(1)}=0


    I created a new action triggered by these conditions:

    Trigger description like "/var/log/messages" AND Trigger value = "PROBLEM"

    that sends a message with this content: {{HOSTNAME}:log[/var/log/messages,[eE][rR][rR][oO][rR]].last(#1)}

    Comment

    Working...