欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Nagios+cacti整合项目 一(搭建nagios)

程序员文章站 2022-05-16 20:26:28
...

服务器用的是centos6
关闭防火墙selinux
Nagios+cacti整合项目 一(搭建nagios)
搭建LAMP
安装

yum -y install httpd php openssl-devel gcc gcc-c++

修改配置

[aaa@qq.com ~]#vim /etc/httpd/conf/httpd.conf
#
DirectoryIndex index.php index.html index.html.var  #添加index.php

#
#
AddType application/x-compress .Z
AddType application/x-httpd-php .php    #修改为httpd-php .php
#

编写一个php

[aaa@qq.com ~]#vim /var/www/html/index.php
<?php
        phpinfo();
?>

启动并测试
Nagios+cacti整合项目 一(搭建nagios)
Nagios+cacti整合项目 一(搭建nagios)
上传nagios包
Nagios+cacti整合项目 一(搭建nagios)
创建组和用户
Nagios+cacti整合项目 一(搭建nagios)
解压nagios-4.2.4

[aaa@qq.com ~]# tar zxf nagios-4.2.4.tar.gz
[aaa@qq.com ~]# cd nagios-4.2.4
[aaa@qq.com nagios-4.2.4]# mkdir -p /usr/local/nagios
[aaa@qq.com nagios-4.2.4]# ./configure --prefix=/usr/local/nagios/
[aaa@qq.com nagios-4.2.4]# make all
[aaa@qq.com nagios-4.2.4]# make install
[aaa@qq.com nagios-4.2.4]# make install-init
[aaa@qq.com nagios-4.2.4]# make install-config
[aaa@qq.com nagios-4.2.4]# make install-webconf
[aaa@qq.com nagios-4.2.4]# make install-commandmode
[aaa@qq.com nagios-4.2.4]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin   #输入密码

启动apache和nagios

[aaa@qq.com nagios-4.2.4]# service httpd restart
[aaa@qq.com nagios-4.2.4]# service nagios restart

解压nagios-plugins-2.2.1安装包

[aaa@qq.com ~]# cd
[aaa@qq.com ~]# tar zxf nagios-plugins-2.2.1.tar.gz
[aaa@qq.com ~]# cd nagios-plugins-2.2.1
[aaa@qq.com nagios-plugins-2.2.1]# ./configure --prefix=/usr/local/nagios/
[aaa@qq.com nagios-plugins-2.2.1]# make && make install

测试
Nagios+cacti整合项目 一(搭建nagios)

相关标签: nagios