nagios安装,网上太多了,这个是自己安装后的手记。

nagios安装

下载:wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
安装:
tar -zxvf nagios-3.2.0.tar.gz
cd nagios-3.2.0
./configure –prefix=/usr/local/nagios –with-command-group=nagcmd
make all
make all完毕后有如下提示:
“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-init
     – This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     – This installs and configures permissions on the
       directory for holding the external command file

  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-webconf
     – This installs the Apache config file for the Nagios
       web interface”
依次运行如下命令:
make install
make install-init
make install-commandmode
make install-config
make install-webconf
给nginx添加认证:
修改nginx的配置文件如下:
    location /nagios/ {
    alias /usr/local/nagios/share/;
    index index.html index.htm index.php;
    auth_basic “nagios”;
    auth_basic_user_file /usr/local/nagios/etc/htpasswd admin
    }
生成htpasswd文件:
/usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd admin
其中htpasswd是apache提供的工具
配置nagios
nagios web界面提示
It appears as though you do not have permission to view information for any of the services you requested…
打开cgi.cfg配置文件,里面有个参数:
use_authentication=1
为了保障系统的安全性,nagios设置了这个参数,默认为1,改为0即可

 

配置:
下载插件:
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
tar -zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure –prefix=/usr/local/nagios
make
make install
配置附件:
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz
tar -zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure –prefix=/usr/local/nagios
make all
make install-plugin
make install-daemon
make install-daemon-config
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
返回:[root@localhost nrpe-2.12]# /usr/local/nagios/libexec/check_nrpe -H localhost
      NRPE v2.12
完成。
配置perl,cgi,nginx

关于鸡鸡哥的聪明伶俐的儿子和如花似玉的老婆

嗜抽烟,嗜吃肉,常睡觉晚起,熬夜,看新闻,喜体育栏目,会操作电脑,会操作服务器,能做些别人不屑于做的事情。厌做饭,恶洗碗,不洗澡,不刷牙,不剃胡须,不喜逛超市,重压之下偶去之,无上进心,无恒心,无毅力。 1988-1998年,虚度人生 2001-2013年,懵懵懂懂忽然就有孩子有老婆有,匆匆间父亲去世,匆匆半个人生没有了 2013- 知道自己需要什么,知道自己该做什么,知道自己的是个什么样的人,重新上路,明明白白活自己。 ------鸡鸡哥 2013.02.28 老了,以后得改称老鸡鸡哥了,继续努力吧 -----鸡鸡哥 20150517
此条目发表在环境搭建, 监控系统分类目录,贴了标签。将固定链接加入收藏夹。

发表评论