#!/bin/sh
set -x
groupadd nagios
useradd -g nagios -s /sbin/nologin nagios
cd nrpe-2.12
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config
cd /data/nagios-plugins-1.4.11/
./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install
chown nagios.nagios /usr/local/nagios
chown -R nagios.nagios /usr/local/nagios/libexec
set +x
第二版
[root@xiazai data]# cat add_nagios.sh#!/bin/shset -xgroupadd nagiosuseradd -g nagios -s /sbin/nologin nagiosrpm -qa|grep openssl-develif [ $? == 0 ]then cd nrpe-2.12 ./configure make all make install-plugin make install-daemon make install-daemon-config cd /data/nagios-plugins-1.4.11/ ./configure --with-nagios-user=nagios --with-nagios-group=nagios make make install chown nagios.nagios /usr/local/nagios chown -R nagios.nagios /usr/local/nagios/libexecelse echo "please install openssl-devel"fiset +x
本文出自 “always_yunwei” 博客,请务必保留此出处http://alwaysyunwei.blog.51cto.com/3224143/1254759