输出示例:
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/objects/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg/usr/bin/install -c -b -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/templates.cfg /usr/local/nagios/etc/objects/templates.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/commands.cfg /usr/local/nagios/etc/objects/commands.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/contacts.cfg /usr/local/nagios/etc/objects/contacts.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/timeperiods.cfg /usr/local/nagios/etc/objects/timeperiods.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/localhost.cfg /usr/local/nagios/etc/objects/localhost.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/windows.cfg /usr/local/nagios/etc/objects/windows.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/printer.cfg /usr/local/nagios/etc/objects/printer.cfg/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/switch.cfg /usr/local/nagios/etc/objects/switch.cfg*** Config files installed ***Remember, these are *SAMPLE* config files. You'll need to readthe documentation for more information on how to actually defineservices, hosts, etc. to fit your particular needs.
步骤5:自定义nagios配置文件
打开“contacts.cfg”文件编辑当出现报警状态时候的nagios管理员的电子邮箱
[root@taoteng nagios-4.0.1]# vi /usr/local/nagios/etc/objects/contacts.cfg
输出样例:
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################
# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the 'generic-contact'
# template which is defined elsewhere.
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email xiantao412@sina.com ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
步骤6:安装和配置Nagios的web接口
到目前为止,我们已经完成了所有的配置,接下来将用下面的命令来配置Nagios的web接口。
下面的命令将配置web接口并同时创建一个“nagiosadmin”管理用户。
[root@taoteng nagios-4.0.1]# make install-webconf
接下来的这步将会创建一个密码为“nagiosadmin”记住这个密码,因为待会儿在浏览器中登录的时候将会用到这个密码。
[root@taoteng nagios-4.0.1]# htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password:
Re-type new password:
Adding password for user nagiosadmin
重启Apache服务使新的配置生效。
[root@taoteng nagios-4.0.1]# service httpd restart (On RedHat/CentOS)
[root@taoteng nagios-4.0.1]# systemctl start httpd.service (On Fedora)
Nagios 的详细介绍:请点这里
Nagios 的下载地址:请点这里
相关阅读: