[manual] fixup nagios postmaster configuration

(imported from commit e3c00b31bbb0ced38e62d31ae80b58e8c6374c7f)
This commit is contained in:
acrefoot
2013-11-13 17:35:11 -05:00
parent d610f2511f
commit 0175440afc
3 changed files with 14 additions and 13 deletions

View File

@@ -340,8 +340,8 @@ define service {
define service {
use generic-service
host staging
service_description Check email deliverer backlog which is only used on Zulip Enterprise
check_command check_email_deliverer_backlog
hostgroup_name frontends
contact_groups admins
}

View File

@@ -12,11 +12,12 @@ BACKLOG=$(./manage.py print_email_delivery_backlog)
if [ $BACKLOG -gt 0 -a $BACKLOG -lt 10 ]
then
echo "backlog of $BACKLOG"
exit 0;
exit 1
elif [ $BACKLOG -ge 10 ]
then
echo "backlog of $BACKLOG"
exit 2;
exit 2
else
echo "no backlog"
exit 0;
exit 0
fi

View File

@@ -9,18 +9,18 @@ SUPERVISOR_STATUS=$(supervisorctl status zulip-workers:zulip-deliver-enqueued-em
STATUS=$(echo "$SUPERVISOR_STATUS" | awk '{ print $2 }')
if [ "$STATUS" == "RUNNING" ];
if [ "$STATUS" == "RUNNING" ]
then
echo "Running"
exit 0
elif [ $(echo "$STATUS" | egrep '(STOPPED)|(STARTING)|(BACKOFF)|(STOPPING)|(EXITED)|(FATAL)|(UNKNOWN)$') ]
then
echo "Running";
exit 0;
elif [ $(echo "$STATUS" | egrep '(STOPPED)|(STARTING)|(BACKOFF)|(STOPPING)|(EXITED)|(FATAL)|(UNKNOWN)$') ];
# not "RUNNING", but a recognized supervisor status
echo $STATUS;
exit 1;
echo $STATUS
exit 1
else
# we don't recognize the second column in this SUPERVISOR_STATUS.
# This may be indicative of a supervisor configuration problem
echo $SUPERVISOR_STATUS;
exit 3;
echo $SUPERVISOR_STATUS
exit 3
fi