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.

  1. 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
    
  2. As we can see, only the user root has read and write access to this file.
  3. Our next step is to add Zabbix to a new group example, adm; then later we can give this group access to our log ...

Get Zabbix Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.