diff --git a/bin/compile-nagios-plugins b/bin/compile-nagios-plugins index 7488f6475b52c3bde2edff9ddabcc36df7f36647..a8d1185feea68d567305cfeefdf5743b0f340e90 100755 --- a/bin/compile-nagios-plugins +++ b/bin/compile-nagios-plugins @@ -14,7 +14,8 @@ then echo ../nagios-plugins-*/Makefile exists. Not running configure. >&2 else echo Running ../nagios-plugins-*/configure >&2 - (cd ../nagios-plugins-* && ./configure --prefix=$prefix) + opts=`contents nagios-plugins-config-opts` + (cd ../nagios-plugins-* && ./configure --prefix=$prefix $opts) fi if [ -f ../nagios-plugins-*/src/nagios-plugins ] diff --git a/bin/utils/functions.sh b/bin/utils/functions.sh index 88b0adaef2c1505d3dcedfdc67aa572765bb634c..285840ce54a89cd092db6b25cb3ae196b8f8d832 100644 --- a/bin/utils/functions.sh +++ b/bin/utils/functions.sh @@ -69,11 +69,10 @@ contents () { fi } -tempfile () { - mktemp -t $1.XXXXXX 2>/dev/null && exit 0 - tempfile -p $1 2>/dev/null && exit 0 - echo /tmp/$1.$$ && exit 0 - exit 1 +get_tempfile () { + mktemp -t $1.XXXXXX 2>/dev/null && return + tempfile -p $1 2>/dev/null && return + echo /tmp/$1.$$ } gentoo_add_use () { diff --git a/rules/gentoo/nrpe-host-auto.sh b/rules/gentoo/nrpe-host-auto.sh index 829dc93d46a1cc1d82c052e8b4cd780c1c764ea5..798f5e0e7cef6e6da05d36753eb16981d49fba28 100644 --- a/rules/gentoo/nrpe-host-auto.sh +++ b/rules/gentoo/nrpe-host-auto.sh @@ -1,4 +1,4 @@ -FILESYSTEMS=`tempfile nrpfs` +FILESYSTEMS=`get_tempfile nrpfs` trap "rm -f $FILESYSTEMS" 0 > $prefix/etc/nrpe-host-auto.cfg diff --git a/rules/solaris10/config-nrpe.sh b/rules/solaris10/config-nrpe.sh index d449872fe05c44c22c44f9ce48c31b965dfe9808..6283bc67e5a9777a61df42488c16076deaffb4b7 100755 --- a/rules/solaris10/config-nrpe.sh +++ b/rules/solaris10/config-nrpe.sh @@ -9,7 +9,7 @@ fi if svcs svc:/network/nrpe/tcp >/dev/null 2>&1 then : else - NRPECFG=`tempfile` + NRPECFG=`get_tempfile nrpsv` echo "nrpe stream tcp nowait nagios $prefix/bin/nrpe $prefix/bin/nrpe -c $prefix/etc/nrpe.cfg --inetd" > $NRPECFG inetconv -i $NRPECFG rm $NRPECFG diff --git a/rules/solaris10/nrpe-host-auto.sh b/rules/solaris10/nrpe-host-auto.sh index 72ba555cd81f5daa0fdf730585e637f963166d0b..3071ba6e97f3ecc8288a426dcaf9bf0e61b69dae 100644 --- a/rules/solaris10/nrpe-host-auto.sh +++ b/rules/solaris10/nrpe-host-auto.sh @@ -1,5 +1,5 @@ -FILESYSTEMS=`tempfile nrpfs` -ZPOOLS=`tempfile nrzfs` +FILESYSTEMS=`get_tempfile nrpfs` +ZPOOLS=`get_tempfile nrzfs` trap "rm -f $FILESYSTEMS $ZPOOLS" 0 # Create a host-specific config file. diff --git a/rules/solaris8/config-nrpe.sh b/rules/solaris8/config-nrpe.sh new file mode 100755 index 0000000000000000000000000000000000000000..fc8bdcd2a10258f58ac6c07eab55cf26fa7cdda4 --- /dev/null +++ b/rules/solaris8/config-nrpe.sh @@ -0,0 +1,14 @@ +# Install the service. +getent services nrpe >/dev/null +if [ $? = 2 ] +then + echo 'nrpe 5666/tcp # Nagios NRPE' >> /etc/services +fi + +# Install the SVC +if grep "^nrpe stream tcp" /etc/inetd.conf >/dev/null 2>&1 +then : +else + echo "nrpe stream tcp nowait nagios $prefix/bin/nrpe nrpe -c $prefix/etc/nrpe.cfg -i" >> /etc/inetd.conf + pkill -HUP -P 1 -u root -x inetd +fi diff --git a/rules/solaris8/nrpe-host-auto.sh b/rules/solaris8/nrpe-host-auto.sh new file mode 100644 index 0000000000000000000000000000000000000000..4e9c7e134fb220fa609eda448653dc6746bb2cb6 --- /dev/null +++ b/rules/solaris8/nrpe-host-auto.sh @@ -0,0 +1,20 @@ +FILESYSTEMS=`get_tempfile nrpfs` +trap "rm -f $FILESYSTEMS" 0 + +# Create a host-specific config file. +{ df -F ufs; df -F tmpfs; } \ +| awk '{ print $1 }' \ +| tee $FILESYSTEMS \ +| while read mp + do + dev=`mount|awk '$1 == "'$mp'" { print $3 }'` + case $dev in + /*) arg=$dev;; + swap) arg=$mp;; + *) echo unknown: mp=$mp dev=$dev >&2 + arg=$mp;; + esac + echo $arg `echo $mp | sed -e 's%^/$%/root%' -e 's%/%-%g'` + done \ +|awk '{ print "command[check-disk" $2 "]='$prefix'/libexec/check_disk " $1 }'\ +> $prefix/etc/nrpe-host-auto.cfg diff --git a/rules/solaris8/nrpe-os.cfg.in b/rules/solaris8/nrpe-os.cfg.in new file mode 100644 index 0000000000000000000000000000000000000000..7945742702653c4751465cd52121787daf028893 --- /dev/null +++ b/rules/solaris8/nrpe-os.cfg.in @@ -0,0 +1,4 @@ +# This file is centrally managed. Do not edit. Source: +# svn+ssh://lsvn.lysator.liu.se/svnroot/nagios-plugins/trunk/nagios-plugins + +command[check-iostatE]=@PREFIX@/libexec/check_iostatE -C @PREFIX@/etc/check_iostatE.cfg diff --git a/rules/solaris8/setup-env.sh b/rules/solaris8/setup-env.sh new file mode 100644 index 0000000000000000000000000000000000000000..71ca4098c923eea17f363cf45204b1aa47032bd5 --- /dev/null +++ b/rules/solaris8/setup-env.sh @@ -0,0 +1,2 @@ +PATH=/bin:/sbin:/usr/sbin:/usr/ccs/bin:/usr/local/bin +export PATH diff --git a/site-rules/lysator/solaris8/install-nrpe-posthook.sh b/site-rules/lysator/solaris8/install-nrpe-posthook.sh new file mode 100644 index 0000000000000000000000000000000000000000..3f367f04f525ae011dc0025b87fe1084ee873a97 --- /dev/null +++ b/site-rules/lysator/solaris8/install-nrpe-posthook.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Install gawk locally, as check_iostatE needs it. +if [ -f /opt/lysator/bin/gawk ] +then : +else + if [ -f /usr/local/bin/gawk ] + then + mkdir -p /opt/lysator/bin + cp /usr/local/bin/gawk /opt/lysator/bin + else + echo '*** No gawk found, so not installed in /opt/lysator/bin.' >&2 + echo '*** check_iostatE might fail!' >&2 + fi +fi diff --git a/site-rules/lysator/solaris8/nagios-plugins-config-opts b/site-rules/lysator/solaris8/nagios-plugins-config-opts new file mode 100644 index 0000000000000000000000000000000000000000..466fc6eb46889e21cfdde8a4fc4abbeaff06f8be --- /dev/null +++ b/site-rules/lysator/solaris8/nagios-plugins-config-opts @@ -0,0 +1 @@ +--without-openssl --disable-nls diff --git a/site-rules/lysator/solaris8/os b/site-rules/lysator/solaris8/os new file mode 100644 index 0000000000000000000000000000000000000000..44ad52c139716465043a25990c2c1793253a5c4f --- /dev/null +++ b/site-rules/lysator/solaris8/os @@ -0,0 +1 @@ +solaris8