Installation of the monitoring software Nagios

Source: Internet
Author: User

1. Install software dependency packages and create Nagios users

[email protected] ~]# Yum install gcc gcc-c++ make-y

[Email protected] ~]# groupadd-g Nagios
[Email protected] ~]# useradd-r-u 500-s/sbin/nologin-g nagios Nagios
[Email protected] ~]#


2. Installing Apache and PHP environments

[email protected] ~]# Yum install httpd php*-y

[Email protected] ~]# vim/etc/httpd/conf/httpd.conf

User Nagios
Group Nagios

ServerName localhost

DirectoryIndex index.php index.html Index.html.var

AddType application/x-httpd-php. php

[Email protected] ~]# vim/var/www/html/index.php
<?php
Phpinfo ();
?>

[Email protected] ~]#/etc/init.d/httpd restart
stopping httpd: [OK]
Starting httpd: [OK]
[Email protected] ~]#

Test access:

650) this.width=650; "title=" 1.jpg "alt=" wkiol1ubhxmrxohyaauqek9dyli568.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 5c/21/wkiol1ubhxmrxohyaauqek9dyli568.jpg "/>

3. Installing the Nagios monitoring software

[Email protected] ~]# wget http://softlayer-sng.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.8/ Nagios-4.0.8.tar.gz

[Email protected] ~]# wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz

[Email protected] ~]# tar xvf nagios-4.0.8.tar.gz

[Email protected] nagios-4.0.8]#/configure--prefix=/usr/local/nagios-4.0.8

[[email protected] nagios-4.0.8]# make all

[[email protected] nagios-4.0.8]# make install

[email protected] nagios-4.0.8]# make Install-init

[email protected] nagios-4.0.8]# make Install-commandmode

[email protected] nagios-4.0.8]# make Install-config

[email protected] nagios-4.0.8]# make install-webconf

[email protected] nagios-4.0.8]# make Install-exfoliation

[email protected] nagios-4.0.8]# make Install-classicui

[Email protected] nagios-4.0.8]# ll/usr/local/nagios-4.0.8/
Total 24
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 13:59 Bin-executable file
Drwxrwxr-x. 3 Nagios nagios 4096 APR 1 etc--configuration file
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 13:59 libexec--Plugins
Drwxrwxr-x. 2 Nagios nagios 4096 APR 1 13:59 sbin--nagios cgi file directory
Drwxrwxr-x. Nagios nagios 4096 APR 1 13:59 Share--web file
Drwxrwxr-x. 5 Nagios nagios 4096 APR 1 13:59 var--log file

[Email protected] nagios-4.0.8]# CD. /
[Email protected] ~]# tar xvf nagios-plugins-2.0.3.tar.gz

[Email protected] ~]# CD nagios-plugins-2.0.3
[[email protected] nagios-plugins-2.0.3]# ll/usr/local/nagios-4.0.8/libexec/--nagios No plugins
Total 0

[Email protected] nagios-plugins-2.0.3]#/configure--prefix=/usr/local/nagios-4.0.8/

[[email protected] nagios-plugins-2.0.3]# make && make install

[Email protected] nagios-plugins-2.0.3]# ll/usr/local/nagios-4.0.8/libexec/| Head-3--nagios has a plugin.
Total 6028
-rwxr-xr-x. 1 root root 179202 Apr 1 14:07 check_apt
-rwxr-xr-x. 1 root root 2249 Apr 1 14:07 check_breeze
[Email protected] nagios-plugins-2.0.3]#

5.apache Integrated Nagios Monitoring

[Email protected] nagios-plugins-2.0.3]# cd/etc/httpd/conf/
[Email protected] conf]# vim httpd.conf

Scriptalias/nagios/cgi-bin "/usr/local/nagios-4.0.8/sbin"
<directory "/usr/local/nagios-4.0.8/sbin" >
AuthType Basic
Options execcgi
AllowOverride None
Order Allow,deny
Allow from all
AuthName "Nagios Access"
AUTHUSERFILE/USR/LOCAL/NAGIOS-4.0.8/ETC/HTPASSWD--Files used for this directory access authentication
Require Valid-user
</Directory>
Alias/nagios "/usr/local/nagios-4.0.8/share"--Define aliases
<directory "/usr/local/nagios-4.0.8/share" >
AuthType Basic
Options None
AllowOverride None
Order Allow,deny
Allow from all
AuthName "Nagios Access"
authuserfile/usr/local/nagios-4.0.8/etc/htpasswd
Require Valid-user
</Directory>

[Email protected] conf]# htpasswd-c/usr/local/nagios-4.0.8/etc/htpasswd Tong
New Password:
Re-type New Password:
Adding Password for user Tong

[Email protected] conf]#/etc/init.d/httpd restart
stopping httpd: [OK]
Starting httpd: [OK]
[Email protected] conf]#/etc/init.d/nagios restart
Running Configuration Check ...
Stopping Nagios:. Done.
Starting Nagios:done.
[Email protected] conf]#

Test results:

650) this.width=650; "title=" 2.jpg "alt=" wkiom1ubkketeaksaatieqhcay8831.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 5c/28/wkiom1ubkketeaksaatieqhcay8831.jpg "/>

650) this.width=650; "title=" 2.jpg "alt=" wkiol1ubj5pbvau2aatieqhcay8811.jpg "src=" http://s3.51cto.com/wyfs02/M02/ 5c/22/wkiol1ubj5pbvau2aatieqhcay8811.jpg "/>

This article is from the "Days Together" blog, please be sure to keep this source http://tongcheng.blog.51cto.com/6214144/1627275

Installation of the monitoring software Nagios

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.