1. 下载nagios相关包:
http://www.nagios.org/download中的core, plugins
http://www.nagios.org/download/addons/中的nrpe
2. apache相关包
http://httpd.apache.org/download.cgi#apache24
如果出现安装过程中apr包版本不正确的错误,下载:
http://apr.apache.org/download.cgi
之后如果还有类似问题,请参照文章:http://apr.apache.org/download.cgi
并安装
如果出现,没有权限访问http:/ip/nagios的问题,看看apache error_log,是否有如下错误日下:
Permission denied: [client ] AH00035: access to /nagios denied (filesystem path '/data/nagios/apache') because search permissions are missing on a component of the path 看看是不是权限的问题,看看是不是nagios用户启动
若出现:Cannot serve directory /data/nagios/share/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive
可能是没有php环境
http://cn2.php.net/downloads.php
另,安装mysql:http://os.51cto.com/art/201002/184599.htm
-------------------
nagios监控mongodb
[size=14px; line-height: 25px;]转自:http://hi.baidu.com/farmerluo/
[/size]
网上已经有人写好了mongodb的nagios监控脚本,参 考:https://github.com/mzupan/nagios-plugin-mongodb/blob/master/README.md 1) 先安装git yum install git 2) 下载脚本 cd /etc/nagios/command git clone git://github.com/mzupan/nagios-plugin-mongodb.
网上已经有人写好了mongodb的nagios监控脚本,参考:https://github.com/mzupan/nagios-plugin-mongodb/blob/master/README.md
1) 先安装git
yum install git
2) 下载脚本
cd /etc/nagios/command
git clone git://github.com/mzupan/nagios-plugin-mongodb.git
cd nagios-plugin-mongodb/chmod 755 check_mongodb.py
# ./check_mongodb.py --helpneed to install pymongo
git clone git://github.com/mongodb/mongo-python-driver.git pymongocd pymongo/python setup.py install
vi objects/commands.cfg# 'check_mongodb' command definitiondefine command { command_name check_mongodb command_line /etc/nagios/command/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$ }
4) 加入mongo监控的配置
vi hosts.cfgdefine service{ use generic-service ; Name of service template to use host_name monodb_host service_description mongodb check_command check_mongodb!connect!27017!10!30 notifications_enabled 1 }
5) 没错的话,重载nagios就行了。
nagios -v /etc/nagios/nagios.cfgservice nagios reload
如果上面安装pymongo不行,就下tar.gz包自己装:
[size=14px; line-height: 25px;]http://pypi.python.org/packages/source/p/pymongo/[/size]
python setup.py install
如果报this script requires setuptools version 0.6c11 to install 则下载:
http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
下载后解压:
python setup.py install
关于mongodb监控脚本的使用说明:https://github.com/mzupan/nagios-plugin-mongodb