Puppet Class: prometheus::node_sysctl

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

Overview

SPDX-License-Identifier: Apache-2.0

Class: prometheus::node_sysctl

Periodically export select sysctl keys/values to node-exporter textfile collector.

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: 'present')
  • outfile (Pattern[/\.prom$/]) (defaults to: '/var/lib/prometheus/node.d/sysctl.prom')


7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'modules/prometheus/manifests/node_sysctl.pp', line 7

class prometheus::node_sysctl (
    Wmflib::Ensure $ensure = 'present',
    Pattern[/\.prom$/] $outfile = '/var/lib/prometheus/node.d/sysctl.prom',
) {
    file { '/usr/local/bin/prometheus-sysctl':
        ensure => $ensure,
        mode   => '0555',
        owner  => 'root',
        group  => 'root',
        source => 'puppet:///modules/prometheus/usr/local/bin/prometheus-sysctl',
    }

    systemd::timer::job { 'prometheus_sysctl':
        ensure      => $ensure,
        require     => File['/usr/local/bin/prometheus-sysctl'],
        description => 'Regular job to collect select sysctl keys/values',
        user        => 'root',
        command     => "/usr/local/bin/prometheus-sysctl ${outfile}",
        interval    => {'start' => 'OnCalendar', 'interval' => '*:0/5'},
    }
}