-
Log file content monitoring
Hi,
I’m new to Pandora FMS and I’m trying to have a monitor looking for error messages in log files.
I saw in the Pandora Agent documentation that the module_plugin grep_log could be used.
The agent is installed on a Windows XP pro workstation.
I updated the pandora_agent.conf with this line :
module_plugin grep_log “c:test.log” LogParser ERRORIt doesn’t do anything. I have no error message in the pandora_agent.log. the module is not shown on the console. I even set the debug flag and I don’t see any reference to the plugin in the pandora debug file.
I then managed to execute a .bat file that would have cheched for new lines in a log file LogMon.bat:
@echo off
REM LogMon fichier fichiertemp
set /p prev=< %2 wc -l %1 | tr -s " " ";" |cut -f2 -d; > %2
set /p actu=< %2 expr %actu% - %prev% > %2.comp
set /p diff=< %2.comp tail -%diff% %1 I updated the agent configuration file with these lines : # Test log file monitoring module_begin module_name Test_LogMon module_type generic_data_string module_exec LogMon.bat c:test.log c:test.txt | grep ERROR module_description test Logfile monitoring module_end The LogMon.bat works great if I call it from the command line. But when run by the agent, I get this in pandora_agent.log : Pandora_Module_Exec: Test_LogMon did not executed well (retcode: 259) In the debug, I have : Executing: cmd.exe /c "LogMon.bat c:test.log c:test.txt | grep ERROR" I also tried to replace the variables in the bat file by hardcoded log and temporary files, but I have the same result ... Any help would be appreciated. In advance, thank you. Best regards, Laurent