Creating a Nagios Core Monitoring Server

Nagios Core (formerly known as just Nagios) is a free tool that can be used to monitor networking equipment, server equipment, and general networking infrastructure. This is a command line tutorial therefore this can be done on either the desktop or the CLI version of Linux.

  • OS Requirements
    • Ubuntu Linux 20.04
  • Install Required Packages
    • apt install wget unzip curl openssl build-essential libgd-dev libssl-dev libapache2-mod-php php-gd php apache2 -y
  • Install nagios core
  • Extract the downloaded files.
    • sudo tar -zxvf nagios-4.4.6.tar.gz
  • Navigate to the setup directory.
    • cd nagios-4.4.6
  • Run the Nagios Core configure script.
    • sudo ./configure
  • Compile the main program and CGIs.
    • sudo make all
  • Make and install group and user.
    • sudo make install-groups-users
  • Add www-data directories user to the nagios group.
    • sudo usermod -a -G nagios www-data
  • Install Nagios.
    • sudo make install
  • Initialize all the installation configuration scripts.
    • sudo make install-init
  • Install and configure permissions on the configs’ directory.
    • sudo make install-commandmode
  • Install sample config files.
    • sudo make install-config
  • Install apache files.
    • sudo make install-webconf
  • Enable apache rewrite mode.
    • sudo a2enmod rewrite
  • Enable CGI config.
    • sudo a2enmod cgi
  • Restart the Apache service.
    • sudo systemctl restart apache2
  • Create a user and set the password when prompted.
    $ sudo htpasswd -c /usr/local/nagios/etc/htpasswd.users admin

Leave a Reply

Your email address will not be published. Required fields are marked *