2020-07-23 22:29:00 +02:00
|
|
|
# @summary Configures a node for monitoring with Prometheus
|
|
|
|
#
|
|
|
|
class zulip_ops::prometheus::node {
|
|
|
|
include zulip_ops::prometheus::base
|
|
|
|
include zulip::supervisor
|
|
|
|
|
|
|
|
$version = '1.1.2'
|
|
|
|
zulip::sha256_tarball_to { 'node_exporter':
|
2021-12-06 18:43:29 +01:00
|
|
|
url => "https://github.com/prometheus/node_exporter/releases/download/v${version}/node_exporter-${version}.linux-${::architecture}.tar.gz",
|
2020-07-23 22:29:00 +02:00
|
|
|
sha256 => '8c1f6a317457a658e0ae68ad710f6b4098db2cad10204649b51e3c043aa3e70d',
|
|
|
|
install => {
|
2021-12-06 18:43:29 +01:00
|
|
|
"node_exporter-${version}.linux-${::architecture}/node_exporter" => "/usr/local/bin/node_exporter-${version}",
|
2020-07-23 22:29:00 +02:00
|
|
|
},
|
|
|
|
}
|
|
|
|
file { '/usr/local/bin/node_exporter':
|
|
|
|
ensure => 'link',
|
|
|
|
target => "/usr/local/bin/node_exporter-${version}",
|
|
|
|
require => Zulip::Sha256_tarball_to['node_exporter'],
|
|
|
|
}
|
|
|
|
|
|
|
|
zulip_ops::firewall_allow { 'node_exporter': port => '9100' }
|
2021-06-11 22:37:36 +02:00
|
|
|
file { "${zulip::common::supervisor_conf_dir}/prometheus_node_exporter.conf":
|
2020-07-23 22:29:00 +02:00
|
|
|
ensure => file,
|
|
|
|
require => [
|
2021-08-03 05:10:32 +02:00
|
|
|
User[zulip],
|
2020-07-23 22:29:00 +02:00
|
|
|
Package[supervisor],
|
|
|
|
File['/usr/local/bin/node_exporter'],
|
|
|
|
],
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
|
|
|
source => 'puppet:///modules/zulip_ops/supervisor/conf.d/prometheus_node_exporter.conf',
|
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
}
|