#安装nagios
yum -y install nagios-*
#启动服务
netstat -anp|grep 80
systemctl start httpd
systemctl start nagios
#浏览器查看 http://虚拟机IP/nagios
#修改密码
htpasswd -c /etc/nagios/passwd nagiosadmin
#写脚本
/usr/lib64/nagios/plugins/
vim 监控脚本
chmod 755 脚本
#定义脚本
vim /etc/nagios/objects/commands.cfg
#定义监控
vim /etc/nagios/objects/localhost.cfg
#检查
nagios -v /etc/nagios/nagios.cfg
#重启服务
systemctl restart nagios
#浏览器查看 http://虚拟机IP/nagios