Filippo Giunchedi has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/299540

Change subject: prometheus: monitor hosts in the current site
......................................................................

prometheus: monitor hosts in the current site

Generate a list of hosts with their respective ganglia cluster for the current
site.

Bug: T126785
Change-Id: I1963f9c3dd36323ddd8a2e0ec21ed7ce4eb8cad4
---
M modules/puppetmaster/manifests/generators.pp
M modules/role/manifests/prometheus/ops.pp
2 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/40/299540/1

diff --git a/modules/puppetmaster/manifests/generators.pp 
b/modules/puppetmaster/manifests/generators.pp
index 412b3bb..0f58af8 100644
--- a/modules/puppetmaster/manifests/generators.pp
+++ b/modules/puppetmaster/manifests/generators.pp
@@ -20,4 +20,13 @@
         source  => 'puppet:///modules/puppetmaster/sshknowngen',
         require => Package[$packages]
     }
+
+    file {'/usr/local/bin/prometheus-ganglia-gen':
+        ensure  => 'present',
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0555',
+        source  => 'puppet:///modules/puppetmaster/prometheus-ganglia-gen',
+        require => Package[$packages]
+    }
 }
diff --git a/modules/role/manifests/prometheus/ops.pp 
b/modules/role/manifests/prometheus/ops.pp
index da5d861..0f9ee6a 100644
--- a/modules/role/manifests/prometheus/ops.pp
+++ b/modules/role/manifests/prometheus/ops.pp
@@ -6,4 +6,16 @@
     prometheus::web { 'ops':
         proxy_pass => 'http://localhost:9900/ops',
     }
+
+    # Query puppet exported resources and generate a list of hosts for
+    # prometheus to poll metrics from. Ganglia::Cluster is used to generate the
+    # mapping from cluster to a list of its members.
+    file { "/srv/prometheus/ops/targets/node_site_${::site}.yaml":
+        content => generate('/usr/local/bin/prometheus-ganglia-gen',
+                            "--site=${::site}"),
+        backup  => false,
+        owner   => 'root',
+        group   => 'root',
+        mode    => '0444',
+    }
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/299540
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1963f9c3dd36323ddd8a2e0ec21ed7ce4eb8cad4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to