配置服务端配置文件
- 备份etc目录
cd /usr/local/nagios/ tar zcvf etc.tar.gz ./etc/
- 配置nagios.cfg
包含services和hosts文件
包含services目录vim etc/nagios.cfg cfg_file=/usr/local/nagios/etc/objects/services.cfg cfg_file=/usr/local/nagios/etc/objects/hosts.cfg #注释localhost.cfg,不使用此功能,将服务器端当做nagios客户端来监控 #cfg_file=/usr/local/nagios/etc/objects/localhost.cfg
创建services目录cfg_dir=/usr/local/nagios/etc/services
mkdir /usr/local/nagios/etc/services chown -R nagios.nagios /usr/local/nagios/etc/services/
生成host.cfg文件
生成services.cfg文件cd /usr/local/nagios/etc/objects/ head -51 localhost.cfg >hosts.cfg chown nagios.nagios /usr/local/nagios/etc/objects/hosts.cfg
touch