How to set up Ubuntu 22 for Nagios Log Server

Picture of Louie Mattia
Louie Mattia
Man sitting in front of multiple screens

Setting up Ubuntu 22 for log monitoring with Nagios Log Server (LS) is an important step in maintaining system health and security. Nagios Log Server offers a powerful, centralized solution for capturing and analyzing logs from multiple sources. This article outlines the necessary steps to prepare your Ubuntu 22 system and configure Nagios LS for effective log monitoring and storage. By the end, you’ll have a fully operational log monitoring setup.

Prerequisites

The only prerequisite for setting up is installing the curl command. curl is a versatile tool used in Linux systems to transfer data from or to a server, supporting a variety of protocols such as HTTP, HTTPS, FTP, and more. It’s commonly used to download files, make API requests, or test network connections. To install curl we will need sudo or root permissions and use the command:

sudo apt install curl

As long as you get some form of output you now have curl installed.

Step 1: Run Commands listed in Log Server

The exact commands we need to use in our instance of Ubuntu 22 are listed inside of Nagios LS, so we will be going there and looking at the commands needed. To do this we will want to add a log source, specifically a Linux source. We will want to click the circled area in the image below and select to add a Linux source.

add log source screenshot 720
How to set up Ubuntu 22 for Nagios Log Server 4

Now there are instructions here, we will be going over them as well as their intended output. The first command is:

curl -sS -O http://<Nagios LS IP address>/nagioslogserver/scripts/setup-linux.sh

This command downloads the setup-linux.sh script from the Nagios Log Server URL and ensures it retains its original filename. Since the -sS flags suppress normal output, you won’t see anything unless there’s an error. If the download completes without issues, you can proceed to the next step by running the script with the following command:

sudo bash setup-linux.sh -s <Nagios LS IP Address> -p 5544

This should give us the following output:

setup-linux.sh Output
setup-linux.sh Output

With this it is all set up and should be sending Logs to Nagios Log Server.

Step 2: Verify Logs

Next, we need to verify that the Log Server is successfully receiving logs, and this step is straightforward. All you need to do is enter the IP address of your Ubuntu 22 host where it prompts you to ‘Verify Incoming Logs.’ This will confirm that the logs from your host are being properly sent to and received by the Log Server, ensuring everything is functioning as expected.

Log Server Verification
Log Server Verification

As you can see, the message confirms that logs are being received from our new host. This means that all the setup steps have been completed successfully, and Nagios Log Server is now properly receiving logs from the newly added host.

Conclusion

By following these steps, you’ve successfully set up Nagios Log Server on your Ubuntu 22 system, allowing you to capture and analyze logs efficiently. The process of configuring your server, running the necessary commands, and verifying log reception ensures that Nagios LS is fully operational, giving you the tools to monitor and manage your system’s health and security.

Now that your log monitoring is set up, you may want to explore additional monitoring methods for a more comprehensive approach. For system performance and resource monitoring, consider setting up NCPA on Ubuntu 22, a flexible agent that integrates seamlessly with Nagios XI. Alternatively, you can also use SNMP on Ubuntu 22 for monitoring with Nagios XI.

Share

Table of Contents