标题源码安装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