Puppet Class: profile::prometheus::snmp_exporter

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • prometheus_all_nodes (Array[Stdlib::Host]) (defaults to: lookup('prometheus_all_nodes'))


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
58
59
60
61
62
63
# File 'modules/profile/manifests/prometheus/snmp_exporter.pp', line 2

class profile::prometheus::snmp_exporter (
  # As of Jan 2022 all SNMP polling happens from codfw/eqiad netmon
  # hosts, therefore allow all Prometheus hosts to talk to snmp_exporter
    Array[Stdlib::Host] $prometheus_all_nodes = lookup('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,
    }

    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,
    }

    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,
    }

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

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

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