Chinaunix首页 | 论坛 | 博客
  • 博客访问: 246904
  • 博文数量: 61
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 800
  • 用 户 组: 普通用户
  • 注册时间: 2008-02-14 15:18
文章分类

全部博文(61)

文章存档

2011年(4)

2010年(5)

2009年(10)

2008年(42)

我的朋友

分类: BSD

2010-07-02 11:13:08

1. ports install nagios and nagios plugin

2. add web login accounts
/usr/local/apache/bin/htpasswd -c /usr/local/etc/nagios/htpasswd.users nagiosadmin

或 /usr/local/apache/bin/htpasswd /usr/local/etc/nagios/htpasswd.users nagios_user2

3. edit httpd.conf
# Nagios
ScriptAlias /nagios/cgi-bin /usr/local/www/nagios/cgi-bin

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


Alias /nagios /usr/local/www/nagios

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


4. edit configure file
1) contacts.cfg
change notification email address:
email                          raymond@abc.com

2) services.cfg
monitor remote host via nrpe
######################################################################################
# Define services for other hosts via nrpe

define service{
        use                             generic-service
        host_name                       testhost
        service_description             check load
        check_command                   check_nrpe!check_load
        }
*** Must install nrpe in both nagios server and clients. **********

* other config files: hosts.cfg; commands.cfg;

5. install nrpe
# ./configure 

General Options:
-------------------------
NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

# make all

# make install-plugin

# make install-daemon

# make install-daemon-config

# make install-xinetd



6. edit nrpe.conf

allow hosts
define command
eg. command[check_2.abc.com]=/usr/lib64/nagios/plugins/check_http -H abc.com -w 5 -c 10

7. startup nrpe
/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d



阅读(724) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~