Cents下Nagios的安装-Nagios主程序的安装

运维 系统运维
Nagios主程序的安装:Nagios是什么?Nagios是种用于Unix类或Linux下的主机和服务监测工具,系统管理员可以使用它来监测系统。本文将全面讲解Nagios主程序的安装。

  Nagios主程序的安装:

  1.解压缩Nagios主程序源代码包

  1.   [root@KCentOS5C ~]# tar -zxvf nagios-2.9.tar.gz  
  2.  

  2.进入Nagios主程序包的解压目录

  1.   [root@KCentOS5C ~]# cd nagios-2.9  
  2.  

  3.预配置Nagios主程序的环境以及指定安装路径

  1.   [root@KCentOS5C nagios-2.9]# ./configure --prefix=/usr/local/nagios  
  2.  

  预配置成功后将返回配置环境信息

  ----------------------------------------------------

  1.   *** Configuration summary for nagios 2.9 04-10-2007 ***:  
  2.  
  3.   General Options:  
  4.  

  -------------------------

  1.   Nagios executable: nagios  
  2.  
  3.   Nagios user/group: nagios,nagios  
  4.  
  5.   Command user/group: nagios,nagios  
  6.  
  7.   Embedded Perl: no  
  8.  
  9.   Event Broker: yes  
  10.  
  11.   Install ${prefix}: /usr/local/nagios  
  12.  
  13.   Lock file: ${prefix}/var/nagios.lock  
  14.  
  15.   Init directory: /etc/rc.d/init.d  
  16.  
  17.   Host OS: linux-gnu  
  18.  
  19.   Web Interface Options:  
  20.  

  ------------------------

  1.   HTML URL: http://localhost/nagios/  
  2.  
  3.   CGI URL: http://localhost/nagios/cgi-bin/  
  4.  
  5.   Traceroute (used by WAP): /bin/traceroute  
  6.  
  7.   Review the options above for accuracy. If they look okay,  
  8.  
  9.   type 'make all' to compile the main program and CGIs.  
  10.  

  请注意看最后的提示,如果对以上反馈信息接受的话,则需要继续执行“make all”命令来编译主程序以及CGI。

  -----------------------------------------------------

  4.编译Nagios主程序

  1.   [root@KCentOS5C nagios-2.9]# make all  
  2.  

  Nagios主程序编译成功后OK

  如果在编译当中没有发生错误的话,那么可以照以下这些命令继续操作。

  1.   make install  
  2.  
  3.   - This installs the main program, CGIs, and HTML files  
  4.  

  执行“make install”命令来对主程序,CGI以及HTML网页进行安装。

  1.   make install-init  
  2.  
  3.   - This installs the init script in /etc/rc.d/init.d  
  4.  

  执行“install-init”命令来在/etc/rc.d/init.d/目录中安装启动脚本。

  1.   make install-commandmode  
  2.  
  3.   - This installs and configures permissions on the  
  4.  
  5.   directory for holding the external command file  
  6.  

  执行“install-commandmode”命令来安装和配置外部命令对Nagios主路径操作的权限。(这里所谓的外部命令主要是指Apache服务通过CGI来对Nagios的进行的操作。用户将通过Web以执行CGI程序脚本的方式来对Nagios的检测结果进行读取和调用。)

  1.   make install-config  
  2.  
  3.   - This installs *SAMPLE* config files in /usr/local/nagios/etc  
  4.  
  5.   You'll have to modify these sample files before you can  
  6.  
  7.   use Nagios. Read the HTML documentation for more info  
  8.  
  9.   on doing this. Pay particular attention to the docs on  
  10.  
  11.   object configuration files, as they determine what/how  
  12.  
  13.   things get monitored!  
  14.  

  执行“make install-config”命令将会在/usr/local/etc/这个Nagios编译安装的主配置路径下安装示例配置模板,这将对于之后的配置制定帮助很大。

  -----------------------------------------------------

  5.安装Nagios主程序、CGI以及网页

  1.   [root@KCentOS5C nagios-2.9]# make install  
  2.  

  安装完Nagios主程序、CGI和网页的之后将提示安装成功信息以及剩余可操作的步骤

  -----------------------------------------------------

  6.安装Nagios的系统启动脚本

  1.   [root@KCentOS5C nagios-2.9]# make install-init  
  2.  

  安装完Nagios的系统启动脚本之后将提示脚本安装成功信息以及剩余可操作的步骤

  -----------------------------------------------------

  7.将Nagios的启动脚本添加到系统服务当中去

  1.   [root@KCentOS5C ~]# chkconfig --add nagios  
  2.  

  8.将Nagios服务加入到系统启动服务当中去

 

  1.   [root@KCentOS5C ~]# chkconfig nagios on  
  2.  

  9.安装和配置外部命令对Nagios主路径的操作权限

  1.   [root@KCentOS5C nagios-2.9]# make install-commandmode  
  2.  

  安装配置外操作权限后将提示配置成功信息以及剩余可操作步骤

  -----------------------------------------------------

  10.将Apache服务宿主用户加到nagios组里面

  这样做是为了让Apache有适当的权限能够通过CGI脚本程序对Nagios进行调用,否则Apache将没有权限调用Nagios,用户通过Web将无法访问Nagios处理的所有信息。

  1.   [root@KCentOS5C nagios-2.9]# usermod -G nagios apache  
  2.  

  11.安装Nagios的配置模板

  1.   [root@KCentOS5C nagios-2.9]# make install-config  
  2.  

  安装完毕Nagios主程序的配置模板后将反馈安装成功的提示信息。

  上一节:Apache服务的安装     下一节:plugins插件程序

【编辑推荐】

Nagios被监控端的安装

Nagios的性能分析

新手入门Nagios的安装

责任编辑:zhaolei 来源: Chinaunix
相关推荐

2011-03-22 14:16:17

Nagios安装

2011-03-22 13:37:29

Nagios安装

2011-03-23 10:17:24

2011-03-22 13:53:00

CentsNagios安装

2011-03-22 14:20:30

Nagios安装

2011-03-21 13:01:56

LinuxNagios安装

2011-03-21 15:35:01

Nagiosnagios-plug安装

2011-03-24 13:00:22

CentOSNagios安装

2011-03-22 10:54:01

2014-08-06 15:25:36

LinuxNagios

2011-03-22 10:10:18

CentOSNagios安装

2011-03-25 12:50:29

nagios安装

2011-03-23 13:32:14

配置Nagios系统

2011-04-01 15:42:13

CactiNagios

2011-03-31 16:05:18

Redhat配置nagios

2011-08-22 12:25:02

nagios

2011-03-25 14:13:07

2011-03-28 13:27:36

RHELnagios

2011-03-23 09:07:38

Nagios安装

2011-08-22 15:03:17

nagios
点赞
收藏

51CTO技术栈公众号