Testing log files
One of the many other things Zabbix can do is monitor log files. In this recipe, we will show you how to test your log files with Zabbix for certain patterns.
Getting ready
For this recipe, we need a Zabbix server without agent installed on the server and configured. We also need Zabbix super administrator access.
How to do it ...
Let's say we want to monitor the /var/log/messages
file on our OS.
First thing we need to do is make sure Zabbix has access to the file:
# ll /var/log/messages -rw-------. 1 root root 324715 Jan 20 18:54 /var/log/messages
As we can see, only the user
root
has read and write access to this file.Our next step is to add Zabbix to a new group example,
adm
; then later we can give this group access to our log file:# usermod -a -G adm zabbix
Next step is to make the file readable for the group:
# chmod g+r /var/log/messages
Now we only have to add the file messages to the group
adm
:# chgrp adm /var/log/messages
Now when we check, our permissions should...