added some error handling in the nagios checks
This commit is contained in:
parent
cb0f0c5125
commit
584c44352f
3 changed files with 9 additions and 2 deletions
|
@ -1,6 +1,9 @@
|
|||
#!/bin/bash
|
||||
# This file is managed by puppet.
|
||||
|
||||
set -euo pipefail
|
||||
trap 'echo "UNKNOWN: failed to query Kubernetes API" >&2; exit 3' ERR
|
||||
|
||||
STATUS=$(/snap/bin/kubectl get events --all-namespaces -o json)
|
||||
|
||||
# number warnings required to make critical status (any warning makes warning and any critical makes critical)
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/bin/bash
|
||||
# This file is managed by puppet.
|
||||
|
||||
set -euo pipefail
|
||||
trap 'echo "UNKNOWN: failed to query Kubernetes API" >&2; exit 3' ERR
|
||||
|
||||
num_replica=$(/snap/bin/kubectl get pods -n sunet-cnpg -o json \
|
||||
| jq -r '
|
||||
.items[]
|
||||
|
|
|
@ -6,11 +6,12 @@ export OS_AUTH_URL="https://v2.api.sto4.safedc.net:5000/v3/"
|
|||
export OS_AUTH_TYPE="v3applicationcredential"
|
||||
export OS_APPLICATION_CREDENTIAL_ID="<%= scope.call_function('safe_hiera',['sto4_application_credential_id']) %>"
|
||||
export OS_APPLICATION_CREDENTIAL_SECRET="<%= scope.call_function('safe_hiera',['sto4_application_credential_secret']) %>"
|
||||
|
||||
|
||||
export OS_REGION_NAME="sto4"
|
||||
export OS_INTERFACE="public"
|
||||
|
||||
set -euo pipefail
|
||||
trap 'echo "UNKNOWN: failed to query OpenStack" >&2; exit 3' ERR
|
||||
|
||||
num_snaps=$(openstack volume snapshot list -f json \
|
||||
| jq -r '.[].ID' \
|
||||
| wc -l | tr -d ' ')
|
||||
|
|
Loading…
Add table
Reference in a new issue