Faidon has submitted this change and it was merged.

Change subject: Restore previous version of solr monitoring
......................................................................


Restore previous version of solr monitoring

Restore solr monitoring to pre-66109b55, since the check_solr check was
removed.

Change-Id: I51be2bbdd911faf7f8f68fa39d83b24f66b3fa8f
---
M manifests/role/solr.pp
M templates/icinga/checkcommands.cfg.erb
2 files changed, 15 insertions(+), 20 deletions(-)

Approvals:
  Faidon: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/solr.pp b/manifests/role/solr.pp
index e4f77e4..8038d57 100644
--- a/manifests/role/solr.pp
+++ b/manifests/role/solr.pp
@@ -6,20 +6,27 @@
 #
 # $schema::             Schema file for Solr (only one schema per instance 
supported)
 # $replication_master:: Replication master, if this is current hostname, this 
server will be a master
-class role::solr($schema = undef, $replication_master = undef ) {
+# $monitor::            How to monitor this server:
+#                       * "service" - just presence of Solr
+#                       * "results" - whether Solr has some data in its index
+#                       Any other input will disable monitoring
+class role::solr($schema = undef, $replication_master = undef, $monitor = 
"service" ) {
        class { "::solr":
                schema => $schema,
                replication_master => $replication_master,
        }
 
-       if ($replication_master) {
-               $check_command = "check_solr"
-       } else {
-               $check_command = "check_replicated_solr"
+       if ($monitor == "service") {
+               monitor_service { "Solr":
+                       description => "Solr",
+                       check_command => 
"check_http_url_on_port!$::hostname!8983!200!/solr/select/?q=*%3A*\&start=0\&rows=1\&indent=on"
+               }
        }
-       monitor_service { "Solr":
-               description => "Solr",
-               check_command => "$check_command!$::hostname!400:600!5",
+       elsif ($monitor == "results") {
+               monitor_service { "Solr":
+                       description => "Solr (with a result set check)",
+                       check_command => 
"check_http_url_for_string_on_port!$::hostname!8983!'<str 
name=\"rows\">1</str>'!/solr/select/?q=*%3A*\&start=0\&rows=1\&indent=on"
+               }
        }
 }
 
diff --git a/templates/icinga/checkcommands.cfg.erb 
b/templates/icinga/checkcommands.cfg.erb
index aed1f3f..86c6640 100644
--- a/templates/icinga/checkcommands.cfg.erb
+++ b/templates/icinga/checkcommands.cfg.erb
@@ -86,18 +86,6 @@
        command_line    $USER1$/check_http --ssl -p 8140 -e 400 -H $HOSTADDRESS$
        }
 
-# Example usage:  check_solr!solr1001!500:1000|5
-define command{
-       command_name    check_solr
-       command_line    $USER1$/check_solr -a $ARG2 -t $ARG3 $ARG1
-       }
-
-# Example usage:  check_replicated_solr!solr1001!500:1000|5
-define command{
-       command_name    check_replicated_solr
-       command_line    $USER1$/check_solr -r -a $ARG2 -t $ARG3 $ARG1
-       }
-
 # 'check_ssl_cert'
 # Verify a SSL certificate is not going to expire in the next 14 days
 # Example usage:  check_ssl_cert!secure.wikimedia.org

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I51be2bbdd911faf7f8f68fa39d83b24f66b3fa8f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Faidon <[email protected]>
Gerrit-Reviewer: Faidon <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to