Alexandros Kosiaris has uploaded a new change for review.

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

Change subject: udp2log: Remove the $monitor_packet_loss and $packet_loss_log 
parameters
......................................................................

udp2log: Remove the $monitor_packet_loss and $packet_loss_log parameters

There is but one caller of udp2log instance and it does not specify the
$packet_loss_log parameter and specifies $monitor_packet_loss as false.
That latter parameter is passed verbatim to from udp2log::instance to
udp2log::instance::monitoring and is only used in one if clause which
clearly does not ever happen in our environment. Killing all this
functionality which is never used means less code to maintain and also
removes code dependent on monitoring::ganglia which we also want to
remove since we are deprecating ganglia

Change-Id: Ic72d58410556727b1b3743d26b70f7d340e32635
---
M manifests/role/logging.pp
M modules/udp2log/manifests/instance.pp
M modules/udp2log/manifests/instance/monitoring.pp
3 files changed, 10 insertions(+), 71 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/68/314668/1

diff --git a/manifests/role/logging.pp b/manifests/role/logging.pp
index bbe36d2..84b6aec 100644
--- a/manifests/role/logging.pp
+++ b/manifests/role/logging.pp
@@ -53,12 +53,11 @@
     $logstash_port = 8324
 
     udp2log::instance { 'mw':
-        log_directory       =>    $log_directory,
-        monitor_log_age     =>    false,
-        monitor_processes   =>    false,
-        monitor_packet_loss =>    false,
-        rotate              =>    $rotate,
-        template_variables  => {
+        log_directory      =>    $log_directory,
+        monitor_log_age    =>    false,
+        monitor_processes  =>    false,
+        rotate             =>    $rotate,
+        template_variables => {
             error_processor_host => 'eventlog1001.eqiad.wmnet',
             error_processor_port => 8423,
 
diff --git a/modules/udp2log/manifests/instance.pp 
b/modules/udp2log/manifests/instance.pp
index 7ba2a14..466df03 100644
--- a/modules/udp2log/manifests/instance.pp
+++ b/modules/udp2log/manifests/instance.pp
@@ -5,15 +5,12 @@
 # == Parameters
 # $port                - Default 8420.
 # $log_directory       - Main location for log files.Default: /var/log/udp2log
-# $packet_loss_log     - Path to packet-loss.log file.  Used for monitoring.
-#                        Default: $log_directory/packet-loss.log.
 # $logrotate           - If true, sets up a logrotate file for files in
 #                        $log_directory. Default: true
 # $multicast           - If true, the udp2log instance will be started with the
 #                        --multicast 233.58.59.1. If you give a string,
 #                        --mulitcast will be set to this string. Default: false
 # $ensure              - Either 'stopped' or 'running'. Default: 'running'
-# $monitor_packet_loss - bool. Default: true
 # $monitor_processes   - bool. Default: true
 # $monitor_log_age     - bool. Default: true
 # $template_variables  - arbitrary variable(s) for use in udp2log config
@@ -29,8 +26,6 @@
     $logrotate           = true,
     $multicast           = false,
     $ensure              = 'running',
-    $packet_loss_log     = undef,
-    $monitor_packet_loss = true,
     $monitor_processes   = true,
     $monitor_log_age     = true,
     $template_variables  = undef,
@@ -114,13 +109,11 @@
     if $::udp2log::monitor {
         # include monitoring for this udp2log instance.
         udp2log::instance::monitoring { $name:
-            ensure              => $ensure,
-            log_directory       => $log_directory,
-            packet_loss_log     => $packet_loss_log,
-            monitor_packet_loss => $monitor_packet_loss,
-            monitor_processes   => $monitor_processes,
-            monitor_log_age     => $monitor_log_age,
-            require             => Service["udp2log-${name}"],
+            ensure            => $ensure,
+            log_directory     => $log_directory,
+            monitor_processes => $monitor_processes,
+            monitor_log_age   => $monitor_log_age,
+            require           => Service["udp2log-${name}"],
         }
     }
 }
diff --git a/modules/udp2log/manifests/instance/monitoring.pp 
b/modules/udp2log/manifests/instance/monitoring.pp
index 95025cf..4839300 100644
--- a/modules/udp2log/manifests/instance/monitoring.pp
+++ b/modules/udp2log/manifests/instance/monitoring.pp
@@ -10,8 +10,6 @@
 define udp2log::instance::monitoring(
     $log_directory       = '/var/log/udp2log',
     $ensure              = 'running',
-    $packet_loss_log     = undef,
-    $monitor_packet_loss = true,
     $monitor_processes   = true,
     $monitor_log_age     = true,
 ) {
@@ -21,7 +19,6 @@
     # There are 3 ways udp2log instances are currently defined:
     # - Check age of udp2log files.
     # - Check that udp2log filter processes are running.
-    # - Check the packet-loss log file for execessive packet loss.
     # These different monitors are enabled or disabled using
     # their corresponding $monitor_xxxxx arguments passed into
     # this class.
@@ -50,56 +47,6 @@
             nrpe_command  => "/usr/lib/nagios/plugins/check_udp2log_procs 
${name}",
             contact_group => 'admins,analytics',
             retries       => 10,
-        }
-    }
-    # TODO else ensure absent,
-    # can't do this right now due to missing dependencies
-
-    # Monitor packet loss using the $packet_loss_log.
-    # This requires that filters.$name.erb has a
-    # packet-loss filter defined and outputting
-    # to $packet_loss_log_file.
-    if ($monitor_packet_loss == true and $ensure == 'running') {
-        $ensure_monitor_packet_loss = 'present'
-    }
-    else {
-        $ensure_monitor_packet_loss = 'absent'
-    }
-
-    # The packet loss file by default is in
-    # $log_directory/packet-loss.log.  If it was
-    # passed in explicitly, then use the value given.
-    $packet_loss_log_file = $packet_loss_log ? {
-        undef   => "${log_directory}/packet-loss.log",
-        default => $packet_loss_log,
-    }
-
-    if ($monitor_packet_loss == true) {
-        # Set up a cron to tail the packet loss log for this
-        # instance into ganglia.
-        cron { "ganglia-logtailer-udp2log-${name}":
-            ensure  => $ensure_monitor_packet_loss,
-            command => "/usr/sbin/ganglia-logtailer --classname 
PacketLossLogtailer --log_file ${packet_loss_log_file} --mode cron >> 
/var/log/ganglia/ganglia-logtailer.log 2>&1 ",
-            user    => 'root',
-            minute  => '*/5',
-        }
-
-        # Set up nagios monitoring of packet loss
-        # for this udp2log instance.
-        monitoring::ganglia{ "udp2log-${name}-packetloss":
-            ensure                => $ensure_monitor_packet_loss,
-            description           => 'Packetloss_Average',
-            metric                => 'packet_loss_average',
-            warning               => '4',
-            critical              => '8',
-            contact_group         => 'admins,analytics',
-            # ganglia-logtailer only runs every 5.
-            # let's make nagios check every 2 minutes (to match ganglia_parser)
-            # and retry 4 times (total 8 minutes) before
-            # declaring a hard failure.
-            normal_check_interval => 2,
-            retry_check_interval  => 2,
-            retries               => 4,
         }
     }
     # TODO else ensure absent,

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

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

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

Reply via email to