mirror of
https://github.com/zulip/zulip.git
synced 2025-10-24 08:33:43 +00:00
travis: Automate updates to production-helper Nagios test.
This list was likely to end up out of date quickly, since it wasn't documented that you need to update it when adding a queue. The best solution is to just not require it to be updated.
This commit is contained in:
26
scripts/lib/queue_workers.py
Executable file
26
scripts/lib/queue_workers.py
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
import argparse
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
from os.path import dirname, abspath
|
||||||
|
|
||||||
|
BASE_DIR = dirname(dirname(dirname(abspath(__file__))))
|
||||||
|
sys.path.append(BASE_DIR)
|
||||||
|
import scripts.lib.setup_path_on_import
|
||||||
|
|
||||||
|
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
|
||||||
|
|
||||||
|
import django
|
||||||
|
django.setup()
|
||||||
|
from zerver.worker.queue_processors import get_active_worker_queues
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
parser = argparse.ArgumentParser()
|
||||||
|
parser.add_argument('--queue_type', action='store', dest='queue_type', default=None,
|
||||||
|
help="Specify which types of queues to list")
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
workers = get_active_worker_queues(args.queue_type)
|
||||||
|
print(" ".join(workers))
|
||||||
@@ -17,6 +17,7 @@ sanity_check.check_venv(__file__)
|
|||||||
|
|
||||||
from typing import IO, Text
|
from typing import IO, Text
|
||||||
|
|
||||||
|
# TODO: Convert this to use scripts/lib/queue_workers.py
|
||||||
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
successful_worker_launches = [
|
successful_worker_launches = [
|
||||||
'launching queue worker thread error_reports',
|
'launching queue worker thread error_reports',
|
||||||
|
|||||||
@@ -86,7 +86,10 @@ fi
|
|||||||
echo; echo "Now running RabbitMQ consumer Nagios tests"; echo
|
echo; echo "Now running RabbitMQ consumer Nagios tests"; echo
|
||||||
# First run the check that usually runs in cron and populates the state files
|
# First run the check that usually runs in cron and populates the state files
|
||||||
/home/zulip/deployments/current/scripts/nagios/check-rabbitmq-consumers
|
/home/zulip/deployments/current/scripts/nagios/check-rabbitmq-consumers
|
||||||
for consumer in notify_tornado user_activity user_activity_interval user_presence invites signups message_sender feedback_messages error_reports digest_emails email_mirror missedmessage_mobile_notifications; do
|
|
||||||
|
# Then, compute the list of all Django queue workers to run Nagios checks against
|
||||||
|
consumer_list=$(/home/zulip/deployments/current/scripts/lib/queue_workers.py --queue_type=consumer)
|
||||||
|
for consumer in $consumer_list; do
|
||||||
if ! /usr/lib/nagios/plugins/zulip_app_frontend/check_rabbitmq_consumers "$consumer"; then
|
if ! /usr/lib/nagios/plugins/zulip_app_frontend/check_rabbitmq_consumers "$consumer"; then
|
||||||
set +x
|
set +x
|
||||||
echo
|
echo
|
||||||
|
|||||||
Reference in New Issue
Block a user