Nagios
Nagios
proficient with Cloud based DevOps solution deployment options to meet your business
requirements, To use Continuous Monitoring Tools to resolve any system errors (low
memory, unreachable server etc.) before they have any negative impact on the business
productivity.
Theory:
What is Nagios?
Nagios is an open-source software for continuous monitoring of systems, networks, and
infrastructures. It runs plugins stored on a server which is connected with a host or another
server on your network or the Internet. In case of any failure, Nagios alerts about the issues so
that the technical team can perform recovery process immediately. Nagios is used for
continuous monitoring of systems, applications, service, and business process in a DevOps
culture.
• Helps you to find the root cause of the problem which allows you to get the permanent
solution to the problem
• Active monitoring of your entire infrastructure and business processes
• Allows you to monitor and troubleshoot server performance issues
• Helps you to plan for infrastructure upgrades before outdated systems create failures
• You can maintain the security and availability of the service
• 1999-The plugins that were which were originally distributed as a part of the
NetSaint distribution are soon as a separate Nagios Plugins project
• 2002-Ethan renames the project to “Nagios” because of trademark issues with the
name “NetSaint.”
• 2005- Nagios becomes SourceForge.net Project of the Month in June
• 2009-Nagios Enterprises releases its first commercial version, Nagios XI
• 2012-Nagios again renamed as Nagios Core
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
• If the services are running fine, then there is no need to do check that host is an alive
• Helps you to detect network errors or server crashes
• You can troubleshoot the performance issues of the server.
• The issues, if any, can be fixed automatically as they are identified during the monitoring
process
• You can monitor the entire business process and IT infrastructure with a single
pass •The product’s architecture is easy writing new plugins in the language of
your choice
• Nagios allows you to read its configuration from an entire directory which helps you to
decide how to define individual files
• Utilizes topology to determine dependencies
• Monitor network services like HTTP, SMTP, HTTP, SNMP, FTP, SSH, POP, etc.
• Helps you to define network host hierarchy using parent hosts
• Ability to define event handlers which runs during service or host events for proactive
problem resolution
Nagios Architecture
1. The scheduler is a component of server part of Nagios. It sends a signal to execute the
plugins at the remote host.
2. The plugin gets the status from the remote host
3. The plugin sends the data to the process scheduler
4. The process scheduler updates the GUI and notifications are sent to admins
Plugins
Nagios plugins provide low-level intelligence on how to monitor anything and everything
with Nagios Core. Plugins operate acts as a standalone application, but they are designed to
be executed by Nagios Core. It connects to Apache that is controlled by CGI to display the
result.
Moreover, a database connected to Nagios to keep a log file.
How do plugins work
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
• CCTV/NVR System
• Storage Subsystem (NAS&SAN)
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
• There’re many configuration files which are very hard to configure for users
• Nagios can’t monitor network throughput
• The tool not allows you to manage the network but only allows to monitor the network
• Nagios makes no difference between various devices like servers, routers, or switches as it
treats every device as a host
Conclusion: Continuous monitoring is a process to detect, report, respond all the attacks which
occur in its infrastructure. Nagios offers effective monitoring of your entire infrastructure and
business processes.
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
Experiment No: 10
Date of 25/09/2023
Performance:
Date of 3/10/2023
Submission:
Program
formation/ Documentation Timely Viva Experiment Teacher
Execution/ (02) Submission Answer Marks (15) Signature
ethical (03) (03) with date
practices (07)
Experiment No 10
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
Theory:
Nagios is a powerful open-source monitoring system that allows you to monitor the
availability and performance of various network services, hosts, and resources,
including both Windows and Linux servers. Here's a step-by-step guide on how to set
up Port and Service monitoring and Windows/Linux server monitoring using Nagios:
Before you begin, make sure you have a Linux server or VM where you'll install
Nagios.
Nagios requires several packages to be installed, such as Apache, PHP, and other
plugins. You can install them using your package manager.
- On Ubuntu:
bash
sudo apt-get install apache2 php libapache2-mod-php
sudo apt-get install build-essential libgd2-xpm-dev openssl libssl-dev xinetd
- On CentOS:
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
bash
sudo yum install httpd php gcc glibc glibc-common gd gd-devel
sudo yum install openssl-devel perl unzip xinetd
3. Configure Apache:
You need to configure Apache to serve the Nagios web interface. Edit the Apache
configuration file:
4. Configure Nagios:
- Define hosts, services, and commands in the Nagios configuration files located in
`/usr/local/nagios/etc/`. You can customize these files based on your requirements.
To monitor Windows servers, you can use NSClient++ or NRPE (Nagios Remote
Plugin Executor) as agents on the Windows servers. This allows Nagios to execute
checks on the Windows machines.
7. Restart Services:
After making any configuration changes, restart the Nagios service and the web
server:
sudo systemctl restart nagios
sudo systemctl restart httpd
earlier.
Output:
$ sudo apt update
$
wget
https://assets.nagios.com/downloads/nagioscore/releases/nagios-
4.4.6.tar.gz
$cd nagios-4.4.6
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
$ sudo ./configure
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
$
sudo make install-commandmode
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
Download the Nagios Core plugin. To download the latest plugins, visit
the plugins download page.
$ cd ~/
$ wget https://nagios-plugins.org/download/nagios-plugins-
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
2.3.3.tar.gz
$ cd nagios-plugins-2.3.3/
$ sudo make
http://192.0.2.10/nagios
You have successfully installed Nagios Core on your server. To log in,
use admin as your username and the password you set during the user
account creation step as your password. You can now access the dashboard
and begin configuring Nagios.
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
To get started, connect as root over SSH to the host you want to
monitor.
Install Prerequisites
hosts that are part of our network to gain even more control. You will
need to use the following instructions on all hosts that you want to
monitor.
Configure NRPE
Now that we've configured the host we're going to monitor, we need to
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088
switch back to our Nagios server and add the host to it. Open the
following file with your favorite editor:
# nano /usr/local/nagios/etc/objects/windows.cfg
define host {
use linux-server
host_name yourhost
max_check_attempts 5
check_period 24x7
notification_interval 30
notification_period 24x7
This will allow you to simply monitor whether the server is up or down.
Now reload Nagios:
Mahavir Education Trust's
SHAH & ANCHOR KUTCHHI ENGINEERING COLLEGE,
Chembur, Mumbai - 400 088