Puppet Class: profile::orchestrator::monitoring

Defined in:
modules/profile/manifests/orchestrator/monitoring.pp

Overview

SPDX-License-Identifier: Apache-2.0 monitoring for mysql orchestrator - T266338

Parameters:

  • check_procs (Boolean) (defaults to: lookup('profile::orchestrator::monitoring::check_procs', {'default_value' => false}))
  • check_tcp (Boolean) (defaults to: lookup('profile::orchestrator::monitoring::check_tcp', {'default_value' => false}))
  • check_tcp_host (Stdlib::Host) (defaults to: lookup('profile::orchestrator::monitoring::check_tcp_host', {'default_value' => '127.0.0.1'}))
  • check_tcp_port (Stdlib::Port) (defaults to: lookup('profile::orchestrator::monitoring::check_tcp_port', {'default_value' => 3000}))


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'modules/profile/manifests/orchestrator/monitoring.pp', line 3

class profile::orchestrator::monitoring(
    Boolean $check_procs = lookup('profile::orchestrator::monitoring::check_procs', {'default_value' => false}),
    Boolean $check_tcp = lookup('profile::orchestrator::monitoring::check_tcp', {'default_value' => false}),
    Stdlib::Host $check_tcp_host = lookup('profile::orchestrator::monitoring::check_tcp_host', {'default_value' => '127.0.0.1'}),
    Stdlib::Port $check_tcp_port = lookup('profile::orchestrator::monitoring::check_tcp_port', {'default_value' => 3000}),
){

    $check_procs_ensure = $check_procs ? {
        true    => 'present',
        false   => 'absent',
        default => 'absent',
    }

    $check_tcp_ensure = $check_tcp ? {
        true    => 'present',
        false   => 'absent',
        default => 'absent',
    }

    nrpe::monitor_service { 'orchestrator_process':
        ensure       => $check_procs_ensure,
        description  => 'orchestrator process',
        nrpe_command => "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 --ereg-argument-array 'orchestrator http'",
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Orchestrator',
    }

    nrpe::monitor_service { 'orchestrator_tcp_port':
        ensure       => $check_tcp_ensure,
        description  => 'orchestrator TCP port',
        nrpe_command => "/usr/lib/nagios/plugins/check_tcp -H ${check_tcp_host} -p ${check_tcp_port}",
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Orchestrator',
    }
}