Herron has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392423 )

Change subject: icinga: add support for puppet 4 in backend puppetmaster https 
checks
......................................................................

icinga: add support for puppet 4 in backend puppetmaster https checks

Bug: T180944
Change-Id: Ifa0b210f2c8ecdeede121ea6ed962866f96a1113
---
M modules/nagios_common/files/checkcommands.cfg
M modules/puppetmaster/manifests/init.pp
M modules/puppetmaster/manifests/monitoring.pp
3 files changed, 17 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/23/392423/1

diff --git a/modules/nagios_common/files/checkcommands.cfg 
b/modules/nagios_common/files/checkcommands.cfg
index 96c1cce..9a3b0e7 100644
--- a/modules/nagios_common/files/checkcommands.cfg
+++ b/modules/nagios_common/files/checkcommands.cfg
@@ -104,7 +104,7 @@
 
 define command {
     command_name    check_https_port_status
-    command_line    $USER1$/check_http -S -H $HOSTADDRESS$ -p $ARG1$ -e $ARG2$
+    command_line    $USER1$/check_http -S -H $HOSTADDRESS$ -p $ARG1$ -e $ARG2$ 
-u $ARG3$
     }
 
 define command {
diff --git a/modules/puppetmaster/manifests/init.pp 
b/modules/puppetmaster/manifests/init.pp
index e15b50f..9c13998 100644
--- a/modules/puppetmaster/manifests/init.pp
+++ b/modules/puppetmaster/manifests/init.pp
@@ -158,12 +158,16 @@
         group               => $git_group,
     }
 
+    class { '::puppetmaster::monitoring' :
+        puppet_major_version => $puppet_major_version,
+    }
+
     include ::puppetmaster::scripts
     include ::puppetmaster::geoip
     include ::puppetmaster::gitpuppet
-    include ::puppetmaster::monitoring
     include ::puppetmaster::generators
 
+
     # deploy updated auth template to puppet 4 masters
     $puppetmaster_auth_template = $puppet_major_version ? {
         4       => 'auth-master-v4.conf.erb',
diff --git a/modules/puppetmaster/manifests/monitoring.pp 
b/modules/puppetmaster/manifests/monitoring.pp
index 515a255..aff0da3 100644
--- a/modules/puppetmaster/manifests/monitoring.pp
+++ b/modules/puppetmaster/manifests/monitoring.pp
@@ -1,21 +1,29 @@
 # This class collects all alerts and metrics collection monitoring
 # for the puppemaster module.
 
-class puppetmaster::monitoring ($server_type = $::puppetmaster::server_type) {
+class puppetmaster::monitoring (
+    $server_type = $::puppetmaster::server_type,
+    $puppet_major_version = undef,
+){
 
     # monitor HTTPS on puppetmasters
     # Note that for frontends both 8140 and 8141 ports will be checked since
     # both will be used
+    $puppetmaster_check_uri = $puppet_major_version ? {
+        4       => '/puppet/v3',
+        default => '/',
+    }
+
     if $server_type == 'frontend' or $server_type == 'standalone' {
         monitoring::service { 'puppetmaster_https':
             description   => 'puppetmaster https',
-            check_command => 'check_https_port_status!8140!400',
+            check_command => 
'check_https_port_status!8140!400!${puppetmaster_check_uri}',
         }
     }
     if $server_type == 'frontend' or $server_type == 'backend' {
         monitoring::service { 'puppetmaster_backend_https':
             description   => 'puppetmaster backend https',
-            check_command => 'check_https_port_status!8141!400',
+            check_command => 
'check_https_port_status!8141!400!${puppetmaster_check_uri}',
         }
     }
 

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

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

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

Reply via email to