Add monitoring-plugins Puppet module and drop direct download of the

plugins

fixes #6953
This commit is contained in:
Alexander Fuhr 2014-08-18 16:52:59 +02:00
parent 59c5b70f71
commit aec0591001
3 changed files with 18 additions and 18 deletions

View File

@ -1,6 +1,6 @@
object CheckCommand "dummy-host" { object CheckCommand "dummy-host" {
import "plugin-check-command" import "plugin-check-command"
command = [ PluginDir + "/libexec/test_hostcheck.pl" ] command = [ PluginDir + "/test_hostcheck.pl" ]
arguments = { arguments = {
"--type" = "$check_type$" "--type" = "$check_type$"
"--failchance" = "$check_failchance$" "--failchance" = "$check_failchance$"
@ -18,7 +18,7 @@ object CheckCommand "dummy-host" {
object CheckCommand "dummy-service" { object CheckCommand "dummy-service" {
import "plugin-check-command" import "plugin-check-command"
command = [ PluginDir + "/libexec/test_servicecheck.pl" ] command = [ PluginDir + "/test_servicecheck.pl" ]
arguments = { arguments = {
"--total-critical-on-host" = "$check_critical_on_host$" "--total-critical-on-host" = "$check_critical_on_host$"
"--total-warning-on-host" = "$check_warning_on_host$" "--total-warning-on-host" = "$check_warning_on_host$"

View File

@ -3,7 +3,7 @@ include mysql
include pgsql include pgsql
include openldap include openldap
Exec { path => '/bin:/usr/bin:/sbin' } Exec { path => '/bin:/usr/bin:/sbin:/usr/sbin' }
$icingaVersion = '1.11.5' $icingaVersion = '1.11.5'
$icinga2Version = '2.0.1' $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-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \
--with-cgiurl=/icinga-mysql/cgi-bin \ --with-cgiurl=/icinga-mysql/cgi-bin \
--with-http-auth-file=/usr/share/icinga/htpasswd.users \ --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', creates => '/usr/local/icinga-mysql',
make => 'make all && make fullinstall install-config', 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'] 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-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \
--with-cgiurl=/icinga-pgsql/cgi-bin \ --with-cgiurl=/icinga-pgsql/cgi-bin \
--with-http-auth-file=/usr/share/icinga/htpasswd.users \ --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', creates => '/usr/local/icinga-pgsql',
make => 'make all && make fullinstall install-config', 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'] notify => Service['apache']
} }
@ -210,16 +210,7 @@ exec { 'icinga-htpasswd':
require => Class['apache'] require => Class['apache']
} }
cmmi { 'icinga-plugins': include monitoring-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']
}
cmmi { 'mk-livestatus': cmmi { 'mk-livestatus':
url => "http://mathias-kettner.de/download/mk-livestatus-${livestatusVersion}.tar.gz", 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 { define populate_monitoring_test_config_plugins {
file { "/usr/lib64/nagios/plugins/libexec/${name}": file { "/usr/lib64/nagios/plugins/${name}":
owner => 'icinga', owner => 'icinga',
group => 'icinga', group => 'icinga',
source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}", source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}",

View File

@ -0,0 +1,9 @@
class monitoring-plugins {
include epel
# nagios plugins from epel
package { 'nagios-plugins-all':
ensure => installed,
require => Class['epel']
}
}