nagios 部署与配置方法

一, Nagios部署与配置方法:
Nagios服务端安装
Nagios插件安装
https://www.cnblogs.com/Richardzhu/p/3340638.html

Apache安装
https://www.cnblogs.com/Anker/p/3355573.html

php安装

 

/*****************************************************************************/
遇到问题:
1. 使用chkconfig --add 添加服务时提示“在nagios服务中读取信息时出错:没有那个文件或目录”
参考网址:http://blog.chinaunix.net/uid-28597757-id-3503976.html

2. 安装apatche时,./configure --prefix=/usr/local/apache2
报错:configure: error: APR not found. Please read the documentation.

3.安装apr,
报错:rm: cannot remove 'libtoolT': No such file or directory
https://jingyan.baidu.com/article/b907e627611f6b46e7891cb6.html

4.安装apr,
报错:xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录
yum install -y expat-devel 即可

5.安装pcre
报错:configure: error: Invalid C++ compiler or C++ compiler flags
yum install -y gcc gcc-c++

6.安装apache
/usr/local/web/apr-util/lib/libaprutil-1.so: undefined reference to `XML_GetErrorCode'
应该讲apt-util改为1.5的版本
https://www.cnblogs.com/zyos/p/7663717.html

7.安装php
源码安装php时出现configure: error: xml2-config not found. Please check your libxml2 installation...
https://blog.csdn.net/weixin_33759269/article/details/86231617

8.启动apach
解决apache启动错误"httpd:Could not reliably determine..."
https://blog.csdn.net/zhaomininternational/article/details/42293511

9. linux主机无法访问虚拟机Linux的apache
https://blog.csdn.net/zymx14/article/details/51440722

10. linux启动nagios无法通过web访问
需要关闭防火墙,centos关闭防火墙命令;
firewall-cmd --state
systemctl stop firewalld.service
systemctl disable firewalld.service //禁止开机启动

二,安装mysql方法:
https://www.cnblogs.com/yizitrd/p/5363068.html


/*****************************************************************************/

 


nagios运行调试:
启动apach命令:
/usr/local/apache/bin/apachectl restart

service httpd restart

chkconfig添加服务
chkconfig --add nagios
chkconfig --level 35 nagios on
chkconfig --list nagios

1. 检查配置文件是否正确
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

2. 启动nagios
a.初始化脚本启动
# /etc/init.d/nagios start
or
# service nagios start

b./usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg

如何配置linux开机自启动?

 

posted @ 2019-09-08 18:15  龙之吻hm  阅读(328)  评论(0编辑  收藏  举报