本文只是记录nagios的安装步骤,只是最基本的安装,具体配置还实验,详细配置有待补充,废话不多说,开始搞吧!!

   操作系统:rhel 5

   所需软件包:nagios-3.2.0.tar.gz       nagios-cn-3.2.0.tar.bz2

               nagios-plugins-1.4.15.tar.gz 

   软件包下载地址:(以下软件包均不是最新版本,如果想尝试新版本,请你下载最新版本实验,不过可能会出现一点点小问题哦,嘿嘿~)

    nagios-3.2.0.tar.gz

    http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.2.0/nagios-3.2.0.tar.gz/download

    nagios-plugins-1.4.15.tar.gz

    http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download

    nagios-cn-3.2.0.tar.bz2

    http://sourceforge.net/projects/nagios-cn/files/sourcecode/zh_CN%203.2.0/nagios-cn-3.2.0.tar.bz2/download

    后边还会需要nrpe-2.12.tar.gz这里地址先记下

    nrpe-2.12.tar.gz

    http://sourceforge.net/projects/nagios/files/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz/download?use_mirror=cdnetworks-kr-1

    OK!安装包都有了,开始安装吧!

  1.首先安装软件之间对系统所需的软件包安装好

   yum -y install gd gd-devel libpng libpng-devel libjpeg libjpeg-devel zlib zlib-devel httpd php php-devel

  2.创建nagios用户和组

   [root@localhost]#useradd nagios

   [root@localhost]#groupadd nagios

   [root@localhost]#usermod -a -G nagios nagios

   [root@localhost]#usermod -a -G apahce nagios

  3.开始安装nagios

    1).编译nagios-3.2.0

   [root@localhost nagios]#tar zxvf nagios-3.2.0.tar.gz

   [root@localhost nagios]#cd nagios-3.2.0

   [root@localhost nagios]#./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios

   [root@localhost nagios]#make all

   [root@localhost nagios]#make install && make install-init && make install-commandmode && make install-config && make install-webconf

   2).编译nagios-plugins

   [root@localhost nagios]tar zxvf nagios-plugins-1.4.15.tar.gz

   [root@localhost nagios]cd nagios-plugins-1.4.15

   [root@localhost nagios]./configure --prefix=/usr/local/nagios

   [root@localhost nagios] make && make install

   3).安装中文插件nagios-cn

   [root@localhost nagios]tar jxvf nagios-cn-3.2.0.tar.bz2

   [root@localhost nagios]cd nagios-cn-3.2.0

   [root@localhost nagios]./configure --prefix=/usr/local/nagios/

   [root@localhost nagios]make all

   [root@localhost nagios]make install

 OK,到这里基本就算完成了,不过我们还需要做一点点设置。

   4.使用htpasswd创建密码验证文件,在使用IE登陆的时候需要的用户名密码哦

   [root@localhost]htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

   输入两次密码后,就可以了哦。

   在IE输入http://IP/nagios/就可以登陆了哦