Recently, two Nagios were built, the first work was not recorded, and the time was simple to record the construction process.
System version: CentOS 6.3 64-bit
Software version: nagios-3.4.3.tar.gz
Nagios-plugins-1.4.16.tar.gz
Nrpe.tar.gz
Httpd-2.2.23.tar.gz
Php-5.4.10.tar.gz
This time, I tried to use Yum to install the http,php, but in the end there was no success, given that the boss was eager to compile and install httpd and PHP (nagios3.0 version requires PHP support).
Begin:
1: Check for dependent installations
Rpm-q gcc glibc glibc-common gd gd-devel xinetd openssl-devel if not installed do: yum-y install gcc glibc glibc-common gd gd-devel XINETD Openssl-devel
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/48/4E/wKiom1QGzcTTkITqAAIC7Jqq1Qo350.jpg "title=" 1.jpg " alt= "Wkiom1qgzcttkitqaaic7jqq1qo350.jpg"/> 2: Installing httpd and PHP
Hhtpd:cd/opttar zxvf httpd-2.2.23.tar.gz cd httpd-2.2.23./configure--prefix=/usr/local/services/apache2make Make INS Tall PHP:CD. /tar zxvf php-5.4.10.tar.gz cd php-5.4.10./configure--prefix=/usr/local/services/php--with-apxs2=/usr/local/ Services/apache2/bin/apxsmake make Install
3: Install nagios-plugins and Nrpe
CD/OPT Create Nagios account groupadd nagiosuseradd nagios-s/sbin/nologin-g nagioscat/etc/passwd | grep "Nagios" Nrpe startup script: MV Nrpe/etc/init.d/chmod 755/etc/init.d/nrpe installation Nagios-pluginstar XF Nagios-plugins-1.4.16.tar . gzcd./nagios-plugins./configure--prefix=/usr/local/services/nagios--with-nagios-group=nagios-- With-nagios-user=nagiosmake && make install Nrpecd/opttar XF nrpe.tar.gzcd./nrpe./configure--prefix=/usr/ Local/services/nagios make, install && make install-plugin && make Install-daemon && make Install-daemon-config
4: Install Nagios
Cd/opt/tar zxvf NAGIOS-3.4.3.TAR.GZCD nagios./configure--prefix=/usr/local/services/nagios
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/48/51/wKioL1QG0dzhcTu8AANEjuirN8A796.jpg "title=" 3configure.jpg "alt=" Wkiol1qg0dzhctu8aanejuirn8a796.jpg "/>
Make all
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/48/50/wKiom1QG0lbT2lm2AAOVv15gWH4401.jpg "title=" 4make All.jpg "alt=" Wkiom1qg0lbt2lm2aaovv15gwh4401.jpg "/>
Make install
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/48/51/wKioL1QG0tbCBRj3AAKNejA56UA714.jpg "title=" 5make_ install. jpg "alt=" wkiol1qg0tbcbrj3aakneja56ua714.jpg "/>
Make Install-init
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/48/50/wKiom1QG0yigThUaAAERcNl60_Y748.jpg "title=" 6.jpg " alt= "Wkiom1qg0yigthuaaaercnl60_y748.jpg"/>
Make Install-commandmodemake Install-config
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/50/wKiom1QG002hBUi0AAeiRm_WlsU844.jpg "title=" 7install-commandmode.jpg "alt=" Wkiom1qg002hbui0aaeirm_wlsu844.jpg "/>
Chkconfig--add nagioschkconfig--level nagios onchkconfig--list Nagios
5: Set Login Web Console account password
/usr/local/services/apache2/bin/htpasswd-c/USR/LOCAL/SERVICES/NAGIOS/ETC/HTPASSWD User
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/48/50/wKiom1QG1FDTOBVjAAD1lEL5Ru4891.jpg "title=" 8. JPG "alt=" wkiom1qg1fdtobvjaad1lel5ru4891.jpg "/>5: Configuration httpd.conf
Modify 1:listen 80 (not must be modified) User nagiosgroup nagios modify 2:servername 1.1.1.1:80 (port is not required to be modified) modify 3:<ifmodule dir_module> directoryindex index.html Index.php addtype application/x-httpd-php .php</ifmodule> Add:scriptalias /nagios/cgi-bin "/usr/local/services/nagios/sbin" to httpd.conf last <Directory "/usr/local/services/nagios/sbin" > AuthType Basic Options ExecCGI AllowOverride None Order allow,deny Allow from all authname "Nagios access" authuserfile /usr/local/services/nagios/etc/htpasswd Require valid-user </Directory> Alias /nagios "/usr/local/ Services/nagios/share " <Directory "/usr/local/services/nagios/share "> AuthType Basic Options None AllowOverride None Order allow,deny Allow from all AuthName "nagios Access AuthUserFile /usr/local/services/nagios/etc/htpasswd Require valid-user </Directory> Start httpd/usr/local/services/ Apache2/bin/apachectl start
6: Access a configured URL
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/48/52/wKioL1QG1jHiOnN1AAMQW1owhTM335.jpg "title=" 9.jpg " alt= "Wkiol1qg1jhionn1aamqw1owhtm335.jpg"/>
All the software can be downloaded in my Baidu cloud disk:
Link: Http://pan.baidu.com/s/1ntogYIP Password: M5DQ
This article is from the "on the Road" blog, please be sure to keep this source http://jweiang.blog.51cto.com/8059417/1548378
Nagios Notes "Build"