Puppet Class: prometheus::node_dpkg_success

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

Overview

SPDX-License-Identifier: Apache-2.0

Class: prometheus::node_dpkg_success

Periodically check whether dpkg is functioning.

Intended to run on all hosts.

Parameters:

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


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

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

    systemd::timer::job { 'prometheus-dpkg-success-textfile':
        ensure          => $ensure,
        description     => 'Update dpkg status exported by node_exporter',
        command         => "${exec} ${outfile}",
        user            => 'prometheus',
        logging_enabled => false,
        require         => [File[$exec]],
        interval        => {'start' => 'OnCalendar', 'interval' => '*:00/30:00'},
        splay           => 1800
    }
}