Plugin configuration
Copy the binary to the Pandora FMS agent plugins directory and configure it as a module_plugin in the agent configuration file.
Configuration example on Linux:
module_begin
module_name LogParser_AppErrors
module_plugin /var/opt/PandoraFMS/etc/pandora/plugins/advlogparser --idx-dir /var/spool/pandora /var/log/myapp '.*\.log' '(?i)error|critical' 'app_source'
module_interval 300
module_end
The agent will run the plugin every module_interval seconds. The first execution will not generate data: the plugin will create indexes pointing to the end of each file. On subsequent executions, the plugin will only process new lines that match the configured filters.
Multiple Modules on the Same Directory
You can define several modules with different filters on the same log directory:
# Module for errors
module_begin
module_name Log_AppErrors
module_plugin /opt/pandora/plugins/advlogparser /var/log/myapp '.*\.log' '(?i)error' 'app_errors'
module_interval 300
module_end
# Module for warnings
module_begin
module_name Log_AppWarnings
module_plugin /opt/pandora/plugins/advlogparser /var/log/myapp '.*\.log' '(?i)warn' 'app_warnings'
module_interval 300
module_end