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