Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: naggen2: Only use exported resources
......................................................................

naggen2: Only use exported resources

All of our monitoring infrastructure is created around the premise that
we export Puppet resources for monitoring::host and monitoring::service.
Adapt naggen2 to actually filter for these hosts, to a) be conceptually
consistent with the status quo, b) solve duplicate definitions issues on
our icinga servers

Change-Id: I8ab5ce75641319c8c87c316e755e03982dde3cf4
---
M modules/puppetmaster/files/naggen2
1 file changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/316400/1

diff --git a/modules/puppetmaster/files/naggen2 
b/modules/puppetmaster/files/naggen2
index 7c0d3a1..effd2f3 100755
--- a/modules/puppetmaster/files/naggen2
+++ b/modules/puppetmaster/files/naggen2
@@ -97,7 +97,7 @@
   (SELECT resource_id FROM param_values
     JOIN resources ON resource_id = resources.id
     JOIN param_names ON param_names.id = param_name_id
-    WHERE restype = '%s' AND param_names.name = 'ensure' AND value = 'present')
+    WHERE restype = '%s' and exported = true AND param_names.name = 'ensure' 
AND value = 'present')
 GROUP BY resources.id ORDER BY resources.title ASC"""
 
     def load_config(self, configfile):
@@ -142,7 +142,10 @@
             self.restype[what]
         )
         resources_raw = requests.get(url, params={
-            'query': '["=", ["parameter", "ensure"], "present"]',
+            'query': '["and",
+                        ["=", ["parameter", "ensure"], "present"],
+                        ["=", "exported", "true"]
+                    ]',
         })
         return resources_raw.json()
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8ab5ce75641319c8c87c316e755e03982dde3cf4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to