Ad Widget

Collapse

logfile grew by > X lines trigger

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gregtompkins
    Junior Member
    • Sep 2011
    • 23

    #1

    logfile grew by > X lines trigger

    I am still getting my feet wet with Zabbix. I want to create a trigger that just does something like if logfile grew by over a certain # of lines since the last interval of the item then trigger. How could I do this?

    Thanks!
  • orionweb
    Junior Member
    • Feb 2010
    • 17

    #2
    You can create an item that count the number of lines in the particular log file.

    Next create a trigger that will trigger if the difference in the number of lines vs last result is greater than say 5 lines or whatever number you like.

    Comment

    • gregtompkins
      Junior Member
      • Sep 2011
      • 23

      #3
      I understand the concept but I don't think I have the item or the trigger set right. Here is what I have for the item which I want to monitor the logfile /var/log/router for the pattern D] and the trigger if it detects more than 5 occurrances in 5 seconds. Is this right?
      Last edited by gregtompkins; 10-12-2013, 09:13.

      Comment

      • orionweb
        Junior Member
        • Feb 2010
        • 17

        #4
        I have not use the log monitoring before so not sure how it works (don't know if it return true if pattern found or it it returns the number of time pattern is found).
        I can see that you are monitoring the log file every 10 seconds. So depending on the return value (true / false or # of occurrence), this may have something to do with your trigger not working?

        Also can the zabbix user (which zabbix runs under) access the log files (permission wise)?

        I'm thinking that you might need to monitor every second and if the last 5 result (which equals 5 seconds) are all true then fire the trigger.

        I would also suggest making a dummy log file and add the lines yourself to test what zabbix return (true / false or number of occurrence found).
        Also try
        What I wanted: Zabbix should send me mail when string "ERROR" is seen in log file. Approach: We create a Item which monitors log files ...

        http://java.dzone.com/articles/notif...og-file-zabbix
        Last edited by orionweb; 27-11-2013, 04:34.

        Comment

        Working...