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'
|
2021-12-28 02:08:41 +01:00
|
|
|
$dir = "/srv/zulip-node_exporter-${version}"
|
|
|
|
$bin = "${dir}/node_exporter"
|
2021-12-29 21:55:37 +01:00
|
|
|
|
|
|
|
zulip::external_dep { 'node_exporter':
|
|
|
|
version => $version,
|
|
|
|
url => "https://github.com/prometheus/node_exporter/releases/download/v${version}/node_exporter-${version}.linux-${::architecture}.tar.gz",
|
|
|
|
sha256 => '8c1f6a317457a658e0ae68ad710f6b4098db2cad10204649b51e3c043aa3e70d',
|
2021-12-28 02:08:41 +01:00
|
|
|
tarball_prefix => "node_exporter-${version}.linux-${::architecture}",
|
2020-07-23 22:29:00 +02:00
|
|
|
}
|
2021-12-29 21:55:37 +01:00
|
|
|
|
|
|
|
# This was moved to an external_dep in 2021/12, and these lines can
|
|
|
|
# be removed once all prod hosts no longer have this file.
|
2020-07-23 22:29:00 +02:00
|
|
|
file { '/usr/local/bin/node_exporter':
|
2021-12-29 21:55:37 +01:00
|
|
|
ensure => absent,
|
2020-07-23 22:29:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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],
|
2021-12-29 21:44:03 +01:00
|
|
|
Zulip::External_Dep['node_exporter'],
|
2020-07-23 22:29:00 +02:00
|
|
|
],
|
|
|
|
owner => 'root',
|
|
|
|
group => 'root',
|
|
|
|
mode => '0644',
|
2021-12-29 21:55:37 +01:00
|
|
|
content => template('zulip_ops/supervisor/conf.d/prometheus_node_exporter.conf.template.erb'),
|
2020-07-23 22:29:00 +02:00
|
|
|
notify => Service[supervisor],
|
|
|
|
}
|
|
|
|
}
|