Puppet Class: profile::prometheus::snmp_exporter

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

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • datacenters (Array[String]) (defaults to: lookup('datacenters'))


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
# File 'modules/profile/manifests/prometheus/snmp_exporter.pp', line 2

class profile::prometheus::snmp_exporter (
    Array[String] $datacenters = lookup('datacenters'),
) {
    include passwords::network

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

    $datacenters.each |$dc| {
        #sentry3 (obsolete?)
        prometheus::snmp_exporter::module { "pdu_${dc}":
            template  => 'servertech_sentry3',
            community => $passwords::network::snmp_ro_community,
        }

        prometheus::snmp_exporter::module { "pdu_pro4x_${dc}":
            template  => 'servertech_pro4x',
            community => $passwords::network::snmp_ro_community,
        }

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

    if $::realm == 'labs' {
        firewall::service { 'prometheus-snmp-exporter':
            proto    => 'tcp',
            port     => 9116,
            src_sets => ['LABS_NETWORKS'],
        }
    } else {
        # As of Jan 2022 all SNMP polling happens from codfw/eqiad netmon hosts.
        # Therefore allow all Prometheus hosts to talk to snmp_exporter
        firewall::service { 'prometheus-snmp-exporter':
            proto  => 'tcp',
            port   => 9116,
            srange => prometheus::all_nodes(),
        }
    }
}