xingyu655 发表于 2019-1-26 10:35:50

icinga服务器系统监控软件的安装

  系统环境rhel和Centos都可以安装

[*]  这里我们所使用的安装包为中文版的icinga-cn-1.9.3.tar.bz2
  (1)安装icinga软件所支持的组件包(我们这里采用yum源的方式)
  组件:
  libdbi-dbd-mysql-0.8.3-5.1.el6.x86_64.rpm
  gd-devel-2.0.35-11.el6.x86_64.rpm   libdbi-0.8.3-4.el6.x86_64.rpm
  libdbi-devel-0.8.3-4.el6.x86_64.rpm
[*]  yum install gd-* libdbi-*(centos安装方式)
  3.安装icinga中文安装包
  tar jxf icinga-cn-1.9.3.tar.bz2//解压
  编译 ./configure
  Web Interface Options:
  ------------------------
  HTML URL:http://localhost/icinga/
  CGI URL:http://localhost/icinga/cgi-bin/
  Main URL:http://localhost/icinga/cgi-bin/tac.cgi
  

  

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

  

  !!! Please take care about the upgrade documentation !!!
  以上提示安装成功
  

  icinga-cn-1.9.3]#make all //全部编译
  

  icinga-cn-1.9.3]# make fullinstall
  make: Entering directory `/opt/icinga/icinga-cn-1.9.3'
  cd ./base && make install
  make: Entering directory `/opt/icinga/icinga-cn-1.9.3/base'
  make install-basic
  make: Entering directory `/opt/icinga/icinga-cn-1.9.3/base'
  /usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/bin
  /usr/bin/install: 无效的用户"icinga"
  make: *** 错误 1
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3/base'
  make: *** 错误 2
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3/base'
  make: *** 错误 2
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3'
  Run make install-config for installing/overwriting the configs...
  以上错误时没有创建用户
  

  创建用户
  icinga-cn-1.9.3]# useradd icinga
  再次编译

  icinga-cn-1.9.3]# make fullinstall
  Resuming with install...
  /usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/bin
  /usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/lib
  /usr/bin/install -c -m 755 -o icinga -g icinga ido2db /usr/local/icinga/bin
  /usr/bin/install -c -m 755 -o icinga -g icinga log2ido /usr/local/icinga/bin
  /usr/bin/install -c -m 755 -o icinga -g icinga idomod.so /usr/local/icinga/lib
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3/module/idoutils/src'
  /usr/bin/install -c -m 775 -o icinga -g icinga -d /usr/local/icinga/etc
  /usr/bin/install: 无法创建目录"/usr/local/icinga/etc": 文件已存在
  make: *** 错误 1
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3/module/idoutils'
  make: *** 错误 2
  make: Leaving directory `/opt/icinga/icinga-cn-1.9.3'
  Run make install-config for installing/overwriting the configs...
  

  以上错误提示 etc这个目录存在了
  我们就把这个/usr/local/icinga/etc/ 删除    rm -rf /usr/local/etc
  

  重新安装配置文件 icinga-cn-1.9.3]# make install-config
  给用户添加密码
  etc]# htpasswd -mc htpasswd.users icingaadmin
  New password:
  Re-type new password:
  htpasswd: password verification error
  You have mail in /var/spool/mail/root
  

  以上就配置完成了。

  4.安装服务插件(这里我使用了nagios的插件)

  步骤:
  (1)将nagios的服务插件制作成yum源安装
http://s3.运维网.com/wyfs02/M02/56/AE/wKiom1SKiuPQ8_agAALv8fJs0DY019.jpg
  (2)配置yum源

http://s3.运维网.com/wyfs02/M00/56/AC/wKioL1SKi5Gw64I_AAJM6XPTNTw056.jpg
  (3)安装nrpe和nagios服务控件
http://s3.运维网.com/wyfs02/M00/56/AE/wKiom1SKiyTDx3QeAASemEqW7U8220.jpg
  (4)查看nrpe服务和测试

http://s3.运维网.com/wyfs02/M00/56/AE/wKiom1SKi6Dxa0P7AAM63WQDYxk979.jpg
  (5)查看各自的服务器目录
  icinga生成的服务插件目录是:/usr/local/icinga/libexec
http://s3.运维网.com/wyfs02/M01/56/AC/wKioL1SKjgGhxossAAVRXEgvGas645.jpg
  nagios生成的服务插件目录是:/usr/local/nagios/libexec
http://s3.运维网.com/wyfs02/M02/56/AC/wKioL1SKjhOCV8pmAAkvdr9EI0M203.jpg
  5.启动icinga
  首先启动 httpd 服务
  service httpd restart
  再次启动
  service icinga restart
  

  6.访问http
  http://127.0.0.1/icinga
http://s3.运维网.com/wyfs02/M02/56/AE/wKiom1SKjZ_ijY8UAASj9Jcggn8809.jpg
  成功
  

  7.配置被监控端的配置(这里也需要安装nrpe和nagios服务插件《步骤同上4》)
  (1)被监控端配置nrpe插件服务(添加服务端的ip)
http://s3.运维网.com/wyfs02/M02/56/AE/wKiom1SKkMKQgxKbAATIFEWLQSQ173.jpg
  8.在icinga软件中配置主机模本和主机服务
  (1)服务配置模板目录:(/usr/local/icinga/etc/objects/commands.cfg)
http://s3.运维网.com/wyfs02/M00/56/AC/wKioL1SKmBqTTnhfAANEgSJl_1g452.jpg
  (2)配置主机模本目录:/usr/local/icinga/etc/objects(复制源模板并修改成自己定义的模板)
http://s3.运维网.com/wyfs02/M00/56/AC/wKioL1SKlA-QP_yxAAQn0Uc9HnY203.jpg
  

  (3)指定服务模板路径(/usr/local/icinga/etc/icinga.cfg)
http://s3.运维网.com/wyfs02/M02/56/AC/wKioL1SKlibDLvwqAAPFxtMVefE186.jpg
  

  8.实现mysql的监控
  (1)在被监控端创建mysql的监控授权用户和密码

  grant all privileges on *.* to 'monitor'@'192.168.*.*' identified by 'monitor';
  (2)模板引用(/usr/local/icinga/etc/objects/commands.cfg)
http://s3.运维网.com/wyfs02/M02/56/AD/wKioL1SKo0jCtVibAAEi3GZgz3Q777.jpg
  (3)定义服务(/usr/local/icinga/etc/objects/linux.cfg)

http://s3.运维网.com/wyfs02/M01/56/AD/wKioL1SKpAWwg9xjAADSX9VqWpU242.jpg
  




页: [1]
查看完整版本: icinga服务器系统监控软件的安装