Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Monitoring Tools»Nagios»How to Install Nagios Server on Ubuntu 20.04

    How to Install Nagios Server on Ubuntu 20.04

    An incomprehensive guide to install Nagios server and plugins on Ubuntu 20.04 Linux system via Apt-Get.
    RahulBy RahulJune 3, 20213 Mins ReadUpdated:June 3, 2021

    Nagios Core formally known as Nagios is an open source infrastructure monitoring system. The Nagios application periodically checks on critical parameters of the application, server and network resources. For example, Nagios server can monitor CPU load, disk space, memory usage, the number of currently running processes on a remote server. Also sends warning, critical or recovery notifications to the responsible persons over email, sms etc.

    Nagios core is freely freely available from the official sites to deploy on your servers. In this tutorial, we will describe you the steps to install and configure Nagios server on a Ubuntu 20.04 LTS system.

    Step 1 – Installing Apache

    Apache is the popular web server required to serve Nagios web pages. The following commands will help you to install or upgrade Apache web server on your Ubuntu system.

    sudo apt update 
    sudo apt install apache2 
    

    Nagios configuration required two Apache modules od_authz_groupfile and mod_auth_digest, which is not enabled by default. Execute the following command to enable reqiored modules.

    sudo a2enmod authz_groupfile auth_digest 
    

    Here mod_authz_groupfile extends the authorization types with group and group-file. And auth_digest is used for user authentication using MD5 Digest Authentication.

    Step 2 – Installing Nagios on Ubuntu 20.04

    Nagios 4 stable version is available in the default Ubuntu software repositories. At the time of writing, Nagios version 4.3.4 available for Ubuntu 20.04 systems.

    Run the following commands as sudo privileged account to install Nagios on Ubuntu system.

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

    The command above will install a bunch of packages, including Nagios Core, Nagios Plugins, and Apache.

    Step 3 – Configure Nagios Authentication

    Next follow the below instructions to configure Apache and Nagios authorization.

    Create nagiosadmin User – Create a Nagios user with name “nagiosadmin” to grant administrative privileges. Make sure to keep username as it is. Use htdigest command to create a new user:

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

    Enter password and confirm password:

    Adding password for nagiosadmin in realm Nagios4.
    New password:
    Re-type new password:
    

    Configure Apache – Edit Nagios4 Apache configuration file and comment / un-comment few lines describes below. This will allow Nagios server to access from public network.

    sudo nano /etc/apache2/conf-enabled/nagios4-cgi.conf 
    
    1. Comment Require IP line
    2. Files start and closing tag only
    3. Comment “Required all granted”
    4. Uncomment “Require valid-user”

    Nagios4 Enable Remote Access

    Configure Nagios4 CGI Authentication – Next edit the /etc/nagios4/cgi.cfg configuration file and set use_authentication to 1. This option controls whether or not the CGIs will use any authentication when displaying host and service information, as well as committing commands to Nagios for processing.

    sudo nano /etc/nagios4/cgi.cfg 
    
    use_authentication=1
    

    Once you make all necessary changes, apply them by restarting the Apache and Nagios4 services.

    sudo systemctl restart apache2 
    sudo systemctl restart nagios4 
    

    That’s it. You have completed all the required settings.

    Step 4 – Access Nagios Web Interface

    You can access nagios web interface using the server IP address or domain pointed to that server. The installer creates a Apache configuration file for nagios. You can access Nagios at a sub url as “/nagios4”.

    http://server_domain_or_ip/nagios4
    

    You will be prompted to inter username and password. Enter the “nagiosadmin” user credentials to access Nagios web page.

    Installing nagios on Ubuntu 20.04

    Conclusion

    This tutorial helped you to install Nagios server on Ubuntu systems. Follow our next tutorial to add host to monitor through Nagios server.

    nagios nagios server NRPE
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow To Change User Password in Windows Server 2019
    Next Article How to Move a Directory to New Git Repository with Commit History

    Related Posts

    How to Install Nagios Client (NRPE) on Ubuntu 20.04

    3 Mins Read

    How To Install NRPE on LinuxMint 19/18

    Updated:December 6, 20182 Mins Read

    How to Monitor Memory, CPU and Disk on Linux using NRPE and Nagios

    Updated:January 11, 20183 Mins Read

    How to Create Own Nagios Plugin using Bash Shell Script

    Updated:December 1, 20172 Mins Read

    How To Install NRPE on CentOS/RHEL 7/6

    Updated:November 10, 20173 Mins Read

    How to Install NRPE on Ubuntu 18.04 & 16.04 LTS

    Updated:June 3, 20213 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to run “npm start” through docker
    • Filesystem Hierarchy Structure (FHS) in Linux
    • How to accept user input in Python
    • What is difference between var, let and const in JavaScript?
    • What is CPU? – Definition, Types and Parts
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.