#!/bin/bash # # nrpe.SlackBuild is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or any later version. # # nrpe.SlackBuild is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place - Suite 330, Boston, MA 02111-1307, USA # # default settings PACKAGE="nrpe" PACKAGE_EXT="gz" VERSION=${VERSION:=3.2.1} BUILD=${BUILD:=1} if [ -f ~/.slackbuildrc ]; then . ~/.slackbuildrc elif [ -f ../../runtime/slackbuildrc ]; then . ../../runtime/slackbuildrc fi # Check for nagios account here if ! grep ^nagios: /etc/group 2>&1 > /dev/null; then groupadd -g 213 nagios fi if ! grep ^nagios: /etc/passwd 2>&1 > /dev/null; then useradd -d /dev/null -s /bin/false -u 213 -g 213 -c "Nagios" nagios fi check_required SRC="nrpe-$VERSION.tar.$PACKAGE_EXT" URL="https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-$VERSION/$SRC" _nagios_user="nagios" _nagios_group="nagios" get_source $SRC $URL unpack_source $SRC $PACKAGE-$VERSION CFLAGS="$SLKCFLAGS" ./configure \ --prefix=/usr \ --libexecdir=/usr/share/nagios/libexec \ --libdir=${LIBDIR} \ --sysconfdir=/etc/nrpe \ --with-nrpe-user=$_nagios_user \ --with-nrpe-group=$_nagios_group \ --with-nagios-user=$_nagios_user \ --with-nagios-group=$_nagios_group \ --enable-command-args \ --build=$ARCH-slackware-linux || exit 1 make nrpe || exit 2 mkdir -p $PKG/usr/sbin install -m 0755 src/nrpe $PKG/usr/sbin # install sample config file mkdir -p $PKG/etc/nrpe install -m0644 sample-config/nrpe.cfg $PKG/etc/nrpe/nrpe.cfg.new # comment out default samples as they won't work and may lessen security sed -i 's/^command\[/#command\[/' $PKG/etc/nrpe/nrpe.cfg.new # include conf dir by default to allow other packages to drop check commands in sed -i 's|#include_dir=|include_dir=/etc/nrpe/conf.d/|g' $PKG/etc/nrpe/nrpe.cfg.new mkdir $PKG/etc/nrpe/conf.d/ cat > $PKG/etc/nrpe/conf.d/process_checks.cfg.new <