From aec0591001b89d65104d07451d920b878c1f81d6 Mon Sep 17 00:00:00 2001 From: Alexander Fuhr Date: Mon, 18 Aug 2014 16:52:59 +0200 Subject: [PATCH] Add monitoring-plugins Puppet module and drop direct download of the plugins fixes #6953 --- .../files/etc/icinga2/conf.d/test-config.conf | 4 ++-- .vagrant-puppet/manifests/default.pp | 23 ++++++------------- .../monitoring-plugins/manifests/init.pp | 9 ++++++++ 3 files changed, 18 insertions(+), 18 deletions(-) create mode 100644 .vagrant-puppet/modules/monitoring-plugins/manifests/init.pp diff --git a/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf b/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf index 412307328..f25df325b 100644 --- a/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf +++ b/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf @@ -1,6 +1,6 @@ object CheckCommand "dummy-host" { import "plugin-check-command" - command = [ PluginDir + "/libexec/test_hostcheck.pl" ] + command = [ PluginDir + "/test_hostcheck.pl" ] arguments = { "--type" = "$check_type$" "--failchance" = "$check_failchance$" @@ -18,7 +18,7 @@ object CheckCommand "dummy-host" { object CheckCommand "dummy-service" { import "plugin-check-command" - command = [ PluginDir + "/libexec/test_servicecheck.pl" ] + command = [ PluginDir + "/test_servicecheck.pl" ] arguments = { "--total-critical-on-host" = "$check_critical_on_host$" "--total-warning-on-host" = "$check_warning_on_host$" diff --git a/.vagrant-puppet/manifests/default.pp b/.vagrant-puppet/manifests/default.pp index 6649e69f9..5caf10452 100644 --- a/.vagrant-puppet/manifests/default.pp +++ b/.vagrant-puppet/manifests/default.pp @@ -3,7 +3,7 @@ include mysql include pgsql include openldap -Exec { path => '/bin:/usr/bin:/sbin' } +Exec { path => '/bin:/usr/bin:/sbin:/usr/sbin' } $icingaVersion = '1.11.5' $icinga2Version = '2.0.1' @@ -76,10 +76,10 @@ cmmi { 'icinga-mysql': --with-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \ --with-cgiurl=/icinga-mysql/cgi-bin \ --with-http-auth-file=/usr/share/icinga/htpasswd.users \ - --with-plugin-dir=/usr/lib64/nagios/plugins/libexec', + --with-plugin-dir=/usr/lib64/nagios/plugins', creates => '/usr/local/icinga-mysql', make => 'make all && make fullinstall install-config', - require => [ User['icinga'], Cmmi['icinga-plugins'], Package['apache'] ], + require => [ User['icinga'], Class['monitoring-plugins'], Package['apache'] ], notify => Service['apache'] } @@ -102,10 +102,10 @@ cmmi { 'icinga-pgsql': --with-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \ --with-cgiurl=/icinga-pgsql/cgi-bin \ --with-http-auth-file=/usr/share/icinga/htpasswd.users \ - --with-plugin-dir=/usr/lib64/nagios/plugins/libexec', + --with-plugin-dir=/usr/lib64/nagios/plugins', creates => '/usr/local/icinga-pgsql', make => 'make all && make fullinstall install-config', - require => [ User['icinga'], Cmmi['icinga-plugins'], Package['apache'] ], + require => [ User['icinga'], Class['monitoring-plugins'], Package['apache'] ], notify => Service['apache'] } @@ -210,16 +210,7 @@ exec { 'icinga-htpasswd': require => Class['apache'] } -cmmi { 'icinga-plugins': - url => "https://www.monitoring-plugins.org/download/monitoring-plugins-${pluginVersion}.tar.gz", - output => "monitoring-plugins-${pluginVersion}.tar.gz", - flags => '--prefix=/usr/lib64/nagios/plugins \ - --with-nagios-user=icinga --with-nagios-group=icinga \ - --with-cgiurl=/icinga-mysql/cgi-bin', - creates => '/usr/lib64/nagios/plugins/libexec', - make => 'make && make install', - require => User['icinga'] -} +include monitoring-plugins cmmi { 'mk-livestatus': url => "http://mathias-kettner.de/download/mk-livestatus-${livestatusVersion}.tar.gz", @@ -577,7 +568,7 @@ populate_monitoring_test_config { ['commands', 'contacts', 'dependencies', } define populate_monitoring_test_config_plugins { - file { "/usr/lib64/nagios/plugins/libexec/${name}": + file { "/usr/lib64/nagios/plugins/${name}": owner => 'icinga', group => 'icinga', source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}", diff --git a/.vagrant-puppet/modules/monitoring-plugins/manifests/init.pp b/.vagrant-puppet/modules/monitoring-plugins/manifests/init.pp new file mode 100644 index 000000000..6dc7be09d --- /dev/null +++ b/.vagrant-puppet/modules/monitoring-plugins/manifests/init.pp @@ -0,0 +1,9 @@ +class monitoring-plugins { + include epel + + # nagios plugins from epel + package { 'nagios-plugins-all': + ensure => installed, + require => Class['epel'] + } +} \ No newline at end of file