系统监控学习笔记(一)nagios---ubuntu下安装nagios

参考nagios文档进行,

开始学习监控。

0.安装apache等必须的东东

 
 
sudo apt-get install apache2
sudo apt-get install build-essential
sudo apt-get install libgd2-dev


libgd2-dev 在7.04中是 libgd2-noxpm-dev 2.0.34~rc1-2ubuntu1.1

1.创建用户
    
 
 
sudo useradd nagios
sudo passwd nagios

不想多创建用户,也可以,config时增加一些参数就好了。
执行后会被默认增加到nagios的group下

2.下载nagios和plugin
wget http: // osdn . dl . sourceforge . net / sourceforge / nagios / nagios- 3 . 0b3 . tar . gz
wget http:
// osdn . dl . sourceforge . net / sourceforge / nagiosplug / nagios-plugins- 1.4 . 9 . tar . gz

3.编译安装

解压配置
tar xzf nagios- 3 . 0b3 . tar . gz
cd  nagios- 3 . 0b3
./ configure --with- command -group = nagios --prefix=/home/zhaofw/work/mon/nagios

或者在指定用户下安装
./configure --with-command-group=zhaofw --with-command-user=zhaofw --with-nagios-group=zhaofw
--with-nagios-user=zhaofw --prefix=/home/zhaofw/work/mon/nagios

将得到如下结果:
*** Configuration summary  for  nagios  3 . 0b3  08 - 30 - 2007  ***:

 General Options:
 -------------------------
          Nagios executable:  nagios
          Nagios user
/ group:  zhaofw ,zhaofw
       
Command  user / group:  zhaofw , zhaofw
             Embedded Perl:  no
               Event Broker:  yes
             Install 
$ {prefix}:   / home/zhaofw/work/mon/nagios
                   Lock file:  
$ {prefix} / var / nagios . lock
       Check result directory:  
$ {prefix} / var / spool / checkresults
               Init directory:  
/ etc / init . d
     Apache conf
. d directory:   / etc / apache2 / conf . d
               Mail program:  
/ bin / mail
                  Host OS:  linux-gnu

 Web Interface Options:
 ------------------------
                 HTML URL:  http:
// localhost / nagios /
                   CGI URL:  http:
// localhost / nagios / cgi-bin /
 Traceroute 
( used by WAP ) :  


Review the options above 
for  accuracy .    If  they look okay ,
type  'make all' to compile the main program and CGIs .

编译安装:
make all
make install
sudo make install-init
make install-config
make install-commandmode

4. 修改一下报警的email地址,在安装目录下的 etc/objects/contacts.cfg文件中。
define contact{
        contact_name      nagiosadmin           
;  Short name of user
        
use                generic-contact          ;  Inherit default values from generic-contact template  ( defined above )
        alias              Nagios Admin          
;  Full name of user
        email              dd@dd
. com   ;   << ***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}

5.web interface配置
sudo make install-webconf

创建一个用户,记住密码哦。
htpasswd -c  ../ etc / htpasswd . users nagiosadmin

重启一下apache
sudo /etc/init.d/apache2 reload

6.安装plugin
./ configure --with-nagios-user = nagios --with-nagios-group = nagios

或者,指定用户
./configure --with-command-group=zhaofw --with-command-user=zhaofw --with-nagios-group=zhaofw 
--with-nagios-user=zhaofw --prefix=/home/zhaofw/work/mon/nagios
make
make install

7.安装结束,可以启动了
sudo  / etc / init . d / nagios  start

8.登录就能看到基本的东西了

http://localhost/nagios/
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值