diff --git a/sensu/plugins/check-apt-get-update.sh b/sensu/plugins/check-apt-get-update.sh new file mode 100755 index 0000000..a46fb6c --- /dev/null +++ b/sensu/plugins/check-apt-get-update.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +if [[ -n $1 ]]; then + export http_proxy=$1 +fi + +if ! { apt-get update 2>&1 || echo "E: update failed"; } | grep -q '^[WE]:'; then + echo "apt cache update successsful" + exit 0 +else + echo "apt cache update failed" + exit 2 +fi