Skip to content
Snippets Groups Projects
Commit 53b2f145 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added support for Gentoo.

parent 6bd12129
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 4 deletions
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
source_fragment set-prefix.sh source_fragment set-prefix.sh
source_fragment setup-env.sh source_fragment setup-env.sh
run_hook compile-nagios-plugins-prehook.sh
if [ -f ../nagios-plugins-*/Makefile ] if [ -f ../nagios-plugins-*/Makefile ]
then then
echo ../nagios-plugins-*/Makefile exists. Not running configure. >&2 echo ../nagios-plugins-*/Makefile exists. Not running configure. >&2
...@@ -22,3 +24,5 @@ else ...@@ -22,3 +24,5 @@ else
echo Running make in ../nagios-plugins-* >&2 echo Running make in ../nagios-plugins-* >&2
(cd ../nagios-plugins-* && make) (cd ../nagios-plugins-* && make)
fi fi
run_hook compile-nagios-plugins-posthook.sh
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
source_fragment set-prefix.sh source_fragment set-prefix.sh
source_fragment setup-env.sh source_fragment setup-env.sh
run_hook compile-nrpe-prehook.sh
if [ -f ../nrpe-*/Makefile ] if [ -f ../nrpe-*/Makefile ]
then then
echo ../nrpe-*/Makefile exists. Not running configure. >&2 echo ../nrpe-*/Makefile exists. Not running configure. >&2
...@@ -23,3 +25,5 @@ else ...@@ -23,3 +25,5 @@ else
echo Running make in ../nrpe-* >&2 echo Running make in ../nrpe-* >&2
(cd ../nrpe-* && make) (cd ../nrpe-* && make)
fi fi
run_hook compile-nrpe-posthook.sh
...@@ -7,3 +7,4 @@ source_fragment set-prefix.sh ...@@ -7,3 +7,4 @@ source_fragment set-prefix.sh
source_fragment setup-env.sh source_fragment setup-env.sh
make install PREFIX=$prefix || exit 1 make install PREFIX=$prefix || exit 1
mkdir -p $prefix/etc
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
source_fragment set-prefix.sh source_fragment set-prefix.sh
source_fragment setup-env.sh source_fragment setup-env.sh
run_hook install-nrpe-prehook.sh
if [ -f ../nrpe-*/src/nrpe ] if [ -f ../nrpe-*/src/nrpe ]
then : then :
else else
...@@ -14,8 +16,6 @@ else ...@@ -14,8 +16,6 @@ else
exit 1 exit 1
fi fi
run_hook install-nrpe-prehook.sh
mkdir -p $prefix/bin $prefix/etc mkdir -p $prefix/bin $prefix/etc
cp ../nrpe-*/src/nrpe $prefix/bin cp ../nrpe-*/src/nrpe $prefix/bin
......
...@@ -75,3 +75,21 @@ tempfile () { ...@@ -75,3 +75,21 @@ tempfile () {
echo /tmp/$1.$$ && exit 0 echo /tmp/$1.$$ && exit 0
exit 1 exit 1
} }
gentoo_add_use () {
package="$1"
use="$2"
fn=/etc/portage/package.use
if grep "^$package[ ]" $fn >/dev/null
then
if grep "^$package[ ].*$use\($\|[ ]\)" $fn >/dev/null
then :
else
echo Please add $use use flags to $package in $use. >&2
exit 1
fi
else
echo $package $use >> $fn
fi
}
rc-update -a nrpe default
rm /etc/nagios/nrpe.cfg
ln -s $prefix/etc/nrpe.cfg /etc/nagios/nrpe.cfg
/etc/init.d/nrpe restart
FILESYSTEMS=`tempfile nrpfs`
trap "rm -f $FILESYSTEMS" 0
> $prefix/etc/nrpe-host-auto.cfg
awk < /etc/fstab \
'! ($1 ~ /\//) { next }
$3 == "swap" || $3 == "nfs" { next }
$4 ~ /noauto/ { next }
{ print $1, $2 }' \
| while read dev mp
do
mpdash=`echo $mp | sed -e 's%^/$%/root%' -e 's%/%-%g'`
echo "command[check-disk$mpdash]=/usr/nagios/libexec/check_disk $dev" \
>> $prefix/etc/nrpe-host-auto.cfg
echo $mp
done > $FILESYSTEMS
echo
echo BEGIN `hostname | sed 's/\..*//'` nagiosadmin
sed 's/^/fs /' $FILESYSTEMS | sort
echo END
exit 0
exit 0
exit 0
gentoo_add_use net-analyzer/nagios-nrpe -ssl
emerge -uvakb nagios-nrpe || exit 1
exit 0
gentoo
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#!/bin/sh
echo echo
echo BEGIN `hostname | sed 's/\..*//'` nagiosadmin echo BEGIN `hostname | sed 's/\..*//'` nagiosadmin
sed 's/^/fs /' $FILESYSTEMS | sort sed 's/^/fs /' $FILESYSTEMS | sort
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment