2、添加Nagios用户和组
[root@nagios ~]# useradd nagios
[root@nagios ~]# passwd nagios
[root@nagios ~]# groupadd nagcmd
[root@nagios ~]# usermod -a -G nagcmd nagios
3、编译与安装Nagios
[root@nagios ~]# tar -zxvf nagios-3.4.4.tar.gz
[root@nagios ~]# cd nagios
[root@nagios nagios]#./configure --with-command-group=nagcmd //编译Nagios 配置脚本并使用先前开设的用户及用户组
[root@nagios nagios]#make all //编译Nagios 程序包源码
*** Compile finished ***
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 //使用make install来安装主程序,CGI和HTML文件
- This installs the main program, CGIs, and HTML files
make install-init //使用make install-init在/etc/rc.d/init.d安装启动脚本
- This installs the init script in /etc/rc.d/init.d
make install-commandmode //使用make install-commandmode来配置目录权限
- This installs and configures permissions on the
directory for holding the external command file
make install-config //把配置文件的例子复制到nagios的安装目录: /usr/local/nagios/etc
- 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-webconf //安装Nagios 的WEB 配置文件到Apache 的conf.d 目录下
- This installs the Apache config file for the Nagios
web interface
make install-exfoliation
- This installs the Exfoliation theme for the Nagios
web interface
make install-classicui
- This installs the classic theme for the Nagios
web interface
*** Support Notes *******************************************
7、防火墙配置
如果WEB无法访问,检查一下IPtables是否关闭。
[root@nagios ~]# service iptables status
添加httpd 80端口:
[root@nagios ~]# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT