Difference between revisions of "Zabbix Log Collection"
Jump to navigation
Jump to search
(Created page with "https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/") |
|||
Line 1: | Line 1: | ||
https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/ | https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/ | ||
+ | |||
+ | |||
+ | # For Redhat | ||
+ | ``` | ||
+ | sudo chown :zabbix /var/log/messages | ||
+ | sudo chmod 0640 /var/log/messages | ||
+ | ``` | ||
+ | |||
+ | # For Ubuntu | ||
+ | ``` | ||
+ | sudo useradd -aG adm zabbix | ||
+ | ``` | ||
+ | |||
+ | # Template | ||
+ | ``` | ||
+ | item key: log[/var/log/messages,(?i)error] | ||
+ | Trigger Expression: {template-name:log[/var/log/messages,(?i)error].iregexp(error,100)}=1 | ||
+ | ``` | ||
+ | |||
+ | # Refs | ||
+ | - https://www.zabbix.com/documentation/current/manual/regular_expressions |
Revision as of 16:01, 24 July 2020
https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/
For Redhat
sudo chown :zabbix /var/log/messages sudo chmod 0640 /var/log/messages
For Ubuntu
sudo useradd -aG adm zabbix
Template
item key: log[/var/log/messages,(?i)error] Trigger Expression: {template-name:log[/var/log/messages,(?i)error].iregexp(error,100)}=1