mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 09:14:08 +02:00
Merge branch 'feature/vagrant-monitoring-test-config-4506'
resolves #4506
This commit is contained in:
commit
455e37916d
@ -384,3 +384,73 @@ exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql':
|
||||
unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Pgsql',
|
||||
require => Exec['install ZendFramework']
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Following section installs the Perl module Monitoring::Generator::TestConfig in order to create test config to
|
||||
# */usr/local/share/misc/monitoring_test_config*. Then the config is copied to *<instance>/etc/conf.d/test_config/* of
|
||||
# both the MySQL and PostgreSQL Icinga instance
|
||||
#
|
||||
cpan { 'Monitoring::Generator::TestConfig':
|
||||
creates => '/usr/local/share/perl5/Monitoring/Generator/TestConfig.pm',
|
||||
timeout => 600
|
||||
}
|
||||
|
||||
exec { 'create_monitoring_test_config':
|
||||
command => 'sudo install -o root -g root -d /usr/local/share/misc/ && \
|
||||
sudo /usr/local/bin/create_monitoring_test_config.pl -l icinga \
|
||||
/usr/local/share/misc/monitoring_test_config',
|
||||
creates => '/usr/local/share/misc/monitoring_test_config',
|
||||
require => Cpan['Monitoring::Generator::TestConfig']
|
||||
}
|
||||
|
||||
define populate_monitoring_test_config {
|
||||
file { "/usr/local/icinga-mysql/etc/conf.d/test_config/${name}.cfg":
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
||||
notify => Service['icinga-mysql']
|
||||
}
|
||||
file { "/usr/local/icinga-pgsql/etc/conf.d/test_config/${name}.cfg":
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/etc/conf.d/${name}.cfg",
|
||||
notify => Service['icinga-pgsql']
|
||||
}
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-mysql/etc/conf.d/test_config/':
|
||||
ensure => directory,
|
||||
owner => icinga,
|
||||
group => icinga,
|
||||
require => Cmmi['icinga-mysql']
|
||||
}
|
||||
|
||||
file { '/usr/local/icinga-pgsql/etc/conf.d/test_config/':
|
||||
ensure => directory,
|
||||
owner => icinga,
|
||||
group => icinga,
|
||||
require => Cmmi['icinga-pgsql']
|
||||
}
|
||||
|
||||
populate_monitoring_test_config { ['commands', 'contacts', 'dependencies',
|
||||
'hostgroups', 'hosts', 'servicegroups', 'services']:
|
||||
require => [ Exec['create_monitoring_test_config'],
|
||||
File['/usr/local/icinga-mysql/etc/conf.d/test_config/'],
|
||||
File['/usr/local/icinga-pgsql/etc/conf.d/test_config/'] ]
|
||||
}
|
||||
|
||||
define populate_monitoring_test_config_plugins {
|
||||
file { "/usr/lib64/nagios/plugins/libexec/${name}":
|
||||
owner => 'icinga',
|
||||
group => 'icinga',
|
||||
source => "/usr/local/share/misc/monitoring_test_config/plugins/${name}",
|
||||
notify => [ Service['icinga-mysql'], Service['icinga-pgsql'] ]
|
||||
}
|
||||
}
|
||||
|
||||
populate_monitoring_test_config_plugins{ ['test_hostcheck.pl', 'test_servicecheck.pl']:
|
||||
require => [ Exec['create_monitoring_test_config'],
|
||||
Cmmi['icinga-mysql'],
|
||||
Cmmi['icinga-pgsql'] ]
|
||||
}
|
||||
|
49
.vagrant-puppet/modules/cpan/manifests/init.pp
Normal file
49
.vagrant-puppet/modules/cpan/manifests/init.pp
Normal file
@ -0,0 +1,49 @@
|
||||
# Define: cpan
|
||||
#
|
||||
# Download and install Perl modules from the Perl Archive Network, the canonical location for Perl code and modules.
|
||||
#
|
||||
# Parameters:
|
||||
# [*creates*] - target directory the software will install to.
|
||||
# [*timeout* ] - timeout for the CPAN command.
|
||||
#
|
||||
# Actions:
|
||||
#
|
||||
# Requires:
|
||||
#
|
||||
# Perl
|
||||
#
|
||||
# Sample Usage:
|
||||
#
|
||||
# cpan { 'perl-module':
|
||||
# creates => '/usr/local/share/perl5/perl-module',
|
||||
# timeout => 600
|
||||
# }
|
||||
#
|
||||
define cpan(
|
||||
$creates,
|
||||
$timeout
|
||||
) {
|
||||
|
||||
Exec { path => '/usr/bin' }
|
||||
|
||||
package { 'perl-CPAN':
|
||||
ensure => installed
|
||||
}
|
||||
|
||||
file { [ '/root/.cpan/', '/root/.cpan/CPAN/' ]:
|
||||
ensure => directory
|
||||
}
|
||||
|
||||
file { '/root/.cpan/CPAN/MyConfig.pm':
|
||||
content => template('cpan/MyConfig.pm.erb'),
|
||||
require => [ Package['perl-CPAN'],
|
||||
File[[ '/root/.cpan/', '/root/.cpan/CPAN/' ]] ]
|
||||
}
|
||||
|
||||
exec { "cpan-${name}":
|
||||
command => "sudo perl -MCPAN -e 'install ${name}'",
|
||||
creates => $creates,
|
||||
require => File['/root/.cpan/CPAN/MyConfig.pm'],
|
||||
timeout => $timeout
|
||||
}
|
||||
}
|
68
.vagrant-puppet/modules/cpan/templates/MyConfig.pm.erb
Normal file
68
.vagrant-puppet/modules/cpan/templates/MyConfig.pm.erb
Normal file
@ -0,0 +1,68 @@
|
||||
$CPAN::Config = {
|
||||
'applypatch' => q[],
|
||||
'auto_commit' => q[0],
|
||||
'build_cache' => q[100],
|
||||
'build_dir' => q[/root/.cpan/build],
|
||||
'build_dir_reuse' => q[0],
|
||||
'build_requires_install_policy' => q[ask/yes],
|
||||
'bzip2' => q[/usr/bin/bzip2],
|
||||
'cache_metadata' => q[1],
|
||||
'check_sigs' => q[0],
|
||||
'commandnumber_in_prompt' => q[1],
|
||||
'connect_to_internet_ok' => q[1],
|
||||
'cpan_home' => q[/root/.cpan],
|
||||
'curl' => q[/usr/bin/curl],
|
||||
'ftp' => q[],
|
||||
'ftp_passive' => q[1],
|
||||
'ftp_proxy' => q[],
|
||||
'getcwd' => q[cwd],
|
||||
'gpg' => q[/usr/bin/gpg],
|
||||
'gzip' => q[/bin/gzip],
|
||||
'halt_on_failure' => q[0],
|
||||
'histfile' => q[/root/.cpan/histfile],
|
||||
'histsize' => q[100],
|
||||
'http_proxy' => q[],
|
||||
'inactivity_timeout' => q[0],
|
||||
'index_expire' => q[1],
|
||||
'inhibit_startup_message' => q[0],
|
||||
'keep_source_where' => q[/root/.cpan/sources],
|
||||
'load_module_verbosity' => q[v],
|
||||
'lynx' => q[],
|
||||
'make' => q[/usr/bin/make],
|
||||
'make_arg' => q[],
|
||||
'make_install_arg' => q[],
|
||||
'make_install_make_command' => q[/usr/bin/make],
|
||||
'makepl_arg' => q[INSTALLDIRS=site],
|
||||
'mbuild_arg' => q[],
|
||||
'mbuild_install_arg' => q[],
|
||||
'mbuild_install_build_command' => q[./Build],
|
||||
'mbuildpl_arg' => q[--installdirs site],
|
||||
'ncftp' => q[],
|
||||
'ncftpget' => q[],
|
||||
'no_proxy' => q[],
|
||||
'pager' => q[/usr/bin/less],
|
||||
'patch' => q[],
|
||||
'perl5lib_verbosity' => q[v],
|
||||
'prefer_installer' => q[MB],
|
||||
'prefs_dir' => q[/root/.cpan/prefs],
|
||||
'prerequisites_policy' => q[follow],
|
||||
'scan_cache' => q[atstart],
|
||||
'shell' => q[/bin/bash],
|
||||
'show_unparsable_versions' => q[0],
|
||||
'show_upload_date' => q[0],
|
||||
'show_zero_versions' => q[0],
|
||||
'tar' => q[/bin/tar],
|
||||
'tar_verbosity' => q[v],
|
||||
'term_is_latin' => q[1],
|
||||
'term_ornaments' => q[1],
|
||||
'test_report' => q[0],
|
||||
'trust_test_report_history' => q[0],
|
||||
'unzip' => q[/usr/bin/unzip],
|
||||
'urllist' => [],
|
||||
'use_sqlite' => q[0],
|
||||
'wget' => q[/usr/bin/wget],
|
||||
'yaml_load_code' => q[0],
|
||||
'yaml_module' => q[YAML],
|
||||
};
|
||||
1;
|
||||
__END__
|
13
README.md
13
README.md
@ -53,6 +53,7 @@ After you should be able to browse [localhost:8080/icinga2-web](http://localhost
|
||||
* MySQL server and client software
|
||||
* PostgreSQL server and client software
|
||||
* [Icinga prerequisites](http://docs.icinga.org/latest/en/quickstart-idoutils.html#installpackages)
|
||||
* OpenLDAP servers and clients
|
||||
|
||||
**Installed users and groups**:
|
||||
|
||||
@ -102,6 +103,18 @@ Connect to the **icinga mysql database** using the following command:
|
||||
Access the **Classic UI** (CGIs) via [localhost:8080/icinga-pgsql](http://localhost:8080/icinga-pgsql).
|
||||
For **logging into** the Icinga classic web interface use user *icingaadmin* with password *icinga*.
|
||||
|
||||
#### Monitoring Test Config
|
||||
|
||||
Test config is added to both the MySQL and PostgreSQL Icinga instance utilizing the Perl module
|
||||
**Monitoring::Generator::TestConfig** to generate test config to **/usr/local/share/misc/monitoring_test_config**
|
||||
which is then copied to **<instance>/etc/conf.d/test_config/**.
|
||||
Configuration can be adjusted and recreated with **/usr/local/share/misc/monitoring_test_config/recreate.pl**.
|
||||
**Note** that you have to run
|
||||
|
||||
vagrant provision
|
||||
|
||||
in the host after any modification to the script just mentioned.
|
||||
|
||||
#### MK Livestatus
|
||||
|
||||
MK Livestatus is added to the Icinga installation using a MySQL database.
|
||||
|
Loading…
x
Reference in New Issue
Block a user