Logo
  • Ubuntu
  • CentOS
  • Debian
  • Fedora
  • RedHat

How to Install Nagios on Ubuntu 20.04 - DesignLinux

Aug 13 2020
designlinux 0 Comments
How to Install Nagios on Ubuntu 20.04

Nagios is the most widely used open-source monitoring system to monitor the networks, servers, services and applications which are running on Windows and Linux operating systems. It will notify alerts on failure or suboptimal performance. In this article we will learn how to install Nagios on Ubuntu 20.04.

Step 1 – Prerequisites#

You must logged in as root or user with sudo privileges.

Step 2 – Installing Nagios on Ubuntu#

By default, the Ubuntu standard repositories includes the Nagios 4. The installation is straightforward, just run the following commands:

sudo apt update
sudo apt install nagios4 nagios-plugins-contrib nagios-nrpe-plugin

The above commands will install required packages, Nagios Core, Nagios Plugins, and Apache.

By default, the Apache configuration file ships with Nagios which depends on the mod_authz_groupfile and mod_auth_digest modules. These are disabled by default and you should enable both of these to allow or deny access to authenticated by group membership, and mod_authz_groupfile enables the MD5 digest authentication.

Run the following commands to enable the both modules:

sudo a2enmod authz_groupfile auth_digest

Step 3 – Apache Configuration#

Nagios is allowed to access only from localhost and private IPs due to the Apache default configuration. Now we will change the configuration so only allowed user can access and view.

Open the configuration file with your text editor:

sudo nano /etc/apache2/conf-enabled/nagios4-cgi.conf

Find the line starts with Require ip and Require all granted and uncomment the line containing Require valid-user.

Save and close the file. After that restart the Apache service to take effect of configuration:

sudo systemctl restart apache2

Check the status of Apache and Nagios wether it is working proper or not by typing:

sudo systemctl status apache2
sudo systemctl status nagios4

Step 4 – Creating User Account#

The username “nagiosadmin” having the administrative privileges by default in Nagios. With this user, you can log in to the Nagios web interface and manage your inventory.

To create a new user you should use htdigest command:

sudo htdigest -c /etc/nagios4/htdigest.users Nagios4 nagiosadmin

It will prompt to enter and confirm the user’s password.

New password: 
Re-type new password: 
Adding password for user nagiosadmin

It’s again required to restart the Apache service for changes to take effect:

sudo systemctl restart apache2

Step 5 – Configuring Firewall#

If your system is secured firewall, you should open the HTTP and HTTPS ports:

sudo ufw allow Apache

Step 6 – Access Nagios Web Interface#

Open your web browser and type the server’s public ip or domain name followed by /nagios to access the Nagios web interface:

http://your_domain_or_ip_address/nagios

Enter the user name and password as we previously created and it will redirect to home page on successful authentication.

That’s it. You can manage all servers, service and applications using Nagios.

Conclusion#

You have successfully learned how to install Nagios on Ubuntu 20.04 system. To know more about the Nagios visit official documentation.

If you have any questions or suggestion, please leave comment below.

Related

Tags: monitoring, nagios, ubuntu

How to Install Postman on Ubuntu 20.04

Prev Post

Pstree Command in Linux

Next Post
Archives
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • July 2022
  • June 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
Categories
  • AlmaLinux
  • Android
  • Ansible
  • Apache
  • Arch Linux
  • AWS
  • Backups
  • Bash Shell
  • Bodhi Linux
  • CentOS
  • CentOS Stream
  • Chef
  • Cloud Software
  • CMS
  • Commandline Tools
  • Control Panels
  • CouchDB
  • Data Recovery Tools
  • Databases
  • Debian
  • Deepin Linux
  • Desktops
  • Development Tools
  • Docker
  • Download Managers
  • Drupal
  • Editors
  • Elementary OS
  • Encryption Tools
  • Fedora
  • Firewalls
  • FreeBSD
  • FTP
  • GIMP
  • Git
  • Hadoop
  • HAProxy
  • Java
  • Jenkins
  • Joomla
  • Kali Linux
  • KDE
  • Kubernetes
  • KVM
  • Laravel
  • Let's Encrypt
  • LFCA
  • Linux Certifications
  • Linux Commands
  • Linux Desktop
  • Linux Distros
  • Linux IDE
  • Linux Mint
  • Linux Talks
  • Lubuntu
  • LXC
  • Mail Server
  • Manjaro
  • MariaDB
  • MongoDB
  • Monitoring Tools
  • MySQL
  • Network
  • Networking Commands
  • NFS
  • Nginx
  • Nodejs
  • NTP
  • Open Source
  • OpenSUSE
  • Oracle Linux
  • Package Managers
  • Pentoo
  • PHP
  • Podman
  • Postfix Mail Server
  • PostgreSQL
  • Python
  • Questions
  • RedHat
  • Redis Server
  • Rocky Linux
  • Security
  • Shell Scripting
  • SQLite
  • SSH
  • Storage
  • Suse
  • Terminals
  • Text Editors
  • Top Tools
  • Torrent Clients
  • Tutorial
  • Ubuntu
  • Udemy Courses
  • Uncategorized
  • VirtualBox
  • Virtualization
  • VMware
  • VPN
  • VSCode Editor
  • Web Browsers
  • Web Design
  • Web Hosting
  • Web Servers
  • Webmin
  • Windows
  • Windows Subsystem
  • WordPress
  • Zabbix
  • Zentyal
  • Zorin OS
Visits
  • 1
  • 646
  • 568,441

DesignLinux.com © All rights reserved

Go to mobile version