A better alternative for you will be to use a specialized plugin instead. Zabbix, like many other modern monitoring applications allows users to implement custom plugins. In your case, the custom plugin you need will be a tool that was built specifically to check, monitor and alert on log files.
An example of such a tool is autoresolve.kl.sh
The installation procedure is simple:
- Log into the host on which you have log files to monitor
- wget (the-url-link-of-zip-file-of-autoresolve.kl.sh)
- cd /tmp ; unzip (the-downloaded-zip-file)
- ./install.sh /var/tmp/KINGLAZY/SHIELDX-autoresolve.kl.sh /home/jserver -force
Replace '/home/jserver' with your zabbix plugins directory. Also, make sure to run the preceding installation commands as an ordinary user - not root, unless you're testing.
Once the above steps are complete. You can now begin monitoring logs:
./autoresolve.kl.sh localhost /var/tmp/logXray,fixer,0n-1y-2y,0-uname,1-who,2-uptime autonda /var/log/syslog 60m 'app.*error' '.' 1 2 app_err_monitor -ndshow
To keep things simple, the most important parameters you'll need to change are:
- /var/log/syslog - This is the log file you're monitoring
- app.*error - This is the string you're looking for in the log file
- app_err_monitor - This is the name/tag that you're assigning to this particular log check. Later, if you wish, this tag can be used to help you generate graphs on the monitored log.
For a detailed explanation on what each parameter means, you can visit the help page directly.
On the same help page, you'll also find step by step instructions on how to get this tool to work with Zabbix...i.e. what zabbix configuration file you need to update...and what settings you need to have on the zabbix web interface.