成都网站建设设计

将想法与焦点和您一起共享

nagios笔记【搭建】-创新互联

最近搭建了两次nagios,第一次工作忙碌没有记录下过程;这次抽了时间简单的记录了搭建过程。

公司主营业务:成都网站设计、成都做网站、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联建站是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联建站推出鄢陵免费做网站回馈大家。

  系统版本:centos 6.3 64位

  软件版本: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

  这次尝试了利用yum安装的http,php;可惜到最后没有成功,鉴于老大那里急着要只有编译安装了httpd和php(nagios3.0版本需要php的支持)。

开始:

  1:检查依赖安装

rpm -q gcc glibc glibc-common gd gd-devel xinetd openssl-devel
如果没有安装请执行:
yum -y install gcc glibc glibc-common gd gd-devel xinetd openssl-devel

nagios笔记【搭建】  2:安装httpd和php

HHTPD:
cd /opt
tar zxvf  httpd-2.2.23.tar.gz   
cd httpd-2.2.23 
./configure --prefix=/usr/local/services/apache2
make 
make install 

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/apxs
make 
make install

3:安装 nagios-plugins和nrpe

cd /opt

创建nagios账号
groupadd  nagios
useradd   nagios  -s /sbin/nologin -g nagios
cat  /etc/passwd  | grep "nagios"

nrpe的启动脚本:
mv  nrpe    /etc/init.d/
chmod 755 /etc/init.d/nrpe

安装nagios-plugins
tar xf nagios-plugins-1.4.16.tar.gz
cd ./nagios-plugins
./configure --prefix=/usr/local/services/nagios --with-nagios-group=nagios --with-nagios-user=nagios
make && make install

安装nrpe
cd  /opt
tar xf nrpe.tar.gz
cd ./nrpe
./configure --prefix=/usr/local/services/nagios
 make all
 make install && make install-plugin && make install-daemon && make install-daemon-config

4:安装nagios

cd /opt/
tar zxvf nagios-3.4.3.tar.gz
cd nagios
./configure --prefix=/usr/local/services/nagios

nagios笔记【搭建】

make all

 nagios笔记【搭建】

make install

nagios笔记【搭建】

make install-init

nagios笔记【搭建】

make install-commandmode
make install-config

nagios笔记【搭建】

chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --list nagios

5:设置登陆web控制台账号密码

 /usr/local/services/apache2/bin/htpasswd -c /usr/local/services/nagios/etc/htpasswd user

nagios笔记【搭建】5:配置httpd.conf

修改1:

Listen 80 (不是必须要修改)
User nagios
Group nagios

修改2:

ServerName  1.1.1.1:80 (端口不是必须要修改)

修改3:


    DirectoryIndex index.html index.php
    AddType application/x-httpd-php .php


在httpd.conf最后添加:

ScriptAlias /nagios/cgi-bin "/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 
 
Alias /nagios "/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 


启动httpd

/usr/local/services/apache2/bin/apachectl start

 6:访问配置好的URL

  nagios笔记【搭建】

所有软件都可以在我的百度云盘下载:

链接:http://pan.baidu.com/s/1ntogYIP 密码:m5dq

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站栏目:nagios笔记【搭建】-创新互联
分享路径:http://chengdu.cdxwcx.cn/article/diigjc.html