Chinaunix首页 | 论坛 | 博客
  • 博客访问: 423188
  • 博文数量: 81
  • 博客积分: 2830
  • 博客等级: 少校
  • 技术积分: 1445
  • 用 户 组: 普通用户
  • 注册时间: 2006-11-24 09:19
文章分类

全部博文(81)

文章存档

2011年(1)

2010年(34)

2009年(16)

2008年(30)

我的朋友

分类: LINUX

2008-03-21 12:12:55

首先要安装apache。要启用cgi模块。
 
一、下载最新的软件包nagios-3.0.tar.gz
   wget
   tar zxvf nagios-3.0.tar.gz
   cd nagios-3.0
   mkdir /usr/local/nagios
   useradd -s /sbin/nologin nagios
   chown nagios.nagios /usr/local/nagios
   ./configure --prefix=/usr/local/nagios
   make
   make install
   make install-init
   make install-commandmode
   make install-config
 
二、安装nagios-plugs
   wget
   tar zxvf nagios-plugins-1.4.11.tar.gz
   cd nagios-plugs-1.4.11
   ./configure --prefix=/usr/local/nagios
   make
   make install
   vi /usr/local/apache/conf/httpd.conf
   添加:
    ScriptAlias /nagios/cgi-bin /usr/local/nagios/sbin

    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/passwd
    Require valid-user

Alias /nagios /usr/local/nagios/share

    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /usr/local/nagios/etc/passwd
    Require valid-user
##############################
  htpasswd -c /usr/local/nagios/etc/passwd nagiosadmin
/usr/local/apache/bin/apachectl restart
/etc/init.d/nagios start
 
就可以访问到默认的监控本机的服务了。接下来就可以装其他的插件了,休息一下再来。
 
三、安装nrpe
 
wget

tar xzf nrpe-2.8.tar.gz
cd nrpe-2.8

./configure
make all

make install-plugin
make install-daemon
make install-daemon-config

make install-xinetd
Edit the /etc/xinetd.d/nrpe file and add the IP address of the monitoring server to the only_from directive.

only_from = 127.0.0.1
Add the following entry for the NRPE daemon to the /etc/services file.
nrpe 5666/tcp # NRPE
Restart the xinetd service.
vi /etc/services
增加:
nrpe     5666/tcp    #nrpe
 
service xinetd restart

netstat -at | grep nrpe
The output out this command should show something like this:
tcp 0 0 *:nrpe *:* LISTEN
 
然后修改防火墙的规则:
iptables -I RH-Firewall-1-INPUT -p tcp -m tcp –dport 5666 -j ACCEPT
service iptables save
 
vi /usr/local/nagios/etc/nrpe.cfg
 
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_users
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_load
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_hda1
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_total_procs
/usr/local/nagios/libexec/check_nrpe -H localhost -c check_zombie_procs
 
 
阅读(860) | 评论(0) | 转发(0) |
0

上一篇:安装cacti报错

下一篇:安装nagios 报错!

给主人留下些什么吧!~~