Linux, Windows, Virtualization, OpenSource & Blogging

How to Install Nagios 4.3.4 on Fedora 26 / Fedora 25-21

4

Nagios is the most widely used open source monitoring tools which help us to monitor the services and application that run’s on Windows, Linux, Routers and other network devices.

With the help of Nagios you can monitor basic services and attributes. We can access the Nagios using web interface coming with the bundle and configuration need to be done on the file level.

Services List

This Tutorial describes how you can monitor “private” services and attributes of Linux/UNIX servers, such as:

Attributes

  • CPU load
  • Memory usage
  • Disk usage
  • Logged in users
  • Running processes
  • etc.

Private Services

  • HTTP
  • FTP
  • SSH
  • SMTP
  • etc

Prerequisites

Before installing the Nagios, system need to meet the requirements for installing Nagios; So install the Web Server (httpd) , PHP ,compilers and development libraries. Install all with single command.
yum -y install httpd php gcc glibc glibc-common gd wget perl
Create nagios user and nagcmd group (allowing the external commands to be executed through the web interface), add the nagios and apache user to the part of the nagcmd group.
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Install Nagios

Download latest Nagios Core.

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

Compile and Install Nagios:

./configure --with-nagios-group=nagios --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Configure Nagios

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You’ll need to make just one change before you proceed…

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you’d like to use for receiving alerts.

vi /usr/local/nagios/etc/objects/contacts.cfg

Change the Email address field to receive the notification.

define contact{
        contact_name                    nagiosadmin             ; Short name of user
        use                             generic-contact         ; Inherit default values from generic-contact template (defined above)
        alias                           Nagios Admin            ; Full name of user

        email                           admin@itzgeek.local        ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
        }

Configure Nagios Web Interface

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password that you assign to this user – you’ll need it later.

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

Restart Apache to make the new settings take effect.

systemctl restart httpd
systemctl enable httpd

Install Nagios Plugins

Download Nagios Plugins to /tmp directory.

cd /tmp
wget https://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 the plugins.

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

Starting Nagios

Verify the sample Nagios configuration files.

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

If there are no errors, start Nagios.

/etc/init.d/nagios start
chkconfig nagios on

Firewall

Allow Apache web server through the firewall.

firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload

Access Nagios Web Interface

Now access the Nagios web interface using the following URL. You’ll be prompted for the username (nagiosadmin) and password you specified earlier.

http://ip.add.re.ss/nagios/
Install Nagios 4.3.4 on Fedora 26 - Monitoring Services
Install Nagios 4.3.4 on Fedora 26 – Monitoring Services

That’s All.

POSTS YOU MAY LIKE -:)

You might also like
  • ds

    Thanks for the writeup! It helped me get my nagios install on Fedora 20 up and going in less than an hour with no problems at all. Much appreciated!

  • abhishek(sh)

    Exellent writeup……Easy to implement. I just completed my 1st nagios installattion on fedora 20.

    Everything worked like charm, only because of this, Amazing work bro.

    Thanks a lot

  • Luis wong

    great
    thanks

  • Vinicius de Paula

    Tnx worked very well!

How to Install Nagios 4.3.4 on Fedora 26 / Fedora 25-21

4