parent
c573123f3f
commit
99f2abe651
|
@ -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'
|
||||||
|
]: }
|
||||||
|
}
|
|
@ -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'],
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue