2.1 nagios 安装
2017-06-12
nagios 安装
Nagios 官网 http://www.nagios.org
服务器配置
nagios 也需要 apache+php 的环境,CentOS6 默认的 yum 源里没有 nagios 相关的 rpm 包,所以要安装一个 epel 的扩展源。
[root@localhost ~]# yum install -y epel-release
安装 nagios 相关包
[root@localhost ~]# yum install -y httpd nagios nagios-plugins nagios-plugins-all nrpe nagios-plugins-nrpe
设置登录 nagios 后台的用户和密码
[root@localhost ~]# htpasswd -c /etc/nagios/passwd nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin
检查配置文件是否有问题
[root@localhost ~]# nagios -v /etc/nagios/nagios.cfg
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check
启动服务
[root@localhost ~]# service httpd start ; service nagios start
浏览器访问:http://ip/nagios
输入用户名 nagiosadmin,密码是刚刚设置的。
此时,nagios 监控的只有 localhost,还没有其他客户端机器,要想添加监控客户机,还需要在客户端安装 nagios 相关的软件包,并且需要在服务端配置。