阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

服务器监控-Nagios安装篇

126次阅读
没有评论

共计 2438 个字符,预计需要花费 7 分钟才能阅读完成。

一:安装前准备

nagios server:192.168.1.10

nagios client:192.168.1.11

本文安装 Nagios 只使用 Nagios 邮件报警功能,如需画图另外安装 cacti,或其他插件。

二:安装服务

在 nagios server 上操作:

安装 Apache+php

yum install httpd httpd-devel php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml gcc glibc glibc-common gd gd-devel openssl openssl-devel

groupadd nagios

useradd nagios

useradd -G nagios nagios

usermod -G nagios apache

wget http://sourceforge.net/projects/nagios/?source=directory

tar zxvf nagios-3.2.0.tar.gz

cd nagios-3.2.0

./configure –prefix=/usr/local/nagios –with-command-group=nagios

make all

make install

make install-init

make install-config

make install-commandmode

make install-webconf

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

service httpd restart

nagios-plugins 下载地址:www.nagios.org

tar zxvf nagios-plugins-1.4.14.tar.gz

cd nagios-plugins-1.4.14

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

make && make install

wget http://sourceforge.net/projects/nagios-cn/files/latest/download

tar -xjf nagios-cn-3.2.3.tar.bz2

cd nagios-cn-3.2.3

 ./configure

make all

make install

http://sourceforge.net/projects/nagios/files/nrpe-2.x/

tar zxvf nrpe-2.13.tar.gz

cd nrpe-2.13

./configure

make all

make install-plugin

vi /usr/local/nagios/etc/objects/commands.cfg 在最后添加

define command {

    command_name check_nrpe

    command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$

}

检查配置文件是否正确

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

在被监控主机上操作:

useradd -s /sbin/nologin nagios

tar zxvf nagios-plugins-1.4.14.tar.gz

cd nagios-plugins-1.4.14

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

make && make install

 

tar zxvf nrpe-2.13.tar.gz

cd nrpe-2.13

./configure

make all

make install-plugin

make install-daemon

make install-daemon-config

make install-xinetd

yum install xinetd

vim /etc/xinetd.d/nrpe

将 only_from = 后面加上监控端的地址:192.168.1.10

确保 /etc/services 有 nrpe 5666/tcp #NRPE 这一行,没有则添加

重启 xinetd 服务,至此被监控端配置完毕

/usr/local/nagios/libexec/check_nrpe -H 被监控端的地址

如能显示“NRPE v2.12”,表明 NRPE 可以和被监控端正常通信

安装完毕,接下来开始配置。见 http://www.linuxidc.com/Linux/2014-10/108525.htm

网络监控器 Nagios 全攻略 http://www.linuxidc.com/Linux/2013-07/87067.htm

Nagios 搭建与配置详解 http://www.linuxidc.com/Linux/2013-05/84848.htm

Nginx 环境下构建 Nagios 监控平台 http://www.linuxidc.com/Linux/2011-07/38112.htm

在 RHEL5.3 上配置基本的 Nagios 系统 (使用 Nagios-3.1.2) http://www.linuxidc.com/Linux/2011-07/38129.htm

CentOS 5.5+Nginx+Nagios 监控端和被控端安装配置指南 http://www.linuxidc.com/Linux/2011-09/44018.htm

Ubuntu 13.10 Server 安装 Nagios Core 网络监控运用 http://www.linuxidc.com/Linux/2013-11/93047.htm

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

正文完
星哥说事-微信公众号
post-qrcode
 
星锅
版权声明:本站原创文章,由 星锅 2022-01-20发表,共计2438字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中