Cents下Nagios的安装-Nagios主程序的安装
创始人
2024-07-23 19:10:40
0

  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的安装

相关内容

热门资讯

如何允许远程连接到MySQL数... [[277004]]【51CTO.com快译】默认情况下,MySQL服务器仅侦听来自localhos...
如何利用交换机和端口设置来管理... 在网络管理中,总是有些人让管理员头疼。下面我们就将介绍一下一个网管员利用交换机以及端口设置等来进行D...
各种千兆交换机的数据接口类型详... 千兆交换机有很多值得学习的地方,这里我们主要介绍各种千兆交换机的数据接口类型,作为局域网的主要连接设...
施耐德电气数据中心整体解决方案... 近日,全球能效管理专家施耐德电气正式启动大型体验活动“能效中国行——2012卡车巡展”,作为该活动的...
Windows恶意软件20年“... 在Windows的早期年代,病毒游走于系统之间,偶尔删除文件(但被删除的文件几乎都是可恢复的),并弹...
规避非法攻击 用好路由器远程管... 单位在市区不同位置设立了科技服务点,每一个服务点的员工都通过宽带路由器进行共享上网,和单位网络保持联...
范例解读VB.NET获取环境变... VB.NET编程语言的使用范围非常广泛,可以帮助开发人员处理各种程序中的需求,而且还能对移动设备进行...
20个非常棒的扁平设计免费资源 Apple设备的平面图标PSD免费平板UI 平板UI套件24平图标Freen平板UI套件PSD径向平...