阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

部署Icinga-pnp4

149次阅读
没有评论

共计 4296 个字符,预计需要花费 11 分钟才能阅读完成。

关于 Icinga-pnp4 的文档信息及下载地址,可参考:http://icinga-cn.sourceforge.net/

我这里使用的是 icinga-pnp4-cn-1.12.2.tar.xz。

因为账号限制的原因,在这里并没有新建 icinga 用户,后续 icinga 的使用者是 monitor 用户。后续预编译的时候需指定。

一、按照依赖包

# yum install httpd gcc glibc glibc-common gd gd-devel

# yum install libjpeg libjpeg-devel libpng libpng-devel

# yum install net-snmp net-snmp-devel net-snmp-utils

二、解压安装包

# tar xvf icinga-pnp4-cn-1.12.2.tar.xz 

三、预编译

# cd icinga-pnp4-cn-1.12.2

# ./configure –prefix=/home/monitor/icinga  –with-icinga-user=monitor -with-icinga-group=monitor –with-command-user=monitor –with-command-group=monitor  –enable-idoutils=no

注意:如果没有带指定后面的 –enable-idoutils=no,编译过程中会报 configure: error: ERROR – We really need a libdbi to link against。

预编译完成后,会输出以下信息

*** Configuration summary for pnp4icinga-0.6.25 03-01-2015 ***

  General Options:
  -------------------------         -------------------
  Icingapnp4 user/group:                monitor monitor
  Install directory:                /home/monitor/icinga
  HTML Dir:                         /home/monitor/icinga/share
  Config Dir:                       /home/monitor/icinga/etc
  Location of rrdtool binary:       /usr/bin/rrdtool Version 1.3.8
  RRDs Perl Modules:                *** NOT FOUND ***
  RRD Files stored in:              /home/monitor/icinga/var/perfdata
  process_perfdata.pl Logfile:      /home/monitor/icinga/var/log/perfdata.log
  Perfdata files (NPCD) stored in:  /home/monitor/icinga/var/spool/perfdata

  Web Interface Options:
  -------------------------         -------------------
  HTML URL:                         http://localhost/icinga
  Apache Config File:               /etc/httpd/conf.d/icinga.conf


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

很显然,RRDs Perl Modules 没有安装,如果没有安装的话,会导致 pnp 出来的数据是乱码。

# yum install rrdtool-perl

四、编译

# make all

输出信息如下:

*** Compile finished ***

If the main program and CGIs compiled without any errors, you
can continue with installing Icinga as follows (type 'make'
without any arguments for a list of all possible options):

  make install
     - This installs the main program (Icinga Core), CGIs
       (Classical Web), and HTML files

  make install-init
     - This installs the init script in /etc/rc.d/init.d

  make install-commandmode
     - This installs and configures permissions on the
       directory for holding the external command file

  make install-idoutils
     - This installs the database addon IDOUtils into the
       destination directory

  make install-config
     - This installs *SAMPLE* config files in /home/monitor/icinga/etc
       You'll have to modify these sample files before you can
       use Icinga.  Read the HTML documentation for more info
       on doing this.  Pay particular attention to the docs on
       object configuration files, as they determine what/how
       things get monitored!

  make install-webconf
     - This installs the Apache config file and http auth file for
       the Icinga Classic UI


  make install-webconf-auth
     - This installs the Apache http auth file for the Classic UI


 make install-processperfdata
     - pnp4icinga processperfdata in /home/monitor/icinga/libexec
 make install-plugins
     - pnp4icinga plugins in /home/monitor/icinga/libexec
 

除了 make install-idoutils,依次执行上述命令

# make install

# make install-init

# make install-commandmode

# make install-eventhandlers

# make install-config

# make install-webconf

# make install-webconf-auth

# make install-processperfdata

# make install-plugins

五、配置经典 WEB 页面

# make cgis

# make install-cgis

# make install-html

设置能访问 WEB 页面的用户和密码,在这里,用户名是 icingaadmin,密码是 icinga

# htpasswd -c /home/monitor/icinga/etc/htpasswd.users icingaadmin

六、编译和安装 Icinga 插件

# tar xvf nagios-cn-plugins-2.0.3.tar.xz 

# cd nagios-cn-plugins-2.0.3

#./configure –prefix=/home/monitor/icinga  –with-nagios-user=monitor –with-nagios-group=monitor  

# make

# make install

七、编译和安装 NRPE 插件

# tar xvf icinga-nrpe-2.14.tar.gz 

# cd icinga-nrpe-2.14

# ./configure –prefix=/home/monitor/icinga  –with-nrpe-user=monitor –with-nrpe-group=monitor  –with-icinga-user=monitor –with-icinga-group=monitor –enable-command-args 

# make all

输出如下,按自己的需求来。

*** Compile finished ***

  make install
     - This installs files in /home/monitor/icinga

  make install-plugin
     - This installs init-script files in /home/monitor/icinga/libexec

  make install-init
     - This installs init-script files in /etc/init.d

  make install-xinetd
     - This installs sample-config/nrpe.xinetd in /etc/xinit.d

  make install-init-freebsd
     - This installs init-script.freebsd files in /etc/init.d

  make install-init-debian
     - This installs init-script.debian files in /etc/init.d

  make install-init-SUSE
     - This installs init-script.suse files in /etc/init.d

  make install-daemon-config
     - This installs the Nrpe config file in /home/monitor/icinga/etc

# make install

# make install-plugin

# make install-init

# make install-daemon-config

八、调整 SELinux 策略

临时关闭:# setenforce 0

永久关闭:

# vim /etc/sysconfig/selinux 

SELINUX=disabled

九、启动 HTTP,Icinga 并添加开机自启动

# /etc/init.d/httpd start

# /etc/init.d/icinga start

# chkconfig httpd on

# chkconfig icinga on

本文永久更新链接地址 :http://www.linuxidc.com/Linux/2016-04/130503.htm

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计4296字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中