【linux系统下载_学习_教程_编程_软件】提供全系列Linux发行版下载学习-Linux部落
当前位置: 主页 > Linux系统教程 > 监控 >

CentOS系统nagios编译安装

时间:2017-09-18 09:25来源:原创 作者:admin 点击:
------分隔线----------------------------
系统环境:CentOS 6.8

1.安装php+apache
#yum -y install httpd php

2.安装nagios服务端
#yum -y install gd-devel             #装了这个才会有statusmap.cgi和trends.cgi
#useradd nagios
#./configure --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
#make all
#make install
#make install-init
#make install-commandmode
#make install-config
#make install-webconf
#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

3.安装监控插件nagios-plugins
#cd nagios-plugins-x.x.x
#./configure
#make
#make install


4.配置Apache
#vim /etc/httpd/conf.d/nagios
<VirtualHost *:80>
    DocumentRoot "/usr/local/nagios/share"
    ServerName www.nagios.com
ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">
   Options ExecCGI
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>

Alias /nagios "/usr/local/nagios/share"
<Directory "/usr/local/nagios/share">
   Options None
   AllowOverride None
   Order allow,deny
   Allow from all
   AuthName "Nagios Access"
   AuthType Basic
   AuthUserFile /usr/local/nagios/etc/htpasswd.users
   Require valid-user
</Directory>
</VirtualHost>

#service httpd restart
#service nagios start

5.被监控端安装:
#useradd nagios
#yum install openssl-devel
#cd nagios-nrpe_x.x
#./configure
#make all
#make install-plugin
#make install-daemon
#make install-daemon-config

#cd nagios-plugins-x.x.x
#chmod 777 *
#./configure
#make
#make install

启动nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d

nagios安装完成,访问会显示版本号等信息,具体配置后续将继续更新,敬请期待
CentOS系统nagios编译安装


本文地址:http://www.linuxzone.net/monitor/215.html
------分隔线----------------------------
栏目列表