Nagios安装
1.环境
Centos6.5
ip:192.168.189.120
Centos6.5(被监控端)
ip: 192.168.189.130
2.搭建LAMP环境并安装所需要的工具和库
yum -y install httpd php openssl-devel gcc gcc-c++
3.安装Nagios
上传安装包到服务器
4.安装Nagios核心程序
5.创建组和用户
groupadd nagios
useradd -g nagios nagios
6.解压
tar zxf nagios-4.0.3.tar.gz
7.切换目录
cd nagios-4.0.3
8.检测环境并指定安装路径
./configure --prefix=/usr/local/nagios
9.编译
make all
10.安装Nagios程序的主要文件
make install
11.安装Nagios服务init脚本
make install-init
12.安装Nagios配置文件目录
make install-config
13.安装Nagios网页配置文件
make install-webconf
14.安装Nagios权限相关
make install-commandmode
15.生成Nagios网页认证文件并创建用户
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
16.关闭防火墙
service iptables stop
setenforce 0
17.启动Nagios和Apache
service httpd restart
service nagios restart
18.安装Nagios-plugins插件
cd /root/
tar zxf nagios-plugins-1.5.tar.gz
cd nagios-plugins-1.5
./configure --prefix=/usr/local/nagios
make
make install
19.浏览器访问:
http://192.168.189.120/nagios
20.Nagios主配置文件
nagios.cfg
21.路径整理
Nagios安装目录:/usr/local/nagios
Nagios插件目录:/usr/local/nagios/libexec
Nagios配置文件目录:/usr/local/nagios/etc
22.配置文件整理
Nagios主配置文件:/usr/local/nagios/etc/nagios.cfg
Nagios定义命令的配置文件:/usr/local/nagios/etc/objects/commands.cfg
Nagios定义联系人的配置文件:/usr/local/nagios/etc/objects/contacts.cfg
Nagios定义监控windows系统的配置文件:/usr/local/nagios/etc/objects/windows.cfg
Nagios定义监控本机的配置文件:/usr/local/nagios/etc/objects/localhost.cfg
Nagios定义模板的配置文件:/usr/local/nagios/etc/objects/templ