Puppet Class: prometheus::node_nic_firmware

Defined in:
modules/prometheus/manifests/node_nic_firmware.pp

Overview

Class: prometheus::node_nic_firmware

Periodically export network interface device drivers & firmware versions.

Intended to run on all physical hosts (not useful on e.g. Ganeti-hosted VMs).

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • outfile (Stdlib::Unixpath) (defaults to: '/var/lib/prometheus/node.d/nic_firmware.prom')


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

class prometheus::node_nic_firmware (
    Wmflib::Ensure $ensure = 'present',
    Stdlib::Unixpath $outfile = '/var/lib/prometheus/node.d/nic_firmware.prom',
) {
    $exec = '/usr/local/bin/prometheus-nic-firmware'
    file { $exec:
        ensure => $ensure,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-nic-firmware.sh',
    }

    systemd::timer::job { 'prometheus-nic-firmware-textfile':
        ensure             => $ensure,
        description        => 'Update NIC firmware stats exported by node_exporter',
        command            => "${exec} ${outfile}",
        user               => 'root',
        logging_enabled    => false,
        monitoring_enabled => false,
        require            => [File[$exec]],
        interval           => {
            # We don't care about when this runs, as long as it runs every few minutes.
            # We also explicitly *don't* want to synchronize its execution across hosts,
            # as OnCalendar would do, and this should have some natural splay.
            'start'    => 'OnUnitInactiveSec',
            'interval' => '300s',
        },
    }
}