Build Nagios under CentOS 6.5

Source: Internet
Author: User

Nagios is a great monitoring tool that can help you monitor your network's servers and so on, and has the ability to alert you to email issues, and can combine Nagios's hardware to monitor the temperature of your room and check and alarm in real time.

The free version of Nagios can only monitor 7 units (not clear or 6 units), but for small businesses, it should be enough for a few important servers to be monitored by nagios in real time.

Configuration environment: 1) CentOS 6.5 as a monitoring host, ip:10.0.0.30 (according to your company needs to change)

2) Client: Windows Server 2008R2, Windows 7, Windows 8.1

Step 1: Install the required packages

Yum install-y httpd php gcc glibc glibc-common gd gd-devel make NET-SNMP

Step 2: Create Nagios users and Nagcmd groups

Useradd Nagios

Groupadd Nagcmd

Join Nagios and Apache to the Nagcmd group

Usermod-g Nagcmd Nagios

Usermod-g Nagcmd Apache

Step 3: Download Nagios Core 4.01 and Nagios Plugin 1.5

To create a folder for Nagios:

Mkdir/root/nagios

Cd/root/nagios

Download Nagios Related packages:

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

wget https://www.nagios-plugins.org/download/nagios-pulgins-1.5.tar.gz

Step 4: Unzip:

TAR-XVF nagios-4.0.1.tar.gz

TAR-XVF nagios-plugins-1.5.tar.gz

Configure Nagios:

We need to check to see if everything is OK and then go on:

CD nagios-4.0.1

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

When the following typeface appears, everything is OK:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/36/52/wKiom1OrljDgy98pAACweV1DJ1I833.jpg "title=" 1.JPG " alt= "Wkiom1orljdgy98paacwev1dj1i833.jpg"/>

You can now compile and install the following:

Make all

Make install

When the following typeface appears, you can continue:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/36/59/wKiom1Orluuio9q2AACDxsoHqYA101.jpg "title=" 1.JPG " alt= "Wkiom1orluuio9q2aacdxsohqya101.jpg"/>

Go on:

Make Install-init

Make Install-commandmode

Make Install-config

You can continue when the following words appear:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/36/60/wKiom1Orl06DDukJAAEh4k64M0Y215.jpg "title=" 1.JPG " alt= "Wkiom1orl06ddukjaaeh4k64m0y215.jpg"/>


Step 5: Customize the configuration of Nagios:

To configure the Contacts.cfg file, set your own email address:

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

Step 6: Install and configure the Web interface:

Make install-webconf

Htpasswd-s-c/usr/local/nagios/etc/htpasswd.users nagiosadmin (enter password)

Restart Apache to take effect:

Service httpd Start

Step 7: Compile and install the plugin:

Cd/root/nagios

CD nagios-pulgins-1.5

./comfigure--with-nagios-user=nagios--with-nagios-group=nagios

Make

Make install

Step 8: Check that the Nagios configuration file is correct:

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

When the following words indicate correct:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/36/7C/wKioL1OrnbrDGjNXAABR-g55LoA070.jpg "title=" 1.JPG " alt= "Wkiol1ornbrdgjnxaabr-g55loa070.jpg"/>

Step 9: Boot up;

Chkconfig--add Nagios

Chkconfig--level and Nagios on

Chkconfig--add httpd

Chkconfig--level + HTTPS on

Service Nagios Start

At this point, Nagios server configuration is successful, open the browser, enter your server's Http://IP/nagios input nagiosadmin and above that you set the password on it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.