近期要安装N多台Linux主机的NRPE客户端,话说我这么“懒”的人怎么可能会一个个自己安.批量处理的简单小程序就用perl来做吧!
# tar -tf BatchNrpe.tar.gz BatchNrpe/ BatchNrpe/install.sh BatchNrpe/Check_Nrpe.pl BatchNrpe/nrpe-2.15.tar.gz BatchNrpe/Batch_Installation_Nrpe.pl BatchNrpe/hostlist BatchNrpe/nagios-plugins-1.5.tar.gz |
BatchNrpe.tar.gz为主主程序包.
install.sh是自动部署NRPE的Shell脚本
useradd nagios /bin/tar -zxvf nagios-plugins-1.5.tar.gz |
hostlist是需要安装NRPE的主机列表
#IC Server #格式 IP->密码 |
nagios-plugins-1.5.tar.gz nrpe-2.15.tar.gz是安装必须要的Tarball
Batch_Installation_Nrpe.pl用于自动scp必要的Tarball和install.sh安装脚本至hostlist列表主机
#!/bin/env perl # # This program is used to batch install NRPE # # # Created : Yumeng # Creation Date : 4 December 2013 # # E-mail : mixmaomao@163.com # # Use Statement # use strict; use warnings; use Expect; # # Read the installation list # File Format: IP address->Passwd # such as : 172.20.1.1->password # open HOSTLIST,"<","hostlist" or die "Can't open file :$!\n"; my @hostlist = <HOSTLIST>; close HOSTLIST; # my %hostlist; for (@hostlist) { chomp; next if m{^#}; my $host; my $pass; $host = (split(/\->/))[0]; $pass = (split(/\->/))[1]; $hostlist{$host}=$pass; } # # Login host # while (my ($host,$pass)=each %hostlist) { my $exp_scp = Expect->new; $exp_scp = Expect->spawn("scp install.sh nagios-plugins-1.5.tar.gz nrpe-2.15.tar.gz $host:/root"); $exp_scp->expect(2, [ 'password', sub { my $self_scp = shift; $self_scp->send("$pass\n"); } ], [ '\(yes/no\)?', sub { my $self_scp = shift; $self_scp->send("yes\n"); exp_continue; } ], ); #$exp->send("exit\n") if ($exp->expect(undef,'#')); my $exp_ssh = Expect->spawn("ssh $host"); $exp_ssh->expect(2, [ 'password', sub { my $self = shift; $self->send("$pass\n"); } ], [ '\(yes/no\)?', sub { my $self = shift; $self->send("yes\n"); exp_continue; } ], ); $exp_ssh->send("sh install.sh\n") if ($exp_ssh->expect(undef,'#')); $exp_ssh->send("exit\n") if ($exp_ssh->expect(undef,'#')); } |
Check_Nrpe.pl用于检测NRPE是否连通
#!/bin/env perl open HOSTLIST,"<","hostlist" or die "Can't open file :$!\n"; |
相关推荐
安装包已经 安装说明 具体如下 nagios-plugins-2.2.1.tar.gz nagios-plugins-2.2.1.tar.gz xinetd-2.3.14-40.el6.x86_64.rpm 安装说明.txt 、、、、、、、、、、、
GO NRPE-Nagios远程插件执行器 状态:已维护 内容 此附加组件有两部分: NRPE-该程序在远程主机上作为后台进程运行,并处理Nagios主机上check_nrpe插件发出的命令执行请求。 收到来自授权主机的插件请求后,它将...
当前2018年,nagios监控客户端需要安装的NRPE,最新3.2.1版本手册,英文版
开源项目-envimate-nrpe.zip,支持SSL的Golang中的NRPE客户端和服务器实现
服务器状态监控软件安装部署和配置指导文档
icinga-nrpe.2.14.tar.gz icinga客户端安装包 安装在被检测服务器端 service icinga-nrpe start
NAGIOS的监控代理,NRPE 2.15.
nrpe及配置說明,非常詳細,下載會有很大的驚喜
nrpe-2.15
nrpe-2.13.tar.gz nrpe-2.13 nrpe
nrpe 2.15 .tar.gz格式。 site:http://www.nrpe.org nrpe-2.15.tar.gz 源代码。
一个全攻略的Nagios+Centreon+Nrpe+PHP+Mysql+NSClient完全安装
NRPE是监控软件nagios的一个扩展,它被用于被监控的服务器上,向nagios监控平台提供该服务器的一些本地的情况。
NRPE是监控软件nagios的一个扩展,它被用于被监控的服务器上,向nagios监控平台提供该服务器的一些本地的情况。例如,cpu负载、内存使用、硬盘使用等等。NRPE可以称为nagios的for linux 客户端。
naigos 集群套件 远程监控管理模块 nrpe 。。。
nagios客户端,使用nagios服务器监控的客户端,该客户端安装在被监控的主机上,和nagios服务器相配合使用
nrpe-3.0.1.tar.gz
2安装nagios插件 解压缩 tar -zxvf nagios-plugins-1.4.9.tar.gz cd nagios-plugins-1.4.9 编译安装 ./configure make make install 这一步完成后会在/usr/local/nagios/下生成两个目录libexec和share [root@dbpi ...
nagios监控mysql服务器: 1、建立专用数据库: [root@svr3 ~]# /usr/local/webserver/mysql/bin/mysql -u root -p Enter password: Welcome to the MySQL monitor.... or \g. Your MySQL connection id is 51910 ...
nagios主动检测插件,主要实现nagios的主动检测机制,网上其他地方没有哦!