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");