Skip to content
Snippets Groups Projects
Commit c86e0d52 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '6877_check_iml_deployment' into 'master'

add deployment check

See merge request !211
parents adfc1332 ad16f2a6
No related branches found
No related tags found
1 merge request!211add deployment check
#!/bin/bash
# ======================================================================
#
# NAGIOS CLIENT CHECK :: check deployment
#
# ----------------------------------------------------------------------
# 2023-12-14 v0.1 first lines
# ======================================================================
. $( dirname $0 )/inc_pluginfunctions
export self_APPVERSION=0.1
sInstalldir=/opt/imldeployment-installer
# ----------------------------------------------------------------------
# FUNCTIONS
# ----------------------------------------------------------------------
function showHelp(){
local _self; _self=$(basename $0)
cat <<EOF
$( ph.showImlHelpHeader )
Show status of rollouts with IML deployment client on this system.
See https://os-docs.iml.unibe.ch/imldeployment-client/
SYNTAX:
$_self [-d DIRECTORY]
OPTIONS:
-h or --help show this help.
-d or --dir set installation dir of iml deployment to find its check skript
default: ${sInstalldir}
EXAMPLE:
$_self -d /home/deployuser/imlbackup
set a custom directory und run the backup check
EOF
}
# --- check param -h
while [[ "$#" -gt 0 ]]; do case $1 in
-h|--help) showHelp; exit 0;;
-d|--dir) sInstalldir=$2; shift ;shift;;
*) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1;
esac; done
sChecker=$sInstalldir/check_deployment.sh
if [ ! -x $sChecker ]; then
ph.abort "$sChecker not found - maybe deployment is not installed here. Use param -d to set the install directory."
fi
result=$( $sChecker )
rc=$?
if [ $rc -eq 0 ]; then
if echo "$result" | grep "^UNKNOWN" 2>/dev/null
then
ph.setStatus "unknown"
else
ph.setStatus "ok"
fi
else
ph.setStatus "critical"
fi
echo "$result"
ph.exit
# ----------------------------------------------------------------------
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment