Nagios监控服务器安装和部署

# vi /usr/local/apache/conf/extra/httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
    ServerName  192.168.189.132
    DocumentRoot "/www"
    <Directory "/www">
    Order deny,allow
    Deny from all
    </Directory>
    #以下是apache上,nagios所需的配置信息:
    Scriptalias/nagios/cgi-bin  /usr/local/nagios/sbin
    <directory"/usr/local/nagios/sbin">
    Authtype basic
    Options execcgi
    Allowoverride none
    Order allow,deny
    Allow from all
    Authname "nagios access"
    Authuserfile /usr/local/nagios/etc/htpasswd
    Require valid-user
    </directory>
 
  Alias /nagios /usr/local/nagios/share
  <directory"/usr/local/nagios/share">
  Authtype basic
  Options none
  Allowoverride none
  Order allow,deny
  Allow from all
  Authname "nagios access"
  //配置nagios用户验证
  Authuserfile /usr/local/nagios/etc/htpasswd
  Require valid-user
  </directory>
</VirtualHost>

二:创建nagios用户与组

# useradd nagios
# groupadd nagios
# usermod –a –Gnagios nobody
# usermod –a –Gnagios nagios

二:下载nagios相关软件包,并编译安装及环境配置

# cd /usr/local/src
# wget
# wget
# wget
# tar -zxvf nagios-3.4.1.tar.gz
# tar -zxvf nagios-plugins-1.4.16.tar.gz
# tar -zxvf nagios/nrpe-2.13.tar.gz

编译安装nagios

# cd nagios-3.4.1/
# ./configure --prefix=/usr/local/nagios --with-command-group=nagios
# make all
# make install
# make install-init
# make install-commandmode
# make install-config

编译安装nagios插件

# cd ../nagios-plugins-1.4.16

# ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios

# make && make install

编译安装nrpe

# cd ../nrpe-2.13
# ./configure --prefix=/usr/local/nagios
# make all
# make install-plugin

设置nagios目录权限

# chown –R nagios:nagios /usr/local/nagios/

配置用户密码访问

# /usr/local/apache/bin/htpasswd -cm /usr/local/nagios/etc/htpasswd nagiosadmin
New password:
Re-type new password:
Adding password for usernagiosadmin

三:启用nagios,并访问测试

开启apache服务

# /usr/local/apache/bin/apachectl -k start

检测nagios配置文件语法是否正确

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

若语法正确,则可以正常启动nagios

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg -d

(也可使用系统服务方式启动:service nagios start)

页面访问测试

Nagios监控服务器安装和部署

出现以上页面,说明nagios安装部署成功。后续需在服务中添加主机与服务,方能开始进行监控。

更多MongoDB相关教程见以下内容

CentOS 编译安装 MongoDB与mongoDB的php扩展

CentOS 6 使用 yum 安装MongoDB及服务器端配置

Ubuntu 13.04下安装MongoDB2.4.3

MongoDB入门必读(概念与实战并重)

Ubunu 14.04下MongoDB的安装指南

《MongoDB 权威指南》(MongoDB: The Definitive Guide)英文文字版[PDF]

Nagios监控MongoDB分片集群服务实战

基于CentOS 6.5操作系统搭建MongoDB服务 uxidc.com/Linux/2014-11/108900.htm

MongoDB 的详细介绍请点这里
MongoDB 的下载地址请点这里

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/17b6fac03adb2a15176c6563091a7fd7.html