Sending Logs from RHEL 9 to Nagios Log Server R2

Picture of Tucker Falen
Tucker Falen
nagios

Nagios Log Server R2 introduces a robust logging system, simplifying the centralization and analysis of logs from multiple sources. This guide demonstrates how to configure a RHEL 9 machine to send its logs to the Nagios Log Server R2 using both automatic and manual methods.

Getting Started

Once configured, logs typically found in /var/log/messages will be forwarded to Nagios Log Server R2, enabling centralized monitoring and alerting.

Automatic Setup Using a Script

The simplest way to configure log forwarding is by using the provided setup script. This method requires rsyslog to be installed on your RHEL 9 system.

Steps to Run the Script:

1. Ensure Rsyslog is Installed:

sudo dnf install rsyslog -y
sudo systemctl enable --now rsyslog

2. Download the Script from the Nagios Log Server R2:

curl -sS -O http://192.168.1.49/nagioslogserver/scripts/setup-linux.sh

3. Execute the Script to Configure Rsyslog:

sudo bash setup-linux.sh -s 192.168.1.49 -p 5544
  • Replace 192.168.1.49 with the IP address of your Nagios Log Server R2.
  • The -p 5544 option specifies the port for log transmission.

Manual Setup Using Rsyslog Configuration

For greater control over configurations, follow these manual setup steps:

1. Edit Rsyslog Configuration:

sudo nano /etc/rsyslog.d/99-nagios.conf

2. Add the Following Configuration:

*.* @@192.168.1.49:5544
  • Replace 192.168.1.49 with the IP address of your Nagios Log Server R2.
  • The @@ symbol indicates TCP transmission; use @ for UDP if required.

3. Restart Rsyslog to Apply Changes:

sudo systemctl restart rsyslog

4. Verify Rsyslog Status:

sudo systemctl status rsyslog

Receiving Logs in Log Server

On your Log Server’s GUI, click Add Log Source.

Screenshot 2025 03 21 131259 1
Nagios Log Server home page

Click Linux.

Screenshot 2025 03 21 131443 1
Add log source

Type in your machine’s IP address to see if you are receiving logs. If it’s working, the interface will confirm that logs are being received.

Screenshot 2025 03 21 132800 1
Verify incoming logs

Conclusion

Whether using the automatic script or manual configuration, forwarding logs from RHEL 9 to Nagios Log Server R2 ensures centralized log management for improved monitoring and alerting. Choose the method that best fits your deployment requirements.

Share: