centos6.5 源码安装nagios

标题源码安装nagios

1.安装httpd,php以及依赖环境

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

2.配置httpd的配置文件

[root@wss ~]# vim /etc/httpd/conf/httpd.conf

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

AddType application/x-httpd-php .php

[root@wss ~]# service httpd restart
停止 httpd:                                               [确定]
正在启动 httpd:httpd: apr_sockaddr_info_get() failed for wss
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                           [确定]
[root@wss ~]# 

3.创建组和用户

[root@wss ~]# groupadd nagios
[root@wss ~]# useradd -g nagios nagios
[root@wss ~]# 

4.上传nagios源码包,并解压安装

[root@wss ~]# ls
anaconda-ks.cfg              install.log.syslog      公共的  图片  音乐
apache-tomcat-7.0.47.tar.gz  jdk-8u20-linux-x64.rpm  模板    文档  桌面
install.log                  nagios-4.2.4.tar.gz     视频    下载
[root@wss ~]# 
[root@wss ~]# tar zxf nagios-4.2.4.tar.gz 
[root@wss ~]# cd nagios-4.2.4
[root@wss nagios-4.2.4]# ./configure --prefix=/usr/local/nagios

[root@wss nagios-4.2.4]# make all
[root@wss nagios-4.2.4]# make install
[root@wss nagios-4.2.4]# make install-init
[root@wss nagios-4.2.4]# make install-commandmode
[root@wss nagios-4.2.4]# make install-config
[root@wss nagios-4.2.4]# make install-webcon

[root@wss nagios-4.2.4]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:    #这里的密码自己设置
Re-type new password:    #再次确认密码
Adding password for user nagiosadmin
[root@wss nagios-4.2.4]

5.安装插件nagios-plugins压缩包,上传压缩包

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

6.关闭防火墙和selinux

[root@wss nagios-plugins-2.2.1]# service iptables stop
[root@wss nagios-plugins-2.2.1]# setenforce 0
[root@wss nagios-plugins-2.2.1]# 

7.验证nagios是否安装成功

本机网页输入:本机ip+、nagios

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值