6

How to Install Nagios on EC2

 2 years ago
source link: https://blog.knoldus.com/how-to-install-nagios-on-ec2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Reading Time: 4 minutes

Hello Readers, In this blog, we’ll learn about Nagios which is an open-source monitoring system for computer systems also we’ll see how to install Nagios on EC2, and what Nagios Dashboard looks like.

What is Nagios?

  • Nagios is basically a tool that is used for continuous monitoring of systems, applications, services, business processes, etc in DevOps culture.
  • In the event of failure, Nagios can alert technical staff of the problem allowing them to begin remediation processes before outages affect the business process, end-users or customers.

History of Nagios

  • In the year 1999, Ethan galstad developed it as a part of Netscaint distribution.
  • The year 2002, Ethan renames the project “Nagios” because of trademark issues with the name “Netsaint”.
  • In 2009, Nagios releases its first commercial version, Nagios XI.
  • In 2012, Nagios was again renamed as Nagios Core.

Pre-requisite

To start Nagios core installation you must have your EC2 instance up and running and have already configured SSH and HTTP access to the instance.

so Install pre-requisite software on your ec2 machine prior to Nagios installation like apache, PHP, gcc and gd development libraries.

httpd:-Browser

php:- for dashboard

gcc and gd:- compiler to convert row code into binaries

Installation

step 1 :

installing apache , PHP, GCC compiler and gd development libraries

sudo su
yum install httpd php
yum install gcc glibc glibc-common 
yum install gd gd-devel

Step 2 :

Create account information you need to set up a Nagios user , Run the following command

adduser -m nagios 

passwd nagios

Now,it asks you to enter the password to your user Nagios

I have given atisha12345 as a password of my user Nagios, it could be anything of your choice.

you can add the group as well by following the given command below.

groupadd nagioscmd 
usermod -a -G nagioscmd nagios

Step 3 :

Download Nagios Core and the plugins, Create a directory for storing the downloads

mkdir ~/Nagios
cd ~/Nagios

now download the source code tarball of both Nagios and the Nagios plugins.

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz

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

Here we are downloading the nagios 4.0.8 version

Step 4 :

Compile and install Nagios and extract the Nagios source code tarball

tar zxvf nagios-4.0.8.tar.gz 

cd nagios-4.0.8

Run the configuration script with the name of the group which you have created in the above steps

./configure --with-command-group=nagioscmd 

compile the Nagios source code

Install Binaries ,init script in /lib/systemd/system,sample config files in usr/local/nagios/etc, and set permission on the external command directly.

make all 
make install 
make install-init 
make install-config 
make install-commandmode

Step 5 :

Configuring the web interface

make install-webconf

Step 6 :

Create a ‘nagiosadmin’ account for login into the Nagios web interface

set password as well

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin service httpd restart

asking for password, set a new password

Step 7 :

Compile and install the Nagios plugins and extract the Nagios plugins source code tarball.

cd ~/Nagios
tar zxvf nagios-plugins-2.0.3.tar.gz 
cd nagios-plugins-2.0.3

Now, compile and install the plugins

/configure --with-nagios-user=nagios --with-nagios-group=nagios 

 make all

make install

Step 8 :

Start Nagios and add nagios to the list of system services and have it automatically start when the system boots.

chkconfig --add nagios 

 chkconfig nagios on

Varify the sample nagios configuration files by using the command given below

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

if there are no errors in your configuration file then start the Nagios.

Step 10

Copy public IP of your EC2 instance and paste it on google in given way

for instance :- 20.1.1.1/nagios/

after all it’ll ask for username and password

and finally you will be able to access your nagios dashboard.

Reference

https://www.nagios.org/documentation/

https://blog.knoldus.com/devops-infrastruture-monitoring-with-nagios/

In conclusion

In conclusion, we’ve learned about what is Nagios monitoring tool , how to install Nagios on EC2 instances, and how to access the dashboard of Nagios.

Scala Future


Recommend

  • 60

    Nagios监控实战 、 监控概述 、 Nagios监控服务

  • 51

    Nagios是一个流行的电脑系统和网络监控程序,它检测主机和服务,当异常发生和解除时能提醒用户。它是基于GPLv2开发的开源软件,可免费获得及使用。nagios工作原理nagios的功能是监控服务和主机,但是其自身并不包括这些功能,所有的监控、检测功能都是通过各种插件...

  • 33

    监控三剑客<cacti、nagios、zabbix>在企业网络运维过程中,管理员闭虚随时关注服务器和网络运行情况,以便及时发现问题,尽可能减少故障的发生。当网络中的设备、服务器数量较多时,为了更加方便,快捷的获得各种监控信息,通常会借助一些集中监测软件。下面...

  • 46
    • 微信 mp.weixin.qq.com 6 years ago
    • Cache

    使用Nagios打造专业的业务状态监控

  • 62

    想必各个公司都有部署zabbix之类的监控系统来监控服务器的资源使用情况、各服务的运行状态,是否这种监控就足够了呢?有没有遇到监控系统一切正常确发现项目无法正常对外提供服务的情况呢?本篇文章聊聊我们如何简单的使用Nagios监控业务...

  • 29

    博文目录一、Nagios1、Nagios介绍2、Nagios主要功能3、Nagios的作用4、Nagios常见的监控状态5、Nagios的原理二、安装LAMP环境三、安装Nagios1、安装Nagios组件2、配置Apache支持Nagios3、配置SendMail邮件四、Nagios监控Linux客户端1、安装依赖程序2、安装Nagios-p...

  • 7

    Use Nagios Core 3 to Monitor Everything, Be Proactive, and Sleep Well If you are a sysadmin, dba, network administrator, or someone who is responsible for keeping the IT infrastructure up and running, the f...

  • 5
    • www.thegeekstuff.com 3 years ago
    • Cache

    How To Monitor Remote Linux Host using Nagios 3.0

    How To Monitor Remote Linux Host using Nagios 3.0 by Ramesh Natarajan on June 1, 2008

  • 1
    • www.vultr.com 2 years ago
    • Cache

    Install Nagios on Ubuntu 20.04

    <?xml encoding="utf-8" ??>Introduction Nagios is an open-source tool for monitoring network applications, services, and other essential network devices. It detects faults through active monitori...

  • 6

    This article was written in 2017 which some information need to be updated by now. In particular the Amazon AMI instance is free now. Nevertheless, sometimes building a AMI for your software platform is needed and therefore I will l...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK