summaryrefslogtreecommitdiffstats
path: root/check-hosts
diff options
context:
space:
mode:
Diffstat (limited to 'check-hosts')
-rwxr-xr-xcheck-hosts15
1 files changed, 7 insertions, 8 deletions
diff --git a/check-hosts b/check-hosts
index ecd66ab..9ef973c 100755
--- a/check-hosts
+++ b/check-hosts
@@ -53,25 +53,24 @@ get_nagios() {
echo "$status | clean=$clean; bad=$bad; extra=$extra; stale=$stale;"
exit $exit
else
- host="${1/%spline.de/spline.inf.fu-berlin.de}"
- if ! get_names -a | grep -q "^$host$"; then
- echo "CRITICAL $host not known to bcfg2"
+ if ! get_names -a | grep -q "^$1$"; then
+ echo "CRITICAL $1 not known to bcfg2"
exit 2
fi
- if get_names --stale | grep -q "^$host$"; then
- echo "CRITICAL $host is stale"
+ if get_names --stale | grep -q "^$1$"; then
+ echo "CRITICAL $1 is stale"
exit 2
fi
- bad=$(get_count -b "$host")
+ bad=$(get_count -b "$1")
if [ "$bad" != "0" ]; then
echo "CRITICAL $bad bad entries"
exit 2
fi
- extra=$(get_count -e "$host")
- total=$(bcfg2-reports -t "$host" | sed "s/good: [0-9]*)/extra: $extra)/")
+ extra=$(get_count -e "$1")
+ total=$(bcfg2-reports -t "$1" | sed "s/good: [0-9]*)/extra: $extra)/")
echo "OK $total"
fi
}