[MediaWiki-commits] [Gerrit] statsdlb: replace txstatsd with statsite - change (operations/puppet)

2015-04-09 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has submitted this change and it was merged.

Change subject: statsdlb: replace txstatsd with statsite
..


statsdlb: replace txstatsd with statsite

Start with three instances, should be easy to add more if needed.

Bug: T90111
Change-Id: Ibf9b820b2dd221b6a61064bb7b4e48ae8609feca
---
M manifests/role/statsdlb.pp
M modules/txstatsd/manifests/decommission.pp
2 files changed, 19 insertions(+), 65 deletions(-)

Approvals:
  Filippo Giunchedi: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/statsdlb.pp b/manifests/role/statsdlb.pp
index 158433c..104b66c 100644
--- a/manifests/role/statsdlb.pp
+++ b/manifests/role/statsdlb.pp
@@ -1,8 +1,8 @@
 # == Class: role::statsdlb
 #
 # Provisions a statsdlb instance that listens for StatsD metrics on
-# on UDP port 8125 and forwards to backends on UDP ports 8126-8133,
-# as well as the set of txstatsd backends that listen on these ports.
+# on UDP port 8125 and forwards to backends on UDP ports 8126-8128,
+# as well as the set of statsite backends that listen on these ports.
 #
 class role::statsdlb {
 
@@ -10,7 +10,7 @@
 
 class { '::statsdlb':
 server_port   => 8125,
-backend_ports => range(8126, 8139),
+backend_ports => range(8126, 8128),
 }
 
 nrpe::monitor_service { 'statsdlb':
@@ -18,67 +18,29 @@
 nrpe_command  => '/usr/lib/nagios/plugins/check_procs -c 1: -C 
statsdlb',
 }
 
+class { '::txstatsd::decomission': }
+class { '::statsite': }
 
-# txstatsd back-ends
-
-package { 'python-txstatsd': }
-
-file { '/etc/txstatsd':
-ensure  => directory,
-owner   => 'root',
-group   => 'root',
-mode=> '0555',
-recurse => true,
-purge   => true,
-force   => true,
-source  => 'puppet:///files/txstatsd/backends',
+# statsite backends
+statsite::instance { '8126':
+port  => 8126,
+input_counter => "statsd.${::hostname}-8126.received",
 }
 
-file { '/etc/init/txstatsd':
-ensure  => directory,
-owner   => 'root',
-group   => 'root',
-mode=> '0555',
-recurse => true,
-purge   => true,
-force   => true,
-source  => 'puppet:///files/txstatsd/init',
+statsite::instance { '8127':
+port  => 8127,
+input_counter => "statsd.${::hostname}-8127.received",
 }
 
-group { 'txstatsd':
-ensure => present,
+statsite::instance { '8128':
+port  => 8128,
+input_counter => "statsd.${::hostname}-8127.received",
 }
 
-user { 'txstatsd':
-ensure => present,
-gid=> 'txstatsd',
-shell  => '/bin/false',
-home   => '/nonexistent',
-system => true,
-managehome => false,
-}
-
-file { '/usr/local/sbin/txstatsdctl':
-source => 'puppet:///files/txstatsd/txstatsdctl',
-owner  => 'root',
-group  => 'root',
-mode   => '0755',
-before => Service['txstatsd'],
-}
-
-service { 'txstatsd':
-ensure   => 'running',
-provider => 'base',
-restart  => '/usr/local/sbin/txstatsdctl restart',
-start=> '/usr/local/sbin/txstatsdctl start',
-status   => '/usr/local/sbin/txstatsdctl status',
-stop => '/usr/local/sbin/txstatsdctl stop',
-}
-
-nrpe::monitor_service { 'txstatsd_backends':
-description  => 'txstatsd backend instances',
-nrpe_command => '/usr/local/sbin/txstatsdctl check',
-require  => Service['txstatsd'],
+nrpe::monitor_service { 'statsite_backends':
+description  => 'statsite backend instances',
+nrpe_command => '/sbin/statsitectl check',
+require  => Service['statsite'],
 }
 
 diamond::collector { 'UDPCollector': }
diff --git a/modules/txstatsd/manifests/decommission.pp 
b/modules/txstatsd/manifests/decommission.pp
index eaa3ab6..167d45e 100644
--- a/modules/txstatsd/manifests/decommission.pp
+++ b/modules/txstatsd/manifests/decommission.pp
@@ -4,14 +4,8 @@
 # configuration files.
 #
 class txstatsd::decommission {
-service { 'txstatsd':
-ensure   => stopped,
-provider => upstart,
-}
-
 file { '/etc/init/txstatsd.conf':
 ensure  => absent,
-require => Service['txstatsd'],
 }
 
 file { '/etc/txstatsd':
@@ -28,11 +22,9 @@
 
 user { 'txstatsd':
 ensure  => absent,
-require => Service['txstatsd'],
 }
 
 package { 'python-txstatsd':
 ensure  => absent,
-require => Service['txstatsd'],
 }
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibf9b820b2dd221b6a61064bb7b4e48ae8609feca
Gerrit-PatchSet: 4
Gerrit-Proje

[MediaWiki-commits] [Gerrit] statsdlb: replace txstatsd with statsite - change (operations/puppet)

2015-03-25 Thread Filippo Giunchedi (Code Review)
Filippo Giunchedi has uploaded a new change for review.

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

Change subject: statsdlb: replace txstatsd with statsite
..

statsdlb: replace txstatsd with statsite

Start with three instances, should be easy to add more if needed.

Bug: T90111
Change-Id: Ibf9b820b2dd221b6a61064bb7b4e48ae8609feca
---
M manifests/role/statsdlb.pp
1 file changed, 18 insertions(+), 57 deletions(-)


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

diff --git a/manifests/role/statsdlb.pp b/manifests/role/statsdlb.pp
index 158433c..91d5765 100644
--- a/manifests/role/statsdlb.pp
+++ b/manifests/role/statsdlb.pp
@@ -1,8 +1,8 @@
 # == Class: role::statsdlb
 #
 # Provisions a statsdlb instance that listens for StatsD metrics on
-# on UDP port 8125 and forwards to backends on UDP ports 8126-8133,
-# as well as the set of txstatsd backends that listen on these ports.
+# on UDP port 8125 and forwards to backends on UDP ports 8126-8128,
+# as well as the set of statsite backends that listen on these ports.
 #
 class role::statsdlb {
 
@@ -10,7 +10,7 @@
 
 class { '::statsdlb':
 server_port   => 8125,
-backend_ports => range(8126, 8139),
+backend_ports => range(8126, 8128),
 }
 
 nrpe::monitor_service { 'statsdlb':
@@ -18,67 +18,28 @@
 nrpe_command  => '/usr/lib/nagios/plugins/check_procs -c 1: -C 
statsdlb',
 }
 
+class { '::statsite': }
 
-# txstatsd back-ends
-
-package { 'python-txstatsd': }
-
-file { '/etc/txstatsd':
-ensure  => directory,
-owner   => 'root',
-group   => 'root',
-mode=> '0555',
-recurse => true,
-purge   => true,
-force   => true,
-source  => 'puppet:///files/txstatsd/backends',
+# statsite backends
+statsite::instance { '8126':
+port  => 8126,
+input_counter => "statsd.$::hostname-8126.received",
 }
 
-file { '/etc/init/txstatsd':
-ensure  => directory,
-owner   => 'root',
-group   => 'root',
-mode=> '0555',
-recurse => true,
-purge   => true,
-force   => true,
-source  => 'puppet:///files/txstatsd/init',
+statsite::instance { '8127':
+port  => 8127,
+input_counter => "statsd.$::hostname-8127.received",
 }
 
-group { 'txstatsd':
-ensure => present,
+statsite::instance { '8128':
+port  => 8128,
+input_counter => "statsd.$::hostname-8127.received",
 }
 
-user { 'txstatsd':
-ensure => present,
-gid=> 'txstatsd',
-shell  => '/bin/false',
-home   => '/nonexistent',
-system => true,
-managehome => false,
-}
-
-file { '/usr/local/sbin/txstatsdctl':
-source => 'puppet:///files/txstatsd/txstatsdctl',
-owner  => 'root',
-group  => 'root',
-mode   => '0755',
-before => Service['txstatsd'],
-}
-
-service { 'txstatsd':
-ensure   => 'running',
-provider => 'base',
-restart  => '/usr/local/sbin/txstatsdctl restart',
-start=> '/usr/local/sbin/txstatsdctl start',
-status   => '/usr/local/sbin/txstatsdctl status',
-stop => '/usr/local/sbin/txstatsdctl stop',
-}
-
-nrpe::monitor_service { 'txstatsd_backends':
-description  => 'txstatsd backend instances',
-nrpe_command => '/usr/local/sbin/txstatsdctl check',
-require  => Service['txstatsd'],
+nrpe::monitor_service { 'statsite_backends':
+description  => 'statsite backend instances',
+nrpe_command => '/sbin/statsitectl check',
+require  => Service['statsite'],
 }
 
 diamond::collector { 'UDPCollector': }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf9b820b2dd221b6a61064bb7b4e48ae8609feca
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Filippo Giunchedi 

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