From de23550453e9e4d13facabec85a3d0644b339b32a3e1ed3dc48253607f3a47b9 Mon Sep 17 00:00:00 2001 From: Ruediger Oertel Date: Thu, 7 Jan 2016 18:30:39 +0000 Subject: [PATCH] - only check for revision/date if there is a suseinfo entry in the repomd.xml file OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-repomd?expand=0&rev=4 --- check_repomd | 3 ++- monitoring-plugins-repomd.changes | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/check_repomd b/check_repomd index 182e285..3301373 100644 --- a/check_repomd +++ b/check_repomd @@ -110,6 +110,7 @@ if $GREP -q "Error 404" "$RESULTFILE" ; then fi REVISION=$($GREP revision "$RESULTFILE" | $CUT -d "<" -f2 | $CUT -d ">" -f2) +HAS_INFO=$($GREP "type.*suseinfo" "$RESULTFILE") NOW=$(date +'%s') let DIFFERENCE=(${NOW}-${REVISION}) let SECONDS=${DAYS}*24*60*60 @@ -123,7 +124,7 @@ if [ "$DEBUG" != "0" ]; then echo fi -if [[ $DIFFERENCE -gt $SECONDS ]]; then +if [[ -n "$HAS_INFO" && $DIFFERENCE -gt $SECONDS ]]; then cleanup_and_exit "$STATE_CRITICAL" "CRITICAL: repomd.xml from $URL is older than $DAYS days" else cleanup_and_exit "$STATE_OK" "OK: repomd.xml from $URL is younger than $DAYS days" diff --git a/monitoring-plugins-repomd.changes b/monitoring-plugins-repomd.changes index 0dd0d91..a7822f5 100644 --- a/monitoring-plugins-repomd.changes +++ b/monitoring-plugins-repomd.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jan 7 19:29:47 CET 2016 - ro@suse.de + +- only check for revision/date if there is a suseinfo entry + in the repomd.xml file + ------------------------------------------------------------------- Wed Jul 30 19:20:35 UTC 2014 - lars@linux-schulserver.de