Skip to content

Commit

Permalink
Minor pvc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
agapoff committed Mar 2, 2023
1 parent 1337622 commit 49b5dc2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,14 @@ Services:
vars.kube_mode = "tls"
assign where "k8s-api" in host.vars.roles
}

apply Service "k8s pvc" {
import "generic-service"
check_interval = 1h
check_command = "check-kubernetes"
vars.kube_mode = "pvc"
assign where "k8s-api" in host.vars.roles
}

apply Service "k8s pods" {
import "generic-service"
Expand Down
3 changes: 1 addition & 2 deletions check_kubernetes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ mode_pvc() {
CRIT=${CRIT:-90}
WARN_ERROR=0
CRIT_ERROR=0
PVC_COUNT=0

data="$(getJSON "api/v1/nodes")"
[ $? -gt 0 ] && die "$data"
Expand Down Expand Up @@ -248,7 +247,7 @@ mode_pvc() {
done

if [ "$WARN_ERROR" -eq "0" ] && [ "$CRIT_ERROR" -eq "0" ]; then
echo "OK. No problems on $PVC_COUNT pvc"
echo "OK. No problems on $length pvc"
elif [ "$WARN_ERROR" -ne "0" ] && [ "$CRIT_ERROR" -eq "0" ]; then
echo "WARNING.${OUTPUT}"
exit 1
Expand Down

0 comments on commit 49b5dc2

Please sign in to comment.