Faidon Liambotis has submitted this change and it was merged. Change subject: ocg: simplify module hierarchy ......................................................................
ocg: simplify module hierarchy There is no reason for "ocg::ganglia::module", "ocg::ganglia" should be enough. Similarly for Nagios, with the extra catch that there is no need for two separate classes, one of which is only used by the other and only contains a single resource. Change-Id: Ia5c16bfc20d7e9e10cd6860a29a06a65506335b2 --- M hieradata/eqiad.yaml M manifests/role/ocg.pp R modules/ocg/manifests/ganglia.pp A modules/ocg/manifests/nagios.pp D modules/ocg/manifests/nagios/check.pp D modules/ocg/manifests/nagios/plugin.pp 6 files changed, 38 insertions(+), 44 deletions(-) Approvals: Giuseppe Lavagetto: Looks good to me, but someone else must approve Faidon Liambotis: Looks good to me, approved jenkins-bot: Verified diff --git a/hieradata/eqiad.yaml b/hieradata/eqiad.yaml index 4983d9b..e6ef38d 100644 --- a/hieradata/eqiad.yaml +++ b/hieradata/eqiad.yaml @@ -25,11 +25,11 @@ ocg::graylog_host: "logstash1002.eqiad.wmnet" ocg::statsd_is_txstatsd: 1 # see modules/ocg/files/nagios/check_ocg_health for descriptions -ocg::nagios::check::wjs: 400000 -ocg::nagios::check::cjs: 800000 -ocg::nagios::check::wrj: 500 -ocg::nagios::check::crj: 3000 -ocg::ganglia::module::data_filesystem: "/srv" +ocg::nagios::wjs: 400000 +ocg::nagios::cjs: 800000 +ocg::nagios::wrj: 500 +ocg::nagios::crj: 3000 +ocg::ganglia::data_filesystem: "/srv" # # Labs diff --git a/manifests/role/ocg.pp b/manifests/role/ocg.pp index f287822..b130560 100644 --- a/manifests/role/ocg.pp +++ b/manifests/role/ocg.pp @@ -15,8 +15,8 @@ include passwords::redis include ::ocg - include ::ocg::nagios::check - include ocg::ganglia::module + include ::ocg::nagios + include ::ocg::ganglia file { $::ocg::temp_dir: ensure => directory, diff --git a/modules/ocg/manifests/ganglia/module.pp b/modules/ocg/manifests/ganglia.pp similarity index 75% rename from modules/ocg/manifests/ganglia/module.pp rename to modules/ocg/manifests/ganglia.pp index 0c16275..e4525b5 100644 --- a/modules/ocg/manifests/ganglia/module.pp +++ b/modules/ocg/manifests/ganglia.pp @@ -1,11 +1,11 @@ -# == Class ocg::ganglia::module +# == Class ocg::ganglia # Includes the ocg.py ganglia module # include this class on your OCG node. # -class ocg::ganglia::module ( - $tmp_filesystem = $::ocg::temp_dir, - $data_filesystem = '/srv', - ) { +class ocg::ganglia ( + $tmp_filesystem = $::ocg::temp_dir, + $data_filesystem = '/srv', +) { file { '/usr/lib/ganglia/python_modules/ocg.py': source => 'puppet:///modules/ocg/ganglia/ocg.py', owner => 'root', diff --git a/modules/ocg/manifests/nagios.pp b/modules/ocg/manifests/nagios.pp new file mode 100644 index 0000000..c5e6e46 --- /dev/null +++ b/modules/ocg/manifests/nagios.pp @@ -0,0 +1,26 @@ +# == Class ocg::nagios +# Sets up icinga alerts for an Offline Content Generator instance. +# +class ocg::nagios ( + $wjs, # warning job status queue messages i.e. 20000 + $cjs, # critical job status queue messages i.e. 30000 + $wrj, # warning render jobs queue messages i.e. 100 + $crj, # critical render jobs queue messages i.e. 500 + $url = 'http://localhost:8000/?command=health', # OCG health check URL +) { + + include nrpe + + file { '/usr/lib/nagios/plugins/check_ocg_health': + source => 'puppet:///modules/ocg/nagios/check_ocg_health', + owner => 'root', + group => 'root', + mode => '0755', + require => Package['nagios-plugins'], + } + + nrpe::monitor_service { 'ocg_health': + description => 'OCG health', + nrpe_command => "/usr/lib/nagios/plugins/check_ocg_health --wjs ${wjs} --cjs ${cjs} --wrj ${wrj} --crj ${crj} --url '${url}'", + } +} diff --git a/modules/ocg/manifests/nagios/check.pp b/modules/ocg/manifests/nagios/check.pp deleted file mode 100644 index bd071d7..0000000 --- a/modules/ocg/manifests/nagios/check.pp +++ /dev/null @@ -1,19 +0,0 @@ -# == Class ocg::nagios::check -# Sets up icinga alerts for an Offline Content Generator instance. -# -class ocg::nagios::check ( - $wjs, # warning job status queue messages i.e. 20000 - $cjs, # critical job status queue messages i.e. 30000 - $wrj, # warning render jobs queue messages i.e. 100 - $crj, # critical render jobs queue messages i.e. 500 - $url = 'http://localhost:8000/?command=health', # OCG health check URL - ) { - include nrpe, - ocg::nagios::plugin - - nrpe::monitor_service { 'ocg_health': - description => 'OCG health', - nrpe_command => "/usr/lib/nagios/plugins/check_ocg_health --wjs ${wjs} --cjs ${cjs} --wrj ${wrj} --crj ${crj} --url '${url}'", - } - -} diff --git a/modules/ocg/manifests/nagios/plugin.pp b/modules/ocg/manifests/nagios/plugin.pp deleted file mode 100644 index 986b897..0000000 --- a/modules/ocg/manifests/nagios/plugin.pp +++ /dev/null @@ -1,13 +0,0 @@ -# == Class ocg::nagios::plugin -# Includes the check_ocg_health python script. -# include this class on your Nagios/Icinga node. -# -class ocg::nagios::plugin { - file { '/usr/lib/nagios/plugins/check_ocg_health': - source => 'puppet:///modules/ocg/nagios/check_ocg_health', - owner => 'root', - group => 'root', - mode => '0755', - require => Package['nagios-plugins'], - } -} -- To view, visit https://gerrit.wikimedia.org/r/175681 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5c16bfc20d7e9e10cd6860a29a06a65506335b2 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Faidon Liambotis <fai...@wikimedia.org> Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits