先运行nagios配置脚本,配置用户组,然后编译。编译完成以后安装二进制文件,init脚本,示例配置文档,然后给命令设置权限。经过漫长的等待,终于完成了。
接下来,按照我们安装过N个服务的经验就是修改配置文档了,nagios也不例外:
Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You'll need to make just one change before you proceed...
Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you'd like to use for receiving alerts.
vi /usr/local/nagios/etc/objects/contacts.cfg
上面这段说配置文档模板被放在/usr/local/nagios/etc目录下,编辑/usr/local/nagios/etc/objects/contacts.cfg文件,修改EMAIL地址。
如上图,改成了root@localhost。 Install the Nagios web config file in the Apache conf.d directory.
make install-webconf
Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account - you'll need it later.
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
Restart Apache to make the new settings take effect.
service httpd restart
接下来该改apache的配置了,这里就奇怪了,网上有很多文档都是修改/etc/httpd/conf/httpd.conf文件,这里说安装nagios的web配置文档在conf.d目录下。我们先看下conf.d下有哪些东东: