1. 概述
本手册主要描述Nagioscores,Nagiosplugin,NRPE,NDOUtils的安装、配置以及Horizon如何使用Nagios实现监控Openstack控制和计算节点硬件资源[1]和服务[2]。
备注:
[1]:CPU,Mem,Disk,Network
[2]:keystone, glance-api, glance-register, nova-api, nova-computer,nova-network, nova-scheduler, nova-volume, nova-objectstores, mysql,dnsmasq, rabbitmq, etc
2. References
Nagios官方docs:
参考手册:
PluginResources:
TarResources:?source=navbar
3. 环境准备
操作系统:Ubuntu 12.04 LTS 64x server
Nagioscore Version:nagios-3.4.4
NRPEVersion:nrpe-2.14
NDOUtilsVersion:ndoutils-1.5.2
Dependslist:
apache2
libapache2-mod-php5
build-essential
libgd2-xpm-dev
make
gcc
xinetd
4. 环境安装和配置
4.1环境拓扑图
+-------------------------+
| Horizon node | +---------------+
| Nagios core | ======> | msyql |
| Nagios plugin | +---------------+
| NDOUtils |
+------------------------ +
+-----------------------+ || || +---------------------+
| controller node | <===== || || ====> | computenode |
|Nagios NRPE | | Nagios NRPE |
|Nagios Plugin | | Nagios Plugin |
+-----------------------+ +---------------------+
4.2 Horizon node
4.2.1 Nagios Core
默认安装在目录:/usr/local/nagios
1. 安装依赖包
$apt-get install make gcc apache2 libapache2-mod-php5 build-essentiallibgd2-xpm-dev
2.创建用户和组
$/usr/sbin/useradd -m -s /bin/bash nagios
$passwd nagios
$/usr/sbin/groupadd nagios
$/usr/sbin/usermod -G nagios nagios
$/usr/sbin/groupadd nagcmd
$/usr/sbin/groupadd nagcmd
$/usr/sbin/usermod -a -G nagcmd www-data
3.下载安装源码:
$ sunagios
$mkdir ~/download
$ cd~/download
$wget
PS:已下载文件:./资料/src/nagios-3.4.4.tar.gz
4. 编译安装
$ tar–zxvf nagios-3.4.4.tar.gz
$ cdnagios-3.4.4
$./configure --with-command-group=nagcmd
$make all
$make install && make install-init && makeinstall-config && make install-commandmode
5.配置Nagioscore
配置文件目录:/usr/local/nagios/etc
4.2.2 Nagios Plugin
1.下载安装源码
$ cd~/download
$wget
PS:已下载文件:./资料/src/nagios-plugins-1.4.16.tar.gz
2. 编译安装
$ tar-xzvf nagios-plugin-1.4.16.tar.gz
$ cdnagios-plugin-1.4.16
$./configure --with-nagios-user=nagios --with-nagios-group=nagios
$make && make install
3.检查安装和配置
$ ls/usr/local/nagios/libexec/显示check_*为所有已安装的插件。
4.2.3 NDOUtils
1.下载安装源码
$ cd~/download
$wget
PS:已下载文件:./资料/src/ndoutils-1.5.2.tar.gz