diff options
Diffstat (limited to 'check-hosts')
-rwxr-xr-x | check-hosts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/check-hosts b/check-hosts index 98ca4ed..4b5035b 100755 --- a/check-hosts +++ b/check-hosts @@ -32,7 +32,15 @@ get_nagios() { extra=$(get_extra | wc -l) stale=$(get_stale | wc -l) - echo "clean=$clean bad=$bad extra=$extra stale=$stale" + status="OK" + exit=0 + if [ "$bad" != "0" -o "$stale" != "0" ]; then + status="CRITICAL" + exit=2 + fi + + echo "$status | clean=$clean; bad=$bad; extra=$extra; stale=$stale;" + exit $exit } get_stale_once() { |