puppet: Automate autossh process monitoring maintenance.

Previously, the Zulip Nagios configuration effectively hardcoded the
count for how many system should have autossh connections.
This commit is contained in:
Tim Abbott 2016-08-03 12:53:03 -07:00 committed by Tim Abbott
parent 6bdb10b71b
commit 4fbe201187
5 changed files with 20 additions and 23 deletions

View File

@ -35,15 +35,6 @@ define service{
check_command check_load!7.0!6.0!5.0!10.0!8.0!6.0
}
define service{
use generic-service
host_name nagios
service_description Number of autossh processes
# If you change the number of munin autossh processes, change
# the second and third arguments, below.
check_command check_named_procs!autossh!10:10!10:17
}
define service{
use generic-service
host_name nagios

View File

@ -34,6 +34,9 @@ class zulip_ops::base {
# Add system users here
$users = []
# Add hosts to monitor here
$hosts = []
file { '/etc/apt/apt.conf.d/02periodic':
ensure => file,
mode => 644,

View File

@ -7,20 +7,7 @@ class zulip_ops::munin {
]
package { $munin_packages: ensure => "installed" }
# If you add a new Munin node, change the number of autossh processes that we
# check for with Nagios.
$hosts = ["trac",
"zmirror",
"staging",
"git",
"bots",
"prod0",
"stats",
"postgres1",
"postgres3",
"redis0",
]
$hosts = $zulip_ops::base::hosts
file { "/etc/munin":
require => Package["munin"],

View File

@ -55,6 +55,15 @@ class zulip_ops::nagios {
group => "root",
source => '/root/zulip/api/integrations/nagios/zulip_nagios.cfg',
}
$hosts = $zulip_ops::base::hosts
file { '/etc/nagios3/conf.d/zulip_autossh.cfg':
ensure => file,
mode => 644,
owner => "root",
group => "root",
content => template('zulip_ops/nagios_autossh.template.erb'),
}
file { '/etc/nagios3/zuliprc':
ensure => file,
mode => 644,

View File

@ -0,0 +1,7 @@
define service{
use generic-service
host_name nagios
service_description Number of autossh processes
check_command check_named_procs!autossh!<%= @hosts.length %>:<%= @hosts.length %>!<%= @hosts.length %>:<%= @hosts.length + 2 %>
}