From c0c347ae9a11ccd870a98c9e1ed02fd076020e38 Mon Sep 17 00:00:00 2001 From: slerena Date: Thu, 1 Sep 2011 12:59:21 +0000 Subject: [PATCH] 2011-09-01 Sancho Lerena * unix/plugins/grep_log, shellscript/linux/plugins/grep_log: Restored previous code because it needs to start searching on the last position known. First time plugin starts, seek to the final position to avoid fire old events detected in the log. Plugin only gives new events once starts to work git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4873 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/ChangeLog | 8 ++++++++ pandora_agents/shellscript/linux/plugins/grep_log | 4 ++-- pandora_agents/unix/plugins/grep_log | 4 ++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index 8d09d0c783..49dcc76888 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,11 @@ +2011-09-01 Sancho Lerena + + * unix/plugins/grep_log, + shellscript/linux/plugins/grep_log: Restored previous code because + it needs to start searching on the last position known. First time + plugin starts, seek to the final position to avoid fire old events + detected in the log. Plugin only gives new events once starts to work + 2011-08-31 Juan Manuel Ramon Vigo * unix/plugins/grep_log diff --git a/pandora_agents/shellscript/linux/plugins/grep_log b/pandora_agents/shellscript/linux/plugins/grep_log index 2a5aa86a95..2cf32474bd 100755 --- a/pandora_agents/shellscript/linux/plugins/grep_log +++ b/pandora_agents/shellscript/linux/plugins/grep_log @@ -168,8 +168,8 @@ sub parse_log () { open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " . $!); - # Go to starting position - seek(LOGFILE, 0, 0); + # Go to starting position. + seek(LOGFILE, $Idx_pos, 0); print (stdout "\n"); print (stdout "\n"); diff --git a/pandora_agents/unix/plugins/grep_log b/pandora_agents/unix/plugins/grep_log index 2a5aa86a95..2cf32474bd 100755 --- a/pandora_agents/unix/plugins/grep_log +++ b/pandora_agents/unix/plugins/grep_log @@ -168,8 +168,8 @@ sub parse_log () { open(LOGFILE, $Log_file) || error_msg("Error opening file $Log_file: " . $!); - # Go to starting position - seek(LOGFILE, 0, 0); + # Go to starting position. + seek(LOGFILE, $Idx_pos, 0); print (stdout "\n"); print (stdout "\n");