关于Icinga-php4的文档信息及下载地址,可参考: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 rrdtool php php-gd

# 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. -- ***

  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.
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

测试WEB页面能否正常打开

报以上错误。

通过查看Apache日志,报错信息如下:

# tailf /var/log/httpd/error_log

[Thu Apr  ::33.682635 ] [core:error] [pid ] ()Permission denied: [client 192.168.244.1:] AH00035: access to /icinga/ denied (filesystem path '/home/monitor/icinga') because search permissions are missing on a component of the path

在网上查了很多方式,包括PHP没安装,SELinux没关闭啊。

最后才发现,是/home/monitor目录的属性存在问题。默认是700的。

# ll -d /home/monitor/
drwx------ monitor monitor Apr : /home/monitor/

解决方式:

将其目录属性设置为755

# chmod -R 755 /home/monitor/

重新登录Icinga WEB界面,OK

打开页面后,没发现图像啊,现在一步一步来

点击“服务详情”,出来以下画面

其中,蓝色框框的部分即是图像。

点击,出来以下提示信息,会显示“PNP4Icinga 环境测试”和“Kohana 环境测试”的结果。

其中,最后一行是提示信息“您的环境通过了所有要求. 现在可以删除或重命名 /usr/local/icinga/share/install.php 文件.”

根据提示,将该文件改名 mv install.php install.php.bak

重新点击图像,显示如下:

图像完美呈现,注意,只可点击状态是“正常”和“警报”的,如果点击“严重”和“未知”,会报如下错误:

部署Icinga-php4的更多相关文章

  1. 如何部署Icinga客户端

    Icinga客户端的部署相对于服务器端来说,简单很多.对于服务器端来说,如果要通过以下这种方式来监控服务器,必须包含三个组件,Icinga内核,Icinga插件,NRPE(Nagios Remote ...

  2. 如何部署Icinga服务端

    Icinga是Nagios的一个变种,配置,使用方式几乎一样,而且完全兼容Nagios的插件.所以下面的部署方案对Nagios同样使用. 它还推出了两个中文版本,icinga-cn原版和icinga- ...

  3. OWASP SSL 高级审查工具

    http://www.linuxidc.com/Linux/2016-03/129164.htm InfoWorld 在部署.运营和保障网络安全领域精选出了年度开源工具获奖者. 最佳开源网络和安全软件 ...

  4. Web应用之LAMP源码环境部署

    一.LAMP环境的介绍 1.LAMP环境的重要性 思索许久,最终还是决定写一篇详细的LAMP的源码编译安装的实验文档,一来是为了给自己一个交代,把技术进行系统的归纳,将技术以极致的形式呈现出来,做为一 ...

  5. 部署lamp服务器

    系统:CentOS 6.5 64位 1.卸载旧版本软件 rpm -qa | grep mysql #查询是否已经安装MySQL,如有执行下面的操作将其全部删除 rpm -e mysql --nodep ...

  6. Docker —— 用于统一开发和部署的轻量级 Linux 容器【转】

    转自:http://www.oschina.net/translate/docker-lightweight-linux-containers-consistent-development-and-d ...

  7. IIS部署PHP项目并与mysql完美结合

    在上一篇文章中,提到iis与apache共用80端口,但是发现很多问题,例如 IIS网站有支付功能,而微信支付是不支持带有端口的网址的,虽然通过apche代理,在外面看来没有端口,可是内部还是避免不了 ...

  8. Jenkins+Gitlab+Ansible自动化部署(六)

    Pipeline Job实现Nginix+MySQL+PHP+Wordpress实现自动化部署交付(Jenkins+Gitlab+Ansible自动化部署(五)https://www.cnblogs. ...

  9. 从大厂DevOps工具链部署,看现代产品的生命周期管理

    目录 1. 认识DevOps 1.1. DevOps工具链 1.2. CI 持续集成(Continuous Integration) 1.3. CD(持续交付 & 持续部署) 1.4. Agi ...

  10. [原]CentOS7.2部署node-mapnik

    转载请注明表作者think8848及出处(http://think8848.cnblogs.com) node-mapnik依赖项中要求g++ >= 5, toolchain (>= GL ...

随机推荐

  1. Python 爬虫3——第一个爬虫脚本的创建

    在进行真正的爬虫工程创建之前,我们先要明确我们所要操作的对象是什么?完成所有操作之后要获取到的数据或信息是什么? 首先是第一个问题:操作对象,爬虫全称是网络爬虫,顾名思义,它所操作的对象当然就是网页, ...

  2. C#按照指定长度分割中英文字符串

    最近有一个需求:玩家发的不同长度文字,需要自适应行数. 初步实现想法很简单,直接获取字符数均分行数,再利用string.substring()切割即可.但是显而易见,由于一般字体下,中文显示宽度一般是 ...

  3. [转]Android ListView 与 RecyclerView 对比浅析—缓存机制

    从源码角度剖析ListView 与 RecyclerView 缓存机制的不同 https://zhuanlan.zhihu.com/p/23339185 原文地址:http://dev.qq.com/ ...

  4. Lua pureMVC

    分享一个lua语言版本的pureMVC. 这个是一个根据AS3(ActionScript 3) pureMVC而转换过来的lua pureMVC.所有的接口完全跟AS3版本一致,本来是想用在项目之中的 ...

  5. 什么情况下才要重写Objective-C中的description方法

    特别注意: 千万不要在description方法中同时使用%@和self,同时使用了%@和self,代表要调用self的description方法,因此最终会导致程序陷入死循环,循环调用descrip ...

  6. 使用vbs脚本进行批量编码转换

    使用vbs脚本进行批量编码转换 最近需要使用SourceInsight查看分析在Linux系统下开发的项目代码,我们知道Linux系统中文本文件默认编码格式是UTF-8,而Windows中文系统中的默 ...

  7. .NET平台下对C3D文件的读写

    [题外话] 最近实验室要我修改C3D(The 3D Biomechanics Data Standard)文件,虽然从网上找到了一个叫c3d4sharp的类库,这个类库单纯读取C3D文件的话还可以,但 ...

  8. Node.js学习笔记

    相关介绍 1.Node.js或者Node,是一个可以让javascript运行在服务器端的平台. 2.Node.js是一个为实时Web应用开发而诞生的语言,它从诞生之初就充分考虑了再实时响应.超大规模 ...

  9. 部分安卓手机微信浏览器中使用XMLHttpRequest 2上传图片显示字节数为0的解决办法

    前端JS中使用XMLHttpRequest 2上传图片到服务器,PC端和大部分手机上都正常,但在少部分安卓手机上上传失败,服务器上查看图片,显示字节数为0.下面是上传图片的核心代码: HTML < ...

  10. 《Entity Framework 6 Recipes》中文翻译系列 (35) ------ 第六章 继承与建模高级应用之TPH继承映射中使用复合条件

    翻译的初衷以及为什么选择<Entity Framework 6 Recipes>来学习,请看本系列开篇 6-11  TPH继承映射中使用复合条件 问题 你想使用TPH为一张表建模,建模中使 ...