From f61ac4a28d5cd930621f67b565ef8a64b5ef2a20 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 12 Oct 2020 17:21:30 -0700 Subject: [PATCH] puppet: Move frontend monitoring into its own file. This allows it to be pulled in for deploys like czo, which don't use the full `zulip_ops::app_frontend`, but we wish to monitor. --- puppet/zulip_ops/manifests/app_frontend.pp | 22 +---------------- .../manifests/app_frontend_monitoring.pp | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 21 deletions(-) create mode 100644 puppet/zulip_ops/manifests/app_frontend_monitoring.pp diff --git a/puppet/zulip_ops/manifests/app_frontend.pp b/puppet/zulip_ops/manifests/app_frontend.pp index 9e012efb1d..45fa2f3502 100644 --- a/puppet/zulip_ops/manifests/app_frontend.pp +++ b/puppet/zulip_ops/manifests/app_frontend.pp @@ -4,6 +4,7 @@ class zulip_ops::app_frontend { include zulip::rabbit include zulip::postfix_localmail include zulip::static_asset_compiler + include zulip::app_frontend_monitoring $app_packages = [# Needed for the ssh tunnel to the redis server 'autossh', ] @@ -45,25 +46,4 @@ class zulip_ops::app_frontend { mode => '0644', source => 'puppet:///modules/zulip_ops/cron.d/fetch-contributor-data', } - - # Enable some munin plugins - $munin_plugins = [ - 'rabbitmq_connections', - 'rabbitmq_consumers', - 'rabbitmq_messages', - 'rabbitmq_messages_unacknowledged', - 'rabbitmq_messages_uncommitted', - 'rabbitmq_queue_memory', - 'zulip_send_receive_timing', - ] - zulip_ops::munin_plugin { $munin_plugins: } - - file { '/etc/cron.d/rabbitmq-monitoring': - ensure => file, - require => Package[rabbitmq-server], - owner => 'root', - group => 'root', - mode => '0644', - source => 'puppet:///modules/zulip/cron.d/rabbitmq-monitoring', - } } diff --git a/puppet/zulip_ops/manifests/app_frontend_monitoring.pp b/puppet/zulip_ops/manifests/app_frontend_monitoring.pp new file mode 100644 index 0000000000..fb33eb08f0 --- /dev/null +++ b/puppet/zulip_ops/manifests/app_frontend_monitoring.pp @@ -0,0 +1,24 @@ +# @summary Munin monitoring of a Django frontend and RabbitMQ server. +# +class zulip_ops::app_frontend_monitoring { + include zulip_ops::munin_node + $munin_plugins = [ + 'rabbitmq_connections', + 'rabbitmq_consumers', + 'rabbitmq_messages', + 'rabbitmq_messages_unacknowledged', + 'rabbitmq_messages_uncommitted', + 'rabbitmq_queue_memory', + 'zulip_send_receive_timing', + ] + zulip_ops::munin_plugin { $munin_plugins: } + + file { '/etc/cron.d/rabbitmq-monitoring': + ensure => file, + require => Package[rabbitmq-server], + owner => 'root', + group => 'root', + mode => '0644', + source => 'puppet:///modules/zulip/cron.d/rabbitmq-monitoring', + } +}