Skip to content
This repository was archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
Update check_wp_update
Browse files Browse the repository at this point in the history
Found that if `CURL` hit something that didn't return an expected output, it would return as `OK`. We want that returned as `CRITICAL` now.
  • Loading branch information
fredbradley authored Sep 29, 2017
1 parent fafa1c8 commit 735e421
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions check_wp_update
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Version 1.9.2 (Please check against: https://github.com/fredbradley/nagios-wordpress-updates-checker/blob/master/check_wp_update )
# Version 1.9.11 (Please check against: https://github.com/fredbradley/nagios-wordpress-updates-checker/blob/master/check_wp_update )
#
# The Nagios Check that works with https://github.com/fredbradley/nagios-wordpress-updates-checker/
#
Expand Down Expand Up @@ -72,7 +72,14 @@ else
esac

# Echo out the output
echo "$status - $text"
case $status in
CRITIAL|WARNING|OK)
echo "$status - $text"
;;
*)
echo "INVALID OUTPUT"
;;
esac

# Finish in a Nagios friendly way!
case "$status" in
Expand All @@ -85,6 +92,8 @@ else
OK)
exit $STATE_OK
;;
*)
exit $STATE_CRITICAL
;;
esac
fi

0 comments on commit 735e421

Please sign in to comment.