Puppet Class: profile::prometheus::snmp_exporter

Defined in:
modules/profile/manifests/prometheus/snmp_exporter.pp

Overview

Parameters:

  • prometheus_nodes (Any) (defaults to: hiera('prometheus_all_nodes'))


1
2
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'modules/profile/manifests/prometheus/snmp_exporter.pp', line 1

class profile::prometheus::snmp_exporter (
    # Allow Prometheus (ops instance) hosts to talk to netmon's snmp_exporter in
    # eqiad and codfw.
    $prometheus_nodes = hiera('prometheus_all_nodes'),
) {
    include passwords::network

    class { '::prometheus::snmp_exporter': }

    prometheus::snmp_exporter::module { 'pdu_codfw':
        template  => 'servertech_sentry3',
        community => $passwords::network::snmp_ro_community_pdus_codfw,
    }

    prometheus::snmp_exporter::module { 'pdu_eqiad':
        template  => 'servertech_sentry3',
        community => $passwords::network::snmp_ro_community,
    }

    prometheus::snmp_exporter::module { 'pdu_sentry4_codfw':
        template  => 'servertech_sentry4',
        community => $passwords::network::snmp_ro_community_pdus_codfw,
    }

    prometheus::snmp_exporter::module { 'pdu_sentry4_eqiad':
        template  => 'servertech_sentry4',
        community => $passwords::network::snmp_ro_community,
    }

    prometheus::snmp_exporter::module { 'pdu_sentry4_ulsfo':
        template  => 'servertech_sentry4',
        community => $passwords::network::snmp_ro_community,
    }

    prometheus::snmp_exporter::module { 'pdu_sentry4_esams':
        template  => 'servertech_sentry4',
        community => $passwords::network::snmp_ro_community,
    }

    prometheus::snmp_exporter::module { 'pdu_sentry4_eqsin':
        template  => 'servertech_sentry4',
        community => $passwords::network::snmp_ro_community,
    }

    if $::realm == 'labs' {
        $ferm_srange = '$LABS_NETWORKS'
    } else {
        $prometheus_ferm_nodes = join($prometheus_nodes, ' ')
        $ferm_srange = "(@resolve((${prometheus_ferm_nodes})) @resolve((${prometheus_ferm_nodes}), AAAA))"
    }

    ferm::service { 'prometheus-snmp-exporter':
        proto  => 'tcp',
        port   => '9116',
        srange => $ferm_srange,
    }
}