【php精品源码栏目提醒】:网学会员为需要php精品源码的朋友们搜集整理了nagios服务端和客户端安装文档 - 其它资料相关资料,希望对各位网友有所帮助!
服务端:系统环境: centos6.2需要软件: freetype-2.4.3.tar.gz libpng-1.4.4.tar.gz jpegsrc.v8b.tar.gz gd-2.0.33.tar.gz httpd-2.2.15.tar.gz
php-5.3.2.tar.gz nagios-3.4.1.tar.gz nagios-plugins-1.4.16.tar.gz 或 nagios-plugins-1.4.15.tar.gz nrpe-2.12.tar.gz前提: yum –y install gcc一、安装 freetype FreeType 库是一个 开源的、高质量的且可移植的字体引擎 tar -zxvf freetype-2.4.3.tar.gz cd freetype-2.4.3/ ./configure --prefix/usr/local/freetype make cleanmake make install二、安装 libpng 支持对 PNG 图形文件的创建、读写等操作 tar -zxvf libpng-1.4.4.tar.gz cd libpng-1.4.4/ ./configure --prefix/usr/local/libpng make cleanmake make install三、安装 jpeg 显示 JPEG 图像 tar -zxvf jpegsrc.v8b.tar.gz cd jpeg-8b/ ./configure --prefix/usr/local/jpeg make cleanmake make install四、安装 GD 库重新加载 lib ldconfig ldconfig -p grep jpeg ldconfig -p grep free ldconfig -p grep libpng tar -zxvf gd-2.0.33.tar.gz cd gd-2.0.33/ ./configure --prefix/usr/local/gd --with-jpeg/usr/local/jpeg--with-freetype/usr/local/freetype --with-png/usr/local/libpng --with-zlib--enable-m4_pattern_allow makecleanmake此时会遇到以下错误解决方法: vim gd_png.c找到 png.h 改为 /usr/local/libpng/include/png.h再重新 make make install五、
源码安装 apache 所需软件包 cd httpd-2.2.15/ ./configure --prefix/usr/local/apache --enable-so --enable-rewrite make cleanmake make install 安装完启动会报错 httpd: Could not reliably determine the servers fully qualified domain name using 218.30.50.53 for ServerName 需修改 apache 配置文件问题 找到ServerName www.example.com:80 大概在 97 行 取消注释,并将 www.example.com 修改为 localhost 再重启服务即可六、
源码安装
php 软件包
php-5.3.2 进入
php-5.3.2 安装目录 ./configure --prefix/usr/local/
php --with-apxs2/usr/local/apache/bin/apxs--with-zlib --with-libxml-dir --enable-gd-native-ttf --enable-mbstring--with-gd/usr/local/gd/ --with-freetype-dir/usr/local/freetype/--with-jpeg-dir/usr/local/jpeg/ --with-png-dir/usr/local/libpng/遇到以下错误解决方法:yum –y install libxml2 libxml2 是一个 xml C 语言的解析器和工具重新 configure 一下显示以下界面 configure 完成make cleanmake此处提示运行 make test不做也可以,没发现异常,容易造成死机 make test一直停在此处,不知是物理机还是虚拟机的问题,此步可不运行。
make installApaceh 与
php 整合 vim /usr/local/apache/conf/httpd.conf53 LoadModule
php5_module modules/libphp5.so310 或是 54 行添加 AddType application/x-httpd-
php .
php(注意空格)166167 DirectoryIndex index.
php index.html168(此步可能会遇到以下错误,但是我没有遇到解决方法: make clean /usr/src/
php-
php-5.2.10 make install解决方法:重新 make 之前要 make clean) /usr/local/apache/bin/apachectl start验证:http://localhost 会显示 It works七、安装 nagios1、创建系统用户 useradd nagios passwd nagios groupadd nagcmd usermod -G nagcmd nagios usermod -G nagcmd apache2、安装 nagios tar -zxvf nagios-3.4.1.tar.gz cd nagios/ ./configure --with-command-groupnagcmd make all make install make install-init make install-config make install-commandmode修改配置文件: vim /usr/local/nagios/etc/objects/contacts.cfg35 email liuzsitv.cn 更改 email 接收报警内容 make install-webconf 安装 nagios 的 web 配置文件到 apache 的 conf.d 目录下以下问题我没有遇到/usr/bin/install: 无法创建一般文件“/etc/httpd/conf.d/nagios.conf”: 没有那个文件或目录make: install-webconf 错误 1解决方法以: mkidr –p /etc/httpd/conf.d) vim /usr/local/apache/conf/httpd.conf光标调至最后一行: -r /etc/httpd/conf.d/nagios.conf 将文件导入到 apache 配置文件中 /usr/local/apache/bin/apachectl restart 重新启动 apache /usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd.usersnagios 创建登录 nagios 用户3、安装插件1)、nagios-plugis tar -zxvf nagios-plugins-1.4.16.tar.gz cd nagios-plugins-1.4.16/./configure --with-nagios-usernagios --with-nagios-groupnagios make cleanmake遇到以下错误安装 openssl重新 configure 一下Make make install到此,nagios 已经安装完成需要做以下设置,启动 Nagios chkconfig --add nagios 将 nagios 添加到服务中 chkconfig nagios on 设置服务开机启动 /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg 检查 nagios配置是否正确 service nagios start 启动 nagios setenforce 0 关闭 selinux 跟登录验证有关,此步没操作验证:http://localhost/nagios(此问题没有遇到解决方法: vim /usr/local/nagios/etc/cgi.cfg78 use_authentication0) service nagios restart修改 nagios 侧边栏 /usr/local/nagios/share/side.phpNagios 配置文件 cd /usr/local/nagios/etc/ ll总计 88-rw-rw-r-- 1 nagios nagios 11408 06-16 16:39 cgi.cfgCGI 配置文件-rw-r--r-- 1 root root 36 06-16 17:58 htpasswd.usersApache 验证密码文件-rw-rw-r-- 1 nagios nagios 43825 06-17 00:55 nagios.cfgNagios 主配置文件drwxrwxr-x 2 nagios nagios 4096 06-17 01:39 objects监控对象定义文件目录-rw-rw---- 1 nagios nagios 1340 06-16 00:45 resource.cfgNagios 资源配置文件Nagios 主配置文件vim /usr/local/nagios/etc/nagios.cfglog_file/usr/local/nagios/var/nagios.log nagios 日志文件cfg_file/usr/local/nagios/etc/objects/commands.cfg命令配置文件cfg_file/usr/local/nagios/etc/objects/contacts.cfg联系人配置文件cfg_file/usr/local/nagios/etc/objects/timeperiods.cfg时间周期配置文件cfg_file/usr/local/nagios/etc/objects/templates.cfg模板配置文件cfg_file/usr/local/nagios/etc/objects/localhost.cfg默认监控本机的配置cfg_file/usr/local/nagios/etc/objects/windows.cfg监控 windows 配置文件4)服务端安装 NRPE(在 Nagios 服务器端只要安装 nrpe 监控插件就行)查看并解压软件包tar –zxvf nrpe-2.12.tar.gzcd nrpe-2.12./configuremake all make install-plugin在/usr/local/nagios/etc/objects/commands.cfg 中定义 check_nrpe 命令 vim /usr/local/nagios/etc/objects/commands.cfg 将以下内容添加至最后 2008.11.18 add by Stone NRPE COMMAND check_nrpe command definitiondefine command command_name check_nrpe command_line USER1/check_nrpe -H HOSTADDRESS -c ARG1 待被监控端安装完成后测试一下连通性如果返回 nrpe 版本号,那么正常!如果返回拒绝连接!那么 telnet ip 5666 看是否正常被监控端系统环境: centos6.2需要软件: nagios-plugins-1.4.16.tar.gz 或 nagios-plugins-1.4.15.tar.gz nrpe-2.12.tar.gz被监控端只需安装这两个软件前提: yum –y install gcc1、 添加系统用户2、 安装 nagios-plugins-1.4.16.tar.gz 先安装这个,否则后面会报服务端的那个错误。
最好指定一下安装路径3、 这一步完成会在/user/local/nagios 下生成两个目录 libexec 和 share 更改属组4、 安装 nrpe-2.12.tar.gz make install-plugin make install-daemon make install-daemon-config5、 修改配置 将 nagios 服务端 IP 添加到后面。
6、 启动 nrpe 察看是否在 5666 端口上监听 注意:防火墙 释放端口 5666,这很重要。
查看能否返回 nrpe 版本号,返回则正常7、 设置 nrpe 开机启动
上一篇:
基于LAMP平台的问卷调查系统的设计
下一篇:
视频在线点播系统:ASP.NET 和 SQL Server 2005 实现一个简易的在线视频点播系统。按功能的不同可以划分为 5 个模块