core nagios 中文版_nagios core 4.4.1升级 4.4.3

nagios core 4.4.1升级 4.4.3

2019-05-30

Nagios Core provides the central monitoring engine and a web interface for viewing current status, historical logs, and basic reports.

nagios每隔一段时间就会有新版本,会提供新功能也会修复bug.注意升级会覆盖原来的配置。

1、下载

https://www.nagios.org/downloads/nagios-core/thanks/?t=1426844202

2019-01-15 Latest stable release

wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.4.3.tar.gz

2017-04-19 Latest stable release

wget https://nagios-plugins.org/download/nagios-plugins-2.2.1.tar.gz

2017-09-01 Last Release Date

https://assets.nagios.com/downloads/nagiosxi/agents/linux-nrpe-agent.tar.gz

https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-3.2.1/nrpe-3.2.1.tar.gz

2、如果第一次安装nagios需要创建user和group

#!/bin/bash

/usr/sbin/useradd -m nagios

/usr/sbin/groupadd nagcmd

/usr/sbin/usermod -a -G nagcmd nagios

/usr/sbin/usermod -a -G nagcmd www

export NAGIOS=/opt/nagios

cd $NAGIOS

3、安装

tar zxf untar/nagios-4.4.3.tar.gz

pushd nagios-4.4.3

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

make all;

make install 安装主程序和share页面

make install-init 安装/etc/init.d/nagios

make install-commandmode

make install-config 这步骤不需要

popd

4、vi ins_nrpe.sh

#!/bin/sh

today=`date +%Y%m%d%H%M`

VER=`uname -r|awk -F\. '{print $6}'`

yum -y install xinetd openssl-devel

sed -i '/nagios/d' /etc/passwd

sed -i '/nagios/d' /etc/group

/usr/sbin/useradd -s /sbin/nologin -d /usr/local/nagios nagios

tar zxf nagios-plugins-2.2.1.tar.gz

pushd nagios-plugins-2.2.1

./configure && make && make install

popd

chown nagios.nagios /usr/local/nagios && chown -R nagios.nagios /usr/local/nagios/libexec

if [ -f /usr/local/nagios/etc/nrpe.cfg ];then

/bin/cp -f /usr/local/nagios/etc/nrpe.cfg /usr/local/nagios/etc/nrpe.cfg_$today

fi

tar zxf nrpe-3.2.1.tar.gz

pushd nrpe-3.2.1

./configure && make all && make install-plugin && make install-daemon && make install-config

popd

sed -i '/nrpe/d' /etc/services

cat >> /etc/services << !

nrpe 5666/tcp # nrpe

!

/bin/cp -f nrpe /etc/xinetd.d

sed -i '/^command/d' /usr/local/nagios/etc/nrpe.cfg

sed -i '/hardcoded/r nrpe.txt' /usr/local/nagios/etc/nrpe.cfg

case "$VER" in

el4|el5|el6)

/etc/init.d/xinetd restart && exit 0

;;

el7)

systemctl enable xinetd && systemctl start xinetd && exit 0

;;

*)

exit 2

esac

~

分类:Linux | 标签: |

相关日志

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值