How to enable the syslog monitoring-Zabbix
Steps need to be performed:
On the Syslog server side:
1. Install the rsyslog
sudo yum install rsyslog
rsyslog
service:
Start and enable the rsyslog
service if it’s not already running:3. Configure rsyslog
to accept remote logs:
Open the rsyslog
configuration file:
vi /etc/rsyslog.conf
Uncomment or add the following lines to enable UDP or TCP log reception:
# Provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")
# Provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="514")
4. Restart the rsyslog
service:
After saving the configuration file, restart rsyslog
to apply the changes:
sudo systemctl restart rsyslog
5. Ensure the firewall is configured to allow the TCP/UDP port 514 or disable the firewall service.
6. Ensure that SELinux is disable if not disable it
Check the status of SELinux
sestatus
Disable it
sudo setenforce 0
dnf clean all
/var/log/messages
to a group that Zabbix belongs to:tail -f /var/log/messages
On the Client server side:
1. Configure Syslog Clients (other hosts) to Forward Logs:
On the client machines (hosts sending logs to your syslog server), open the rsyslog
configuration file:
sudo vi /etc/rsyslog.conf
Add the following lines to forward logs to the syslog server:
*.* @Syslog_Server_IP:514 # For UDP
*.* @@Syslog_Server_IP:514 # For TCP
2. Then, restart rsyslog
on the client machines:
sudo systemctl restart rsyslog
3. Ensure the firewall is configured to allow the required port or disable the firewall service.
4. Ensure that SELinux is disable if not disable it
Check the status of SELinux
sestatus
Disable it
sudo setenforce 0
UserParameter
for log monitoring:
Add the following line to monitor the /var/log/messages
file. The Zabbix agent will use this custom key to read the log file:/var/log/messages
when the item key syslog.log
is used.Go to the Zabbix frontend → Configuration → Hosts.
Select the syslog server host.
Click Items → Create Item.
Configure the item as follows:
- Name:
Monitor Syslog
- Type:
Zabbix agent
- Key:
syslog.log
- Type of information:
Log
- Update interval: Set the desired interval (e.g.,
60s
). - Log time format: Default.
- Name:
Click Add to save the item.
Comments
Post a Comment