Installing Nagios under Linux

Source: Internet
Author: User

This article describes installing Nagios on a Linux host and monitoring this machine.

Experimental environment: rhel5.6, nagios-3.2.3.tar.gz, nagios-plugins-1.4.15.tar.gz

Experimental process:

A small shortcut to this experiment is to install Apache first, then unzip Nagios, copy the extracted Dosc documents to/var/www/html, and then access Http://localhost/docs through the Linux browser. Check out the Nagios installation documentation to get more out of the official installation documents.

The selinux must be switched off before installing Nagios (Root#setenforce 0)

Before the experiment to install the program has Apache, PHP, GCC, GD, etc., you can use Yum clean sweep.

Root#yum install-y httpd php gcc glibc glibc-common gd gd-devel

Create the Nagios user and set the password:

Root#/usr/sbin/useradd-m Nagios

ROOT#PASSWD Nagios

Create a group to submit commands in the Web interface and add Nagios users and Apache users to the group:

Root#/usr/sbin/groupadd Nagcmd

Root#/usr/sbin/usermod-a-G Nagcmd Nagios

Root#/usr/sbin/usermod-a-G Nagcmd Apache

Unzip the copy or downloaded Nagios package to install:

If you are downloading on the Internet, you can use this method:

Root#mkdir Download

ROOT#CD Download

Root#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz

Root#wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz

Unzip the installation:

ROOT#TAR-ZXF nagios**

ROOT#CD nagios**

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

Compile the Nagios source code (note the prompt at installation)

Root#make All

Install binary:

Root#make Install

To install the initialization script:

Root#make Install-init

To install the Nagios sample configuration file:

Root#make Install-config

To set command directory permissions:

Root#make Install-commandmode

To access the user profile, edit the user information:

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

Installing the Nagios Web configuration file

Root#make install-webconf

Set Login Nagios web page user name password:

root# htpasswd-c/usr/local/nagios/etc/htpasswd.users Nagiosadmin

To restart the Apache server:

Root#service httpd Restart


The following begins the decompression and installation of the Nagios-plugins plugin:

ROOT#TAR-ZXF Nagios-plugins

ROOT#CD Nagios-plugins

Root#./configure--with-nagios-user=nagios--with-nagios-group=nagios

Root#make

Root#make Install

Add Nagios to the list of system services:

Root#chkconfig--add Nagios

Set up Nagios to start from the Linux command interface and the graphical interface:

Root#chkconfig--level and Nagios on

Check that the Nagios configuration file is correct:

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

Look at the prompt message, and if there are no errors, start the Nagios service:

Root#service Nagios Start


Here, you can login to the Linux system browser, enter: Http://localhost/nagios in the Address bar, you can see the Nagios monitoring screen:, but here is monitoring the local resources, you want to monitor other machines also need to do some work.

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/27/32/wKioL1Nw4VjSZW0GAALJlNBJNT0469.jpg "title=" Nagios.png "alt=" Wkiol1nw4vjszw0gaaljlnbjnt0469.jpg "/>


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.