From 2f29d57b8879baa185f0802788a91d4e1ef27b38 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 6 Dec 2012 03:04:16 +0100 Subject: check-hosts: remove fqdn magic --- check-hosts | 15 +++++++-------- 1 file 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 } -- cgit v1.2.3-1-g7c22