Add module `monitoring_test_config'

refs #6842
This commit is contained in:
Alexander Klimov 2014-09-15 11:26:14 +02:00
parent c573123f3f
commit 99f2abe651
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,25 @@
class monitoring_test_config {
package { [
'perl',
'perl-Module-Install',
'perl-CPAN',
'perl-File-Which',
'perl-Time-HiRes'
]:
ensure => latest,
}
-> git_cmmi { 'Monitoring-Generator-TestConfig':
url => 'https://github.com/sni/Monitoring-Generator-TestConfig.git',
configure => 'perl Makefile.PL',
make => 'make && make test && make install',
}
-> exec { 'create_monitoring_test_config':
path => '/usr/local/bin:/usr/bin:/bin',
command => 'install -o root -g root -d /usr/local/share/misc/ && \
create_monitoring_test_config.pl -l icinga /usr/local/share/misc/monitoring_test_config',
creates => '/usr/local/share/misc/monitoring_test_config',
}
-> monitoring_test_config::populate_plugins { [
'test_hostcheck.pl', 'test_servicecheck.pl'
]: }
}

View File

@ -0,0 +1,17 @@
define monitoring_test_config::populate_plugins {
include icinga2
include monitoring_plugins
include monitoring_test_config
file { "/usr/lib64/nagios/plugins/${name}":
owner => 'icinga',
group => 'icinga',
source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}",
require => [
User['icinga'],
Exec['create_monitoring_test_config'],
Class['monitoring_plugins']
],
notify => Service['icinga2'],
}
}