bundles/icinga2: introduce, install checks, install sources.list, create postgres database
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2020-11-10 12:40:12 +01:00
parent a9c00409b4
commit a176a1aa65
Signed by: kunsi
GPG key ID: 12E3D2136B818350
7 changed files with 288 additions and 0 deletions

View file

@ -0,0 +1,51 @@
#!/bin/sh
UNKNOWN=3
cmd=
hostname=
timeout=10
while getopts c:h:t: name
do
case $name in
c) cmd=$OPTARG ;;
h) hostname=$OPTARG ;;
t) timeout=$OPTARG ;;
esac
done
if [ -z "$cmd" ]
then
echo 'check_by_sshmon: Option "-c $cmd" missing' >&2
exit $UNKNOWN
fi
if [ -z "$hostname" ]
then
echo 'check_by_sshmon: Option "-h $hostname" missing' >&2
exit $UNKNOWN
fi
timeout "$timeout" \
ssh sshmon@"$hostname" \
-o IdentityFile=/etc/sshmon.priv \
-o StrictHostKeyChecking=accept-new \
-o ControlMaster=auto \
-o ControlPath=~/master-%C \
-o ControlPersist=30m \
-o HashKnownHosts=no \
"$cmd"
exitcode=$?
if [ "$exitcode" = 124 ]
then
echo 'check_by_sshmon: Timeout while running check remotely' >&2
exit $UNKNOWN
elif [ "$exitcode" = 255 ]
then
echo 'check_by_sshmon: SSH error' >&2
exit $UNKNOWN
else
exit $exitcode
fi