本文主要是介绍Nagios监控,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
使用nrpe监控linux/unix主机
被监控端安装nagios-plugins与nrpe软件包并启动nrpe服务。
1、准备安装环境。
# useradd -r nagios
# yum -y install gcc gcc-c++ mysql mysql-server mysql-devel openssl-devel
2、解压并编译安装nagios-plugins。
# tar zxf nagios-plugins-2.1.2.tar.gz
# cd nagios-plugins-2.1.2
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-mysql
# make all
# make install
3、解压并编译安装nrpe。
# tar zxf nrpe-2.12.tar.gz
# cd nrpe-2.12
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-nrpe-user=nagios --with-nrpe-group=nagios --enable-ssl --enable-command-args
# make all
# make install
# make install-plugin
# make install-daemon
# make install-daemon-config
4、修改客户端的nrpe的配置文件并启动服务。
# vim /usr/local/nagios/etc/nrpe.cfg
allowed_hosts=192.168.1.4
# /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
# ss -tunlp | grep nrpe
tcp LISTEN 0 5 *:5666 *:* users:(("nrpe",29550,4))
5、配置nrpe被xinetd管理的配置文件。
# vim /etc/xinetd.d/nrpe
# default: off
# nrpe service
service nrpe
{
disable = no
flags = REUSE
socket_type = stream
wait = no
user = nagios
group = nagios
server = /usr/local/nagios/bin/nrpe
server_args = -c /usr/local/nagios/etc/nrpe.cfg -d
log_on_failure += USERID
}
监控端安装nrpe。
1、解压并安装nrpe。
# tar zxf nrpe-2.12.tar.gz
# cd nrpe-2.12
# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-nrpe-user=nagios --with-nrpe-group=nagios --enable-ssl --enable-command-args
# make all
# make install-plugin
2、测试监控端与被监控端的连接。
# cd /usr/local/nagios/libexec
# ./check_nrpe -H 192.168.1.6
这篇关于Nagios监控的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!