Install Nagios core 4.4.1 on Ubuntu 18.04 Server

Sponsored Link
Nagios® Core™ is an Open Source system and network monitoring application. It watches hosts and services that you specify, alerting you when things go bad and when they get better.Nagios Core was originally designed to run under Linux, although it should work under most other unices as well.

Nagios Features

Some of the many features of Nagios Core include:

Monitoring of network services (SMTP, POP3, HTTP, NNTP, PING, etc.)
Monitoring of host resources (processor load, disk usage, etc.)
Simple plugin design that allows users to easily develop their own service checks
Parallelized service checks
Ability to define network host hierarchy using "parent" hosts, allowing detection of and distinction between hosts that are down and those that are unreachable
Contact notifications when service or host problems occur and get resolved (via email, pager, or user-defined method)
Ability to define event handlers to be run during service or host events for proactive problem resolution
Automatic log file rotation
Support for implementing redundant monitoring hosts
Optional web interface for viewing current network status, notification and problem history, log file, etc.

Preparing your system

First You need to make sure you have install Ubuntu 18.04 LAMP Server and once you have that follow the next steps.

Switch to root user and run the all the commands

sudo su --

Install the following packages

apt-get install build-essential apache2 php openssl perl make php-gd libgd-dev libapache2-mod-php libperl-dev libssl-dev daemon wget apache2-utils unzip

You need to create nagios user,nagcmd group and add the nagios,apache user to the part of nagcmd group

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd www-data

Download Nagios core DIY Source from here

cd /tmp/
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.1.tar.gz
tar -zxvf /tmp/nagios-4.4.1.tar.gz
cd /tmp/nagios-4.4.1/

Compile and install Nagios Using the following commands

./configure –with-nagios-group=nagios –with-command-group=nagcmd --with-httpd_conf=/etc/apache2/sites-enabled/
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Configure Nagios web Interface

Create nagiosadmin account using the following command

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Enable CGI module and restart the apache2 server

a2enmod cgi

systemctl restart apache2

Install Nagios Plugins

Download and install nagios plugins using the following commands

cd /tmp

wget http://www.nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz

tar -zxvf /tmp/nagios-plugins-2.2.1.tar.gz

cd /tmp/nagios-plugins-2.2.1/

Compile and install nagios plugins using the following commands

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Start Nagios

Verify the sample nagios configuration files using the following command

/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Output

If you are not seeing any errors enable Nagios to start automatically at system startup.

systemctl enable nagios

Start Nagios service.

systemctl start nagios

Access Nagios Web interface

From the web browser use the following syntax URL

http://server-ip-address/nagios/

Use the loginame as nagiosadmin and the password created previously.

Once you logged in you should see similar to the following screens

Sponsored Link

You may also like...

Leave a Reply

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