If the main program and CGIs compiled without any errors, you
can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):
make install
- This installs the main program, CGIs, and HTML files
使用make install来安装主程序,CGI和HTML文件
make install-init
- This installs the init script in /etc/rc.d/init.d
使用make install-init在/etc/rc.d/init.d安装启动脚本
make install-commandmode
- This installs and configures permissions on the
directory for holding the external command file
使用make install-commandmode来配置目录权限
make install-config
- This installs *SAMPLE* config files in /usr/local/nagios/etc
You'll have to modify these sample files before you can
use Nagios. Read the HTML documentation for more info
on doing this. Pay particular attention to the docs on
object configuration files, as they determine what/how
things get monitored!
使用make install-commandmode来安装示例配置文件,安装的路径是/usr/local/nagios/etc
make install-webconf
- This installs the Apache config file for the Nagios
web interface
使用make install-webconf来安装apache的配置文件
[root@cacti-qmail nagios-3.2.0]#make all
[root@cacti-qmail nagios-3.2.0]#make install && make install-init && make install-commandmode && make install-config && make install-webconf 验证程序是否被正确安装
切换目录到安装路径(这里是/usr/local/nagios),看是否存在 etc、bin、 sbin、 share、 var这五个目录,如果存在则可以表明程序被正确的安装到系统了。后表是五个目录功能的简要说明:
bin Nagios执行程序所在目录,nagios文件即为主程序
etc Nagios配置文件位置,初始安装完后,只有几个*.cfg-sample文件
sbin Nagios Cgi文件所在目录,也就是执行外部命令所需文件所在的目录
Share Nagios网页文件所在的目录
Var Nagios日志文件、spid 等文件所在的目录 修改nagios页面文件
[root@cacti-qmail nagios-3.2.1]# more /etc/httpd/conf/nagios.conf
# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
# Last Modified: 11-26-2005
#
# This file contains examples of entries that need
# to be incorporated into your Apache web server
# configuration file. Customize the paths, etc. as
# needed to fit your system.
# SSLRequireSSL
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
Alias /nagios "/usr/local/nagios/share"
# SSLRequireSSL
Options None
AllowOverride None
Order allow,deny
Allow from all
# Order deny,allow
# Deny from all
# Allow from 127.0.0.1
AuthName "Nagios Access"
AuthType Basic AuthUserFile /usr/local/nagios/etc/htpasswd.users
Require valid-user
[root@cacti-qmail ~]# /usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.users killer
New password:
Re-type new password:
Adding password for user killer