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/") |
|||
(3 intermediate revisions by the same user not shown) | |||
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 | ||
+ | ``` | ||
+ | |||
+ | https://subscription.packtpub.com/book/networking_and_servers/9781787129047/11/ch11lvl1sec50/log-file-monitoring | ||
+ | ``` | ||
+ | logrt["/tmp/zabbix_logmon/access_[0-9]{4}-[0-9]{2}-[0-9]{2}.log"] | ||
+ | ``` | ||
+ | |||
+ | # Windows | ||
+ | |||
+ | # Refs | ||
+ | - https://www.zabbix.com/documentation/current/manual/regular_expressions | ||
+ | - https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/ | ||
+ | - https://blog.zabbix.com/zabbix-log-file-monitoring/7378/ | ||
+ | - https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/log_items | ||
+ | - https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/zabbix_agent |
Latest revision as of 19:24, 6 November 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
logrt["/tmp/zabbix_logmon/access_[0-9]{4}-[0-9]{2}-[0-9]{2}.log"]
Windows
Refs
- https://www.zabbix.com/documentation/current/manual/regular_expressions
- https://techexpert.tips/zabbix/zabbix-monitor-log-file-linux/
- https://blog.zabbix.com/zabbix-log-file-monitoring/7378/
- https://www.zabbix.com/documentation/3.2/manual/config/items/itemtypes/log_items
- https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/zabbix_agent