Nagios安装手册

来源:互联网 发布:mv播放器软件 编辑:程序博客网 时间:2024/05/01 23:05

http://linux.chinaunix.net/techdoc/beginner/2009/08/06/1128623.shtml

Nagios安装手册

来源: ChinaUnix博客  日期: 2009.08.06 09:53 (共有条评论) 我要评论 
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}

  Normal
  0
  
  7.8 磅
  0
  2
  
  false
  false
  false
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  MicrosoftInternetExplorer4



st1\:*{behavior:url(#ieooui) }
/* Style Definitions */
table.MsoNormalTable
        {mso-style-name:普通表格;
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";
        mso-ansi-language:#0400;
        mso-fareast-language:#0400;
        mso-bidi-language:#0400;}


  

Nagios Installation Manual

By Cycle
2009-07-28

一.安装指南(基于Fedora 11平台)
    1.安装前准备
       1.1在root根用户下进行安装 
           su
-l
       1.2安装Apache       
           yum
install httpd
       1.3安装GCC编译器    
           yum
install gcc
       1.4安装GD库与开发库    
           yum
install gd gd-devel
       1.5下载Nagios和插件程序包
           
http://www.nagios.org/download/
           Step
1 - Download Nagios Core
              
http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.1.2.tar.gz
           Step
2 - Download Nagios Plugins
               
http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
           Step
3 - Download Nagios Addons
              
http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.12.tar.gz

    2.安装过程
       2.1建立一个帐号
           2.1.1创建名为nagios的帐号并给定登录密码:
              /usr/sbin/useradd
nagios
              passwd
nagios
           2.1.2创建一个名为nagcmd的用户组用于从Web接口执行外部命令
              /usr/sbin/groupadd
nagcmd
           2.1.3将nagios用户和Apache用户都加入到该用户组中
              /usr/sbin/usermod
-G nagcmd nagios
              /usr/sbin/usermod
-G nagcmd apache
       2.2编译与安装Nagios
           2.2.1展开Nagios源程序包
               tar 
xzf nagios-3.1.2.tar.gz
              cd
nagios-3.1.2
           2.2.2运行Nagios配置脚本并使用先前开设的用户及用户组
              ./configure
–with-command-group=nagcmd
           2.2.3编译Nagios程序包源码
              make
all
2.2.4安装二进制运行程序、初始化脚本、配置文件样本并设置运行目录权限
              make
install
              make
install-init
              make
install-config
              make
install-commandmod                       
       2.3客户化配置
           配置文件样本在/usr/local/nagios/etc/
           编辑/usr/local/nagios/etc/objects/contacts.cfg配置文件
更改email地址,nagiosadmin的联系人定义信息中的email信息为自己的emial信息以接收报警内容
              vi
/usr/local/nagios/etc/objects/contacts.cfg

  
  
   
   
   
   
   
   
   
   
   
   
   
   
  
  
  

  
  
  

       2.4配置Web接口
           2.4.1安装Nagios的Web配置文件到Apache的conf.d目录下
              make
install-webconf
           2.4.2创建一个nagiosadmin的用户用于Nagios的Web接口登录
           htpasswd
-c /usr/local/nagios/etc/htpasswd.users nagiosadmin
           2.4.3重启Apache服务以使设置生效
              service
httpd restart

       2.5编译与安装Nagios插件
           2.5.1展开Nagios插件的源程序包
              tar
xzf nagios-plugins-1.4.13.tar.gz
              cd
nagios-plugins-1.4.13
           2.5.2编译并安装插件
              ./configure
--with-nagios-user=nagios --with-nagios-group=nagios
              make
              make
install
       2.6启动Nagios
           2.6.1把Nagios加入到服务列表中以使之在系统启动时自动启动
              chkconfig
--add nagios
              chkconfig
nagios on
           2.6.2验证Nagios的样例配置文件
           /usr/local/nagios/bin/nagios
-v /usr/local/nagios/etc/nagios.cfg


           2.6.3如果没有报错(如上图),则可以启动Nagios服务
              service
nagios start
           2.6.4若样例配置文件出错,则根据错误提示回退到上面步骤进行排错
       2.7更改SELinux设置
2.7.1 Fedora与SELinux同步发行与安装后将默认使用强制模式,这会在尝试联入Nagios的CGI时导致一个"内部服务错误"消息
           2.7.2编辑/etc/selinux/config
              vi
/etc/selinux/config
           2.7.3修改SELINUX字段值令SELinux处于容许模式
              SELINUX=enforcing改为SELINUX=permissive
       2.8登录Web接口
           2.8.1用系统默认安装的浏览器,登入http://localhost/nagios/
  
  
  


           2.8.2成功登录Web接口
  
  
  

Click here to open new windowCTRL+Mouse wheel to zoom in/out
                
                
                

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/102852/showart_2019360.html 发表评论 查看评论(共有条评论)  


最新资讯更多>> · 谷歌劝说诺基亚采用Android操作..
· Apache 基金会确认退出 JCP 执..
· Chrome 10 新功能探秘:新增GP..
· 金山宣布开源其安全软件
· 女黑客在开源会议上抱受骚扰
· 21款值得关注的Linux游戏
· 马化腾:腾讯半年后彻底转型,..
· [多图] Chrome OS 预发布版本多..
· Lubuntu 11.04 默认应用抢先一览
· Red Hat宣布收购云计算软件提供..论坛热点更多>> · do_execve时候用户栈中参数的..
· swapinfo -atm 问题
· Linux 的优点简述
· VM虚拟机上得Red Hat Linux上..
· 我看成了上海男人喜欢女人毛..
· 校车展览,看了你就知道
· 在遇到他之前,唯一需要做的..
· GRUB的疑问
· 从来没有人真正付足书价——..
· 云存储 vs 网盘
原创粉丝点击