Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

nagios: Remove broken check_email_deliverer_* checks and related code.

Alex Vandivere94b6afb0034
diff --git a/docs/production/troubleshooting.md b/docs/production/troubleshooting.md
index f865efabdbb..3acdd2a5412 100644
--- a/docs/production/troubleshooting.md
+++ b/docs/production/troubleshooting.md
@@ -245,9 +245,6 @@ Application server and queue worker monitoring:
* `check_rabbitmq_consumers` and `check_rabbitmq_queues`: Effective
checks for Zulip's RabbitMQ-based queuing systems being healthy.
* `check_worker_memory`: Monitors for memory leaks in queue workers.
-* `check_email_deliverer_backlog` and `check_email_deliverer_process`:
- Monitors for whether scheduled outgoing emails (e.g. invitation
- reminders) are being sent properly.
Database monitoring:
diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_backlog b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_backlog
deleted file mode 100755
index f12e7e7958b..00000000000
--- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_backlog
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-set -eu
-
-#"OK": 0
-#"WARNING": 1
-#"CRITICAL": 2
-#"UNKNOWN": 3
-
-# checks if the user is root, and if not, try to re-exec.
-if [ "$(id -u)" = "0" ]; then
- su zulip -c "$0"
- exit 0
-fi
-
-cd /home/zulip/deployments/current
-BACKLOG="$(./manage.py print_email_delivery_backlog)"
-
-if [ "$BACKLOG" -gt 0 ] && [ "$BACKLOG" -lt 10 ]; then
- echo "backlog of $BACKLOG"
- exit 1
-elif [ "$BACKLOG" -ge 10 ]; then
- echo "backlog of $BACKLOG"
- exit 2
-else
- echo "no backlog"
- exit 0
-fi
diff --git a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_process b/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_process
deleted file mode 100755
index 808c2b31b30..00000000000
--- a/puppet/zulip/files/nagios_plugins/zulip_app_frontend/check_email_deliverer_process
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-
-#"OK": 0
-#"WARNING": 1
-#"CRITICAL": 2
-#"UNKNOWN": 3
-
-SUPERVISOR_STATUS=$(supervisorctl status zulip_deliver_scheduled_emails 2>&1)
-STATUS=$(echo "$SUPERVISOR_STATUS" | awk '{ print $2 }')
-
-case "$STATUS" in
- RUNNING)
- echo "Running"
- exit 0
- ;;
- STOPPED | STARTING | BACKOFF | STOPPING | EXITED | FATAL | UNKNOWN)
- # not "RUNNING", but a recognized supervisor status
- echo "$STATUS"
- exit 1
- ;;
- *)
- # 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
- ;;
-esac
diff --git a/puppet/zulip_ops/files/nagios3/commands.cfg b/puppet/zulip_ops/files/nagios3/commands.cfg
index f50d49a21f0..e7d0e7af735 100644
--- a/puppet/zulip_ops/files/nagios3/commands.cfg
+++ b/puppet/zulip_ops/files/nagios3/commands.cfg
@@ -166,16 +166,6 @@ define command {
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_postgresql_backups/check_postgresql_backup'
}
-define command {
- command_name check_email_deliverer_process
- command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_email_deliverer_process'
-}
-
-define command {
- command_name check_email_deliverer_backlog
- command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_email_deliverer_backlog'
-}
-
define command{
command_name check_worker_memory
command_line /usr/lib/nagios/plugins/check_by_ssh -l nagios -t 30 -i /var/lib/nagios/.ssh/id_ed25519 -H $HOSTADDRESS$ -C '/usr/lib/nagios/plugins/zulip_app_frontend/check_worker_memory'
diff --git a/puppet/zulip_ops/files/nagios3/conf.d/services.cfg b/puppet/zulip_ops/files/nagios3/conf.d/services.cfg
index 18f7f449b10..42f798bca56 100644
--- a/puppet/zulip_ops/files/nagios3/conf.d/services.cfg
+++ b/puppet/zulip_ops/files/nagios3/conf.d/services.cfg
@@ -465,22 +465,6 @@ define service {
contact_groups admins
}
-define service {
- use generic-service
- hostgroup_name staging_frontends
- service_description Check email deliverer process
- check_command check_email_deliverer_process
- contact_groups admins
-}
-
-define service {
- use generic-service
- hostgroup_name staging_frontends
- service_description Check email deliverer backlog
- check_command check_email_deliverer_backlog
- contact_groups admins
-}
-
define service {
use generic-service
service_description Check Smokescreen proxy
diff --git a/zerver/management/commands/print_email_delivery_backlog.py b/zerver/management/commands/print_email_delivery_backlog.py
deleted file mode 100644
index e5312aa16ad..00000000000
--- a/zerver/management/commands/print_email_delivery_backlog.py
+++ /dev/null
@@ -1,27 +0,0 @@
-"""
-Shows backlog count of ScheduledEmail
-"""
-from datetime import timedelta
-from typing import Any
-
-from django.core.management.base import BaseCommand
-from django.utils.timezone import now as timezone_now
-
-from zerver.models import ScheduledEmail
-
-
-class Command(BaseCommand):
- help = """Shows backlog count of ScheduledEmail
-(The number of currently overdue (by at least a minute) email jobs)
-
-This is run as part of the nagios health check for the deliver_scheduled_emails command.
-
-Usage: ./manage.py print_email_delivery_backlog
-"""
-
- def handle(self, *args: Any, **options: Any) -> None:
- print(
- ScheduledEmail.objects.filter(
- scheduled_timestamp__lte=timezone_now() - timedelta(minutes=1)
- ).count()
- )