diff --git a/.gitattributes b/.gitattributes index 35002d0cb..40b06093e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,4 +2,4 @@ .git* export-ignore # Normalize puppet manifests' line endings to LF on checkin and prevent conversion to CRLF when the files are checked out -.vagrant-puppet/* eol=lf +.puppet* eol=lf diff --git a/.gitignore b/.gitignore index 3cc377b8d..6c60b5fbb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ # Except those related to git and vagrant !.git* -!.vagrant-puppet/* +!.puppet* # Exclude application log files var/log/* diff --git a/.puppet/TODO.md b/.puppet/TODO.md new file mode 100644 index 000000000..04af9a108 --- /dev/null +++ b/.puppet/TODO.md @@ -0,0 +1,22 @@ +Fix steps that are always provisioned: + +==> default: Notice: /Stage[main]/Icinga2/Icinga2::Feature[statusdata]/Parent_dirs[/etc/icinga2/features-enabled/statusdata.conf]/Exec[parent_dirs-/etc/icinga2/features-enabled/statusdata.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_dev/Icinga2::Config[constants]/Parent_dirs[/etc/icinga2/constants.conf]/Exec[parent_dirs-/etc/icinga2/constants.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_dev/Icinga2::Config[conf.d/commands]/Parent_dirs[/etc/icinga2/conf.d/commands.conf]/Exec[parent_dirs-/etc/icinga2/conf.d/commands.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2/Icinga2::Feature[command]/Parent_dirs[/etc/icinga2/features-enabled/command.conf]/Exec[parent_dirs-/etc/icinga2/features-enabled/command.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icingaweb2_dev/Pgsql::Database::Populate[icingaweb]/Exec[populate-icingaweb-pgsql-db]/returns: executed successfully +==> default: Notice: /Stage[main]/Php/Exec[php-timezone]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_dev/Icinga2::Config[conf.d/test-config]/Parent_dirs[/etc/icinga2/conf.d/test-config.conf]/Exec[parent_dirs-/etc/icinga2/conf.d/test-config.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icingaweb2_dev/Exec[populate-openldap]/returns: executed successfully +==> default: Notice: /Stage[main]/Monitoring_test_config/Git_cmmi[Monitoring-Generator-TestConfig]/Cmmi_dir[Monitoring-Generator-TestConfig]/Exec[configure-Monitoring-Generator-TestConfig]/returns: executed successfully +==> default: Notice: /Stage[main]/Monitoring_test_config/Git_cmmi[Monitoring-Generator-TestConfig]/Cmmi_dir[Monitoring-Generator-TestConfig]/Exec[make-Monitoring-Generator-TestConfig]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2/Icinga2::Feature[compatlog]/Parent_dirs[/etc/icinga2/features-enabled/compatlog.conf]/Exec[parent_dirs-/etc/icinga2/features-enabled/compatlog.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_mysql/Icinga2::Feature[ido-mysql]/Parent_dirs[/etc/icinga2/features-enabled/ido-mysql.conf]/Exec[parent_dirs-/etc/icinga2/features-enabled/ido-mysql.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Apache/Service[httpd]: Triggered 'refresh' from 1 events +==> default: Notice: /Stage[main]/Icingaweb2_dev/Exec[enable-monitoring-module]/returns: executed successfully +==> default: Notice: /Stage[main]/Icingaweb2_dev/Exec[enable-test-module]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_mysql/Icinga2::Feature[ido-mysql]/Icinga2::Config[features-available/ido-mysql]/Parent_dirs[/etc/icinga2/features-available/ido-mysql.conf]/Exec[parent_dirs-/etc/icinga2/features-available/ido-mysql.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_pgsql/Icinga2::Feature[ido-pgsql]/Icinga2::Config[features-available/ido-pgsql]/Parent_dirs[/etc/icinga2/features-available/ido-pgsql.conf]/Exec[parent_dirs-/etc/icinga2/features-available/ido-pgsql.conf]/returns: executed successfully +==> default: Notice: /Stage[main]/Icinga2_pgsql/Icinga2::Feature[ido-pgsql]/Parent_dirs[/etc/icinga2/features-enabled/ido-pgsql.conf]/Exec[parent_dirs-/etc/icinga2/features-enabled/ido-pgsql.conf]/returns: executed successfully + +Fix provisioning for CentOS 7 diff --git a/.vagrant-puppet/files/etc/profile.d/env.sh b/.puppet/files/etc/profile.d/env.sh similarity index 100% rename from .vagrant-puppet/files/etc/profile.d/env.sh rename to .puppet/files/etc/profile.d/env.sh diff --git a/.puppet/hiera/common.yaml b/.puppet/hiera/common.yaml new file mode 100644 index 000000000..0a85ba63a --- /dev/null +++ b/.puppet/hiera/common.yaml @@ -0,0 +1,7 @@ +--- +icingaweb2::config: /etc/icingaweb +icingaweb2::log: /var/log/icingaweb/icingaweb.log +icingaweb2::web_path: icingaweb +icingaweb2::db_user: icingaweb +icingaweb2::db_pass: icingaweb +icingaweb2::db_name: icingaweb diff --git a/.puppet/hiera/hiera.yaml b/.puppet/hiera/hiera.yaml new file mode 100644 index 000000000..22012bbd7 --- /dev/null +++ b/.puppet/hiera/hiera.yaml @@ -0,0 +1,9 @@ +--- +:backends: + - yaml + +:hierarchy: + - common + +:yaml: + :datadir: /vagrant/.puppet/hiera diff --git a/.puppet/manifests/puppet.sh b/.puppet/manifests/puppet.sh new file mode 100644 index 000000000..225ce7398 --- /dev/null +++ b/.puppet/manifests/puppet.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -e + +if which puppet >/dev/null 2>&1; then + exit 0 +fi + +RELEASEVER=$(rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)) + +case $RELEASEVER in + 6|7) + PUPPET="http://yum.puppetlabs.com/puppetlabs-release-el-${RELEASEVER}.noarch.rpm" + ;; + *) + echo "Unknown release version: $RELEASEVER" >&2 + exit 1 + ;; +esac + +echo "Adding puppet repository.." +rpm --import "https://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs" +rpm -ivh $PUPPET >/dev/null + +echo "Installing puppet.." +yum install -y puppet >/dev/null diff --git a/.puppet/manifests/site.pp b/.puppet/manifests/site.pp new file mode 100644 index 000000000..77ebfa0a7 --- /dev/null +++ b/.puppet/manifests/site.pp @@ -0,0 +1,15 @@ +stage { 'repositories': + before => Stage['main'], +} + +node default { + class { 'epel': + stage => repositories, + } + include icinga2_dev + include icingaweb2_dev + include motd + file { '/etc/profile.d/env.sh': + source => 'puppet:////vagrant/.puppet/files/etc/profile.d/env.sh' + } +} diff --git a/.vagrant-puppet/modules/apache/manifests/init.pp b/.puppet/modules/apache/manifests/init.pp similarity index 56% rename from .vagrant-puppet/modules/apache/manifests/init.pp rename to .puppet/modules/apache/manifests/init.pp index e328ff95f..e96150f12 100644 --- a/.vagrant-puppet/modules/apache/manifests/init.pp +++ b/.puppet/modules/apache/manifests/init.pp @@ -13,20 +13,31 @@ # include apache # class apache { - $apache = $::operatingsystem ? { /(Debian|Ubuntu)/ => 'apache2', /(RedHat|CentOS|Fedora)/ => 'httpd' } + $user = $::operatingsystem ? { + /(Debian|Ubuntu)/ => 'www-data', + /(RedHat|CentOS|Fedora)/ => 'apache' + } + package { $apache: - ensure => installed, - alias => 'apache' + ensure => latest, + alias => 'apache', } service { $apache: ensure => running, + enable => true, alias => 'apache', - require => Package['apache'] + require => Package['apache'], } + + @user { $user: + alias => 'apache', + } + + User <| alias == apache |> } diff --git a/.puppet/modules/cmmi_dir/manifests/init.pp b/.puppet/modules/cmmi_dir/manifests/init.pp new file mode 100644 index 000000000..33d2f7eec --- /dev/null +++ b/.puppet/modules/cmmi_dir/manifests/init.pp @@ -0,0 +1,15 @@ +define cmmi_dir ( + $configure='./configure', + $make='make && make install' +) { + Exec { + path => '/usr/bin:/bin', + cwd => "/usr/local/src/${name}", + } + + exec { "configure-${name}": + command => $configure, + } -> exec { "make-${name}": + command => $make, + } +} diff --git a/.vagrant-puppet/modules/epel/manifests/init.pp b/.puppet/modules/epel/manifests/init.pp similarity index 94% rename from .vagrant-puppet/modules/epel/manifests/init.pp rename to .puppet/modules/epel/manifests/init.pp index 65e0a2603..9ec1ba692 100644 --- a/.vagrant-puppet/modules/epel/manifests/init.pp +++ b/.puppet/modules/epel/manifests/init.pp @@ -16,7 +16,7 @@ class epel { yumrepo { 'epel': mirrorlist => "http://mirrors.fedoraproject.org/mirrorlist?repo=epel-6&arch=${::architecture}", - enabled => '0', + enabled => '1', gpgcheck => '0', descr => "Extra Packages for Enterprise Linux 6 - ${::architecture}" } diff --git a/.puppet/modules/git/manifests/init.pp b/.puppet/modules/git/manifests/init.pp new file mode 100644 index 000000000..9143e9f69 --- /dev/null +++ b/.puppet/modules/git/manifests/init.pp @@ -0,0 +1,13 @@ +# Class: git +# +# This class installs git. +# +# Sample Usage: +# +# include git +# +class git { + package { 'git': + ensure => latest, + } +} diff --git a/.puppet/modules/git_cmmi/manifests/init.pp b/.puppet/modules/git_cmmi/manifests/init.pp new file mode 100644 index 000000000..2c5302486 --- /dev/null +++ b/.puppet/modules/git_cmmi/manifests/init.pp @@ -0,0 +1,20 @@ +define git_cmmi ( + $url, + $configure='./configure', + $make='make && make install' +) { + include git + + $srcDir = '/usr/local/src' + + exec { "git-clone-${name}": + cwd => $srcDir, + path => '/usr/bin:/bin', + unless => "test -d '${srcDir}/${name}/.git'", + command => "git clone '${url}' '${name}'", + require => Class['git'], + } -> cmmi_dir { $name: + configure => $configure, + make => $make, + } +} diff --git a/.vagrant-puppet/modules/icinga/templates/ido2db-mysql.cfg.erb b/.puppet/modules/icinga/templates/ido2db-mysql.cfg.erb similarity index 100% rename from .vagrant-puppet/modules/icinga/templates/ido2db-mysql.cfg.erb rename to .puppet/modules/icinga/templates/ido2db-mysql.cfg.erb diff --git a/.vagrant-puppet/modules/icinga/templates/ido2db-pgsql.cfg.erb b/.puppet/modules/icinga/templates/ido2db-pgsql.cfg.erb similarity index 100% rename from .vagrant-puppet/modules/icinga/templates/ido2db-pgsql.cfg.erb rename to .puppet/modules/icinga/templates/ido2db-pgsql.cfg.erb diff --git a/.puppet/modules/icinga2/manifests/config.pp b/.puppet/modules/icinga2/manifests/config.pp new file mode 100644 index 000000000..cbdba06c0 --- /dev/null +++ b/.puppet/modules/icinga2/manifests/config.pp @@ -0,0 +1,42 @@ +# Define: icinga2::config +# +# Provide Icinga 2 configuration file +# +# Parameters: +# +# [*source*] - where to take the file from +# +# Requires: +# +# icinga2 +# +# Sample Usage: +# +# icinga2::config { 'constants'; +# source => 'puppet:///modules/icinga2_dev', +# } +# +# Provide configuration file '/etc/icinga2/constants.conf' +# from 'puppet:///modules/icinga2_dev/constants.conf' +# ('/path/to/puppet/modules/icinga2_dev/files/constants.conf') +# +define icinga2::config ($source) { + include icinga2 + + $path = "/etc/icinga2/${name}.conf" + + parent_dirs { $path: + user => 'icinga', + require => [ + User['icinga'], + File['icinga2cfgDir'] + ], + } + -> file { $path: + source => "${source}/${name}.conf", + owner => 'icinga', + group => 'icinga', + notify => Service['icinga2'], + require => User['icinga'], + } +} diff --git a/.puppet/modules/icinga2/manifests/feature.pp b/.puppet/modules/icinga2/manifests/feature.pp new file mode 100644 index 000000000..cfba05a9f --- /dev/null +++ b/.puppet/modules/icinga2/manifests/feature.pp @@ -0,0 +1,38 @@ +# Define: icinga2::feature +# +# Enable Icinga 2 feature +# +# Requires: +# +# icinga2 +# +# Sample Usage: +# +# icinga2::feature { 'example-feature'; } +# +define icinga2::feature ($source = undef) { + include icinga2 + + $target = "features-available/${name}" + $cfgpath = '/etc/icinga2' + $path = "${cfgpath}/features-enabled/${name}.conf" + + if $source != undef { + icinga2::config { $target: + source => $source, + } + } + + parent_dirs { $path: + user => 'icinga', + require => [ + User['icinga'], + File['icinga2cfgDir'] + ], + } + -> file { $path: + ensure => link, + target => "${cfgpath}/${target}.conf", + notify => Service['icinga2'], + } +} diff --git a/.puppet/modules/icinga2/manifests/init.pp b/.puppet/modules/icinga2/manifests/init.pp new file mode 100644 index 000000000..0545ba7c5 --- /dev/null +++ b/.puppet/modules/icinga2/manifests/init.pp @@ -0,0 +1,42 @@ +# Class: icinga2 +# +# This class installs Icinga 2. +# +# Requires: +# +# icinga_packages +# icinga2::feature +# +# Sample Usage: +# +# include icinga2 +# +class icinga2 { + include icinga_packages + + package { [ + 'icinga2', 'icinga2-doc', 'icinga2-debuginfo' + ]: + ensure => latest, + require => Class['icinga_packages'], + } + -> service { 'icinga2': + ensure => running, + enable => true, + require => User['icinga'], + } + + user { 'icinga': + ensure => present, + } + -> file { 'icinga2cfgDir': + path => '/etc/icinga2', + ensure => directory, + links => follow, + owner => 'icinga', + group => 'icinga', + mode => 6750, + } + + icinga2::feature { [ 'statusdata', 'command', 'compatlog' ]: } +} diff --git a/.vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf b/.puppet/modules/icinga2_mysql/files/features-available/ido-mysql.conf similarity index 100% rename from .vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf rename to .puppet/modules/icinga2_mysql/files/features-available/ido-mysql.conf diff --git a/.puppet/modules/icinga2_mysql/manifests/init.pp b/.puppet/modules/icinga2_mysql/manifests/init.pp new file mode 100644 index 000000000..acef7a5c1 --- /dev/null +++ b/.puppet/modules/icinga2_mysql/manifests/init.pp @@ -0,0 +1,34 @@ +# Class: icinga2_mysql +# +# This class installs Icinga 2 and Icinga-2-IDO-MySQL and set up the database for the last one. +# +# Requires: +# +# icinga_packages +# icinga2 +# icinga2::feature +# icinga2::config +# mysql::database::populate +# +# Sample Usage: +# +# include icinga2_mysql +# +class icinga2_mysql { + include icinga2 + include icinga_packages + + package { 'icinga2-ido-mysql': + ensure => latest, + require => Class['icinga_packages'], + } + -> mysql::database::populate { 'icinga2': + username => 'icinga2', + password => 'icinga2', + privileges => 'SELECT,INSERT,UPDATE,DELETE', + schemafile => '/usr/share/icinga2-ido-mysql/schema/mysql.sql', + } + -> icinga2::feature { 'ido-mysql': + source => 'puppet:///modules/icinga2_mysql', + } +} diff --git a/.vagrant-puppet/files/etc/icinga2/features-available/ido-pgsql.conf b/.puppet/modules/icinga2_pgsql/files/features-available/ido-pgsql.conf similarity index 100% rename from .vagrant-puppet/files/etc/icinga2/features-available/ido-pgsql.conf rename to .puppet/modules/icinga2_pgsql/files/features-available/ido-pgsql.conf diff --git a/.puppet/modules/icinga2_pgsql/manifests/init.pp b/.puppet/modules/icinga2_pgsql/manifests/init.pp new file mode 100644 index 000000000..2326449af --- /dev/null +++ b/.puppet/modules/icinga2_pgsql/manifests/init.pp @@ -0,0 +1,17 @@ +class icinga2_pgsql { + include icinga2 + include icinga_packages + + package { 'icinga2-ido-pgsql': + ensure => latest, + require => Class['icinga_packages'], + } + -> pgsql::database::populate { 'icinga2': + username => 'icinga2', + password => 'icinga2', + schemafile => '/usr/share/icinga2-ido-pgsql/schema/pgsql.sql', + } + -> icinga2::feature { 'ido-pgsql': + source => 'puppet:///modules/icinga2_pgsql', + } +} diff --git a/.puppet/modules/icinga_packages/manifests/init.pp b/.puppet/modules/icinga_packages/manifests/init.pp new file mode 100644 index 000000000..7e3e8d188 --- /dev/null +++ b/.puppet/modules/icinga_packages/manifests/init.pp @@ -0,0 +1,17 @@ +# Class: icinga_packages +# +# This class adds the YUM repository for the Icinga packages. +# +# Sample Usage: +# +# include icinga_packages +# +class icinga_packages { + yumrepo { 'icinga_packages': + baseurl => 'http://packages.icinga.org/epel/6/snapshot/', + enabled => '1', + gpgcheck => '1', + gpgkey => 'http://packages.icinga.org/icinga.key', + descr => "Icinga Repository - ${::architecture}" + } +} diff --git a/.puppet/modules/icingacli/manifests/init.pp b/.puppet/modules/icingacli/manifests/init.pp new file mode 100644 index 000000000..7eef7833a --- /dev/null +++ b/.puppet/modules/icingacli/manifests/init.pp @@ -0,0 +1,11 @@ +class icingacli { + file { '/usr/local/bin/icingacli': + ensure => link, + target => '/vagrant/bin/icingacli', + } + + file { '/etc/bash_completion.d/icingacli': + ensure => link, + target => '/vagrant/etc/bash_completion.d/icingacli', + } +} diff --git a/.puppet/modules/icingaweb2/manifests/config.pp b/.puppet/modules/icingaweb2/manifests/config.pp new file mode 100644 index 000000000..473d89d06 --- /dev/null +++ b/.puppet/modules/icingaweb2/manifests/config.pp @@ -0,0 +1,14 @@ +class icingaweb2::config ( + $config = hiera('icingaweb2::config') +) { + group { 'icingaweb': + ensure => present, + } + + file { [ "${config}", "${config}/enabledModules", "${config}/modules", "${config}/preferences" ]: + ensure => directory, + owner => 'root', + group => 'icingaweb', + mode => '2770', + } +} diff --git a/.puppet/modules/icingaweb2/manifests/config/general.pp b/.puppet/modules/icingaweb2/manifests/config/general.pp new file mode 100644 index 000000000..c2daec83f --- /dev/null +++ b/.puppet/modules/icingaweb2/manifests/config/general.pp @@ -0,0 +1,15 @@ +define icingaweb2::config::general ( + $source, + $config = hiera('icingaweb2::config'), + $replace = true +) { + include icingaweb2::config + + file { "${config}/${name}.ini": + content => template("${source}/${name}.ini.erb"), + owner => 'root', + group => 'icingaweb', + mode => 0660, + replace => $replace, + } +} diff --git a/.puppet/modules/icingaweb2/manifests/config/module.pp b/.puppet/modules/icingaweb2/manifests/config/module.pp new file mode 100644 index 000000000..69e5abd6b --- /dev/null +++ b/.puppet/modules/icingaweb2/manifests/config/module.pp @@ -0,0 +1,25 @@ +define icingaweb2::config::module ( + $module, + $source, + $config = hiera('icingaweb2::config'), + $replace = true +) { + include icingaweb2::config + + if ! defined(File["${config}/modules/${module}"]) { + file { "${config}/modules/${module}": + ensure => directory, + owner => 'root', + group => 'icingaweb', + mode => '2770', + } + } + + file { "${config}/modules/${module}/${name}.ini": + source => "${source}/modules/${module}/${name}.ini", + owner => 'root', + group => 'icingaweb', + mode => 0660, + replace => $replace, + } +} diff --git a/.vagrant-puppet/modules/monitoring-plugins/manifests/init.pp b/.puppet/modules/monitoring_plugins/manifests/init.pp similarity index 67% rename from .vagrant-puppet/modules/monitoring-plugins/manifests/init.pp rename to .puppet/modules/monitoring_plugins/manifests/init.pp index 6dc7be09d..64d080d11 100644 --- a/.vagrant-puppet/modules/monitoring-plugins/manifests/init.pp +++ b/.puppet/modules/monitoring_plugins/manifests/init.pp @@ -1,9 +1,9 @@ -class monitoring-plugins { +class monitoring_plugins { include epel # nagios plugins from epel package { 'nagios-plugins-all': - ensure => installed, + ensure => latest, require => Class['epel'] } -} \ No newline at end of file +} diff --git a/.puppet/modules/monitoring_test_config/manifests/init.pp b/.puppet/modules/monitoring_test_config/manifests/init.pp new file mode 100644 index 000000000..65ac53ec7 --- /dev/null +++ b/.puppet/modules/monitoring_test_config/manifests/init.pp @@ -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' + ]: } +} diff --git a/.puppet/modules/monitoring_test_config/manifests/populate_plugins.pp b/.puppet/modules/monitoring_test_config/manifests/populate_plugins.pp new file mode 100644 index 000000000..347e4b127 --- /dev/null +++ b/.puppet/modules/monitoring_test_config/manifests/populate_plugins.pp @@ -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'], + } +} diff --git a/.puppet/modules/motd/files/motd b/.puppet/modules/motd/files/motd new file mode 100644 index 000000000..3e32ee517 --- /dev/null +++ b/.puppet/modules/motd/files/motd @@ -0,0 +1,19 @@ +88 88 +88 "" +88 +88 ,adPPYba, 88 8b,dPPYba, ,adPPYb,d8 ,adPPYYba, +88 a8" "" 88 88P' `"8a a8" `Y88 "" `Y8 +88 8b 88 88 88 8b 88 ,adPPPPP88 +88 "8a, ,aa 88 88 88 "8a, ,d88 88, ,88 +88 `"Ybbd8"' 88 88 88 `"YbbdP"Y8 `"8bbdP"Y8 + aa, ,88 + "Y8bbdP" + +I8, 8 ,8I 88 ad888888b, +`8b d8b d8' 88 d8" "88 + "8, ,8"8, ,8" 88 a8P + Y8 8P Y8 8P ,adPPYba, 88,dPPYba, ,d8P" + `8b d8' `8b d8' a8P_____88 88P' "8a a8P" + `8a a8' `8a a8' 8PP""""""" 88 d8 a8P' + `8a8' `8a8' "8b, ,aa 88b, ,a8" d8" + `8' `8' `"Ybbd8"' 8Y"Ybbd8"' 88888888888 diff --git a/.puppet/modules/motd/manifests/init.pp b/.puppet/modules/motd/manifests/init.pp new file mode 100644 index 000000000..acb744daf --- /dev/null +++ b/.puppet/modules/motd/manifests/init.pp @@ -0,0 +1,7 @@ +class motd { + file { '/etc/motd': + source => 'puppet:///modules/motd/motd', + owner => root, + group => root, + } +} diff --git a/.puppet/modules/mysql/manifests/database/create.pp b/.puppet/modules/mysql/manifests/database/create.pp new file mode 100644 index 000000000..fff93c6e6 --- /dev/null +++ b/.puppet/modules/mysql/manifests/database/create.pp @@ -0,0 +1,33 @@ +# Define: mysql::database::create +# +# Create a MySQL database +# +# Parameters: +# +# [*username*] - name of the user the database belongs to +# [*password*] - password of the user the database belongs to +# [*privileges*] - privileges of the user the database belongs to +# +# Requires: +# +# mysql +# +# Sample Usage: +# +# mysql::database::create { 'icinga2': +# username => 'icinga2', +# password => 'icinga2', +# privileges => 'SELECT,INSERT,UPDATE,DELETE', +# } +# +define mysql::database::create ($username, $password, $privileges) { + include mysql + + exec { "create-mysql-${name}-db": + unless => "mysql -u${username} -p${password} ${name}", + command => "mysql -uroot -e \"CREATE DATABASE ${name}; \ +GRANT ${privileges} ON ${name}.* TO ${username}@localhost \ +IDENTIFIED BY '${password}';\"", + require => Class['mysql'] + } +} diff --git a/.puppet/modules/mysql/manifests/database/populate.pp b/.puppet/modules/mysql/manifests/database/populate.pp new file mode 100644 index 000000000..dc54a0800 --- /dev/null +++ b/.puppet/modules/mysql/manifests/database/populate.pp @@ -0,0 +1,39 @@ +# Define: mysql::database::populate +# +# Create and populate a MySQL database +# +# Parameters: +# +# [*username*] - name of the user the database belongs to +# [*password*] - password of the user the database belongs to +# [*privileges*] - privileges of the user the database belongs to +# [*schemafile*] - file with the schema for the database +# +# Requires: +# +# mysql::database::create +# +# Sample Usage: +# +# mysql::database::populate { 'icinga2': +# username => 'icinga2', +# password => 'icinga2', +# privileges => 'SELECT,INSERT,UPDATE,DELETE', +# schemafile => '/usr/share/icinga2-ido-mysql/schema/mysql.sql', +# } +# +define mysql::database::populate ($username, $password, $privileges, $schemafile) { + Exec { path => '/bin:/usr/bin' } + + mysql::database::create { $name: + username => $username, + password => $password, + privileges => $privileges, + } + + exec { "populate-${name}-mysql-db": + onlyif => "mysql -u${username} -p${password} ${name} -e \"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '${name}';\" 2>/dev/null |grep -qEe '^ *0 *$'", + command => "mysql -uroot ${name} < ${schemafile}", + require => Mysql::Database::Create[$name], + } +} diff --git a/.vagrant-puppet/modules/mysql/manifests/init.pp b/.puppet/modules/mysql/manifests/init.pp similarity index 82% rename from .vagrant-puppet/modules/mysql/manifests/init.pp rename to .puppet/modules/mysql/manifests/init.pp index f0cab3fdb..a235a540c 100644 --- a/.vagrant-puppet/modules/mysql/manifests/init.pp +++ b/.puppet/modules/mysql/manifests/init.pp @@ -16,15 +16,15 @@ class mysql { Exec { path => '/usr/bin' } - package { - 'mysql': - ensure => installed; - 'mysql-server': - ensure => installed; + package { [ + 'mysql', 'mysql-server' + ]: + ensure => latest, } service { 'mysqld': ensure => running, + enable => true, require => Package['mysql-server'] } diff --git a/.vagrant-puppet/modules/mysql/templates/my.cnf.erb b/.puppet/modules/mysql/templates/my.cnf.erb similarity index 100% rename from .vagrant-puppet/modules/mysql/templates/my.cnf.erb rename to .puppet/modules/mysql/templates/my.cnf.erb diff --git a/.vagrant-puppet/modules/openldap/manifests/init.pp b/.puppet/modules/openldap/manifests/init.pp similarity index 78% rename from .vagrant-puppet/modules/openldap/manifests/init.pp rename to .puppet/modules/openldap/manifests/init.pp index e9f3c504b..069c4a157 100644 --- a/.vagrant-puppet/modules/openldap/manifests/init.pp +++ b/.puppet/modules/openldap/manifests/init.pp @@ -14,8 +14,8 @@ # class openldap { - package { ['openldap-servers', 'openldap-clients']: - ensure => installed + package { ['openldap-servers', 'openldap-clients']: + ensure => latest, } service { 'slapd': diff --git a/.puppet/modules/parent_dirs/manifests/init.pp b/.puppet/modules/parent_dirs/manifests/init.pp new file mode 100644 index 000000000..e5e4e38d7 --- /dev/null +++ b/.puppet/modules/parent_dirs/manifests/init.pp @@ -0,0 +1,8 @@ +# TODO(el): Remove this. It's always executed and hackish +define parent_dirs ($user = 'root') { + exec { "parent_dirs-${name}": + command => "mkdir -p \"\$(dirname \"\$(readlink -m '${name}')\")\"", + path => '/bin:/usr/bin', + user => $user, + } +} diff --git a/.puppet/modules/pgsql/manifests/database/create.pp b/.puppet/modules/pgsql/manifests/database/create.pp new file mode 100644 index 000000000..97fcb163d --- /dev/null +++ b/.puppet/modules/pgsql/manifests/database/create.pp @@ -0,0 +1,32 @@ +# Define: pgsql::database::create +# +# Create a PgSQL database +# +# Parameters: +# +# [*username*] - name of the user the database belongs to +# [*password*] - password of the user the database belongs to +# +# Requires: +# +# pgsql +# +# Sample Usage: +# +# pgsql::database::create { 'icinga2': +# username => 'icinga2', +# password => 'icinga2', +# } +# +define pgsql::database::create ($username, $password) { + include pgsql + + exec { "create-pgsql-${name}-db": + unless => "psql -tAc \"SELECT 1 FROM pg_roles WHERE rolname='${username}'\" | grep -q 1", + command => "psql -c \"CREATE ROLE ${username} WITH LOGIN PASSWORD '${password}';\" && \ +createdb -O ${username} -E UTF8 -T template0 ${name} && \ +createlang plpgsql ${name}", + user => 'postgres', + require => Class['pgsql'] + } +} diff --git a/.puppet/modules/pgsql/manifests/database/populate.pp b/.puppet/modules/pgsql/manifests/database/populate.pp new file mode 100644 index 000000000..8663ff3f1 --- /dev/null +++ b/.puppet/modules/pgsql/manifests/database/populate.pp @@ -0,0 +1,37 @@ +# Define: pgsql::database::populate +# +# Create and populate a PgSQL database +# +# Parameters: +# +# [*username*] - name of the user the database belongs to +# [*password*] - password of the user the database belongs to +# [*schemafile*] - file with the schema for the database +# +# Requires: +# +# pgsql::database::create +# +# Sample Usage: +# +# pgsql::database::populate { 'icinga2': +# username => 'icinga2', +# password => 'icinga2', +# schemafile => '/usr/share/icinga2-ido-pgsql/schema/pgsql.sql', +# } +# +define pgsql::database::populate ($username, $password, $schemafile) { + Exec { path => '/bin:/usr/bin' } + + pgsql::database::create { $name: + username => $username, + password => $password, + } + + exec { "populate-${name}-pgsql-db": + onlyif => "psql -U ${username} -d ${name} -c \"SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = '${name}';\" 2>/dev/null |grep -qEe '^ *0 *$'", + command => "psql -U ${username} -d ${name} < ${schemafile}", + user => 'postgres', + require => Pgsql::Database::Create[$name], + } +} diff --git a/.vagrant-puppet/modules/pgsql/manifests/init.pp b/.puppet/modules/pgsql/manifests/init.pp similarity index 87% rename from .vagrant-puppet/modules/pgsql/manifests/init.pp rename to .puppet/modules/pgsql/manifests/init.pp index 36e12bb11..4b48cf895 100644 --- a/.vagrant-puppet/modules/pgsql/manifests/init.pp +++ b/.puppet/modules/pgsql/manifests/init.pp @@ -17,11 +17,10 @@ class pgsql { Exec { path => '/sbin:/bin:/usr/bin' } - package { - 'postgresql': - ensure => installed; - 'postgresql-server': - ensure => installed; + package { [ + 'postgresql', 'postgresql-server' + ]: + ensure => latest, } exec { 'initdb': diff --git a/.vagrant-puppet/modules/pgsql/templates/pg_hba.conf.erb b/.puppet/modules/pgsql/templates/pg_hba.conf.erb similarity index 100% rename from .vagrant-puppet/modules/pgsql/templates/pg_hba.conf.erb rename to .puppet/modules/pgsql/templates/pg_hba.conf.erb diff --git a/.vagrant-puppet/modules/php/manifests/extension.pp b/.puppet/modules/php/manifests/extension.pp similarity index 100% rename from .vagrant-puppet/modules/php/manifests/extension.pp rename to .puppet/modules/php/manifests/extension.pp diff --git a/.vagrant-puppet/modules/php/manifests/init.pp b/.puppet/modules/php/manifests/init.pp similarity index 72% rename from .vagrant-puppet/modules/php/manifests/init.pp rename to .puppet/modules/php/manifests/init.pp index 1a8e31746..dd6df83b3 100644 --- a/.vagrant-puppet/modules/php/manifests/init.pp +++ b/.puppet/modules/php/manifests/init.pp @@ -19,10 +19,15 @@ class php { include apache package { 'php': - ensure => installed, + ensure => latest, require => Package['apache'], notify => Service['apache'] } + # TODO(el): Always executed. Should be a resource + -> exec { 'php-timezone': + command => 'sed -re $\'s#^;?(date\\.timezone =).*$#\\1 "UTC"#\' -i /etc/php.ini', + notify => Service['apache'], + } file { '/etc/php.d/error_reporting.ini': content => template('php/error_reporting.ini.erb'), diff --git a/.vagrant-puppet/modules/php/templates/error_reporting.ini.erb b/.puppet/modules/php/templates/error_reporting.ini.erb similarity index 100% rename from .vagrant-puppet/modules/php/templates/error_reporting.ini.erb rename to .puppet/modules/php/templates/error_reporting.ini.erb diff --git a/.vagrant-puppet/modules/php/templates/xdebug_settings.ini.erb b/.puppet/modules/php/templates/xdebug_settings.ini.erb similarity index 100% rename from .vagrant-puppet/modules/php/templates/xdebug_settings.ini.erb rename to .puppet/modules/php/templates/xdebug_settings.ini.erb diff --git a/.puppet/modules/zend_framework/manifests/init.pp b/.puppet/modules/zend_framework/manifests/init.pp new file mode 100644 index 000000000..1e54259b1 --- /dev/null +++ b/.puppet/modules/zend_framework/manifests/init.pp @@ -0,0 +1,24 @@ +# Class: zend_framework +# +# This class installs the Zend Framework. +# +# Requires: +# +# epel +# +# Sample Usage: +# +# include zend_framework +# +class zend_framework { + include epel + + package { [ + 'php-ZendFramework', + 'php-ZendFramework-Db-Adapter-Pdo-Mysql', + 'php-ZendFramework-Db-Adapter-Pdo-Pgsql' + ]: + ensure => latest, + require => Class['epel'], + } +} diff --git a/.vagrant-puppet/files/etc/icinga2/conf.d/commands.conf b/.puppet/profiles/icinga2_dev/files/conf.d/commands.conf similarity index 100% rename from .vagrant-puppet/files/etc/icinga2/conf.d/commands.conf rename to .puppet/profiles/icinga2_dev/files/conf.d/commands.conf diff --git a/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf b/.puppet/profiles/icinga2_dev/files/conf.d/test-config.conf similarity index 89% rename from .vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf rename to .puppet/profiles/icinga2_dev/files/conf.d/test-config.conf index 2dde681bf..4e3260b85 100644 --- a/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf +++ b/.puppet/profiles/icinga2_dev/files/conf.d/test-config.conf @@ -45,19 +45,19 @@ object HostGroup "all-hosts" { assign where true } -local host_types = ["ok", "random", "down", "up", "unreachable", "pending"] +var host_types = ["ok", "random", "down", "up", "unreachable", "pending"] -__for (host_type in host_types) { +for (host_type in host_types) { object HostGroup "all-" + host_type use (host_type) { display_name = "All " + host_type + " hosts" assign where host.vars.check_type == host_type } } -local service_types = ["ok", "warning", "critical", "unknown", "flapping", "pending"] +var service_types = ["ok", "warning", "critical", "unknown", "flapping", "pending"] // Servicegroups -__for (service_type in service_types) { +for (service_type in service_types) { object ServiceGroup "service-" + service_type use (service_type) { display_name = "All " + service_type + " services" assign where service.vars.check_type == service_type @@ -68,7 +68,7 @@ __for (service_type in service_types) { // Services // --------------------------------------------------------------------------------------------------------------------- -__function createService(service_type, num) { +function createService(service_type, num) { apply Service "service-" + service_type + "-" + string(num + 1) use (service_type) { import "generic-service" @@ -80,8 +80,8 @@ __function createService(service_type, num) { } } -__for (num in range(4)) { - __for (service_type in service_types) { +for (num in range(4)) { + for (service_type in service_types) { createService(service_type, num) } } @@ -90,7 +90,7 @@ __for (num in range(4)) { // Hosts // --------------------------------------------------------------------------------------------------------------------- -__function createHost(checkType, checkConfig, num, checkEnabled) { +function createHost(checkType, checkConfig, num, checkEnabled) { object Host "test-" + checkType + "-" + string(num + 1) use (checkEnabled, checkType, checkConfig) { import "generic-host" address = "127.0.0.1" @@ -101,7 +101,7 @@ __function createHost(checkType, checkConfig, num, checkEnabled) { } } -__for (num in range(10)) { +for (num in range(10)) { createHost("ok", [ "ok" ], num, true) createHost("random", [ "random", "flapping" ], num, true) createHost("down", [ "warning", "critical" ], num, true) diff --git a/.vagrant-puppet/files/etc/icinga2/constants.conf b/.puppet/profiles/icinga2_dev/files/constants.conf similarity index 100% rename from .vagrant-puppet/files/etc/icinga2/constants.conf rename to .puppet/profiles/icinga2_dev/files/constants.conf diff --git a/.puppet/profiles/icinga2_dev/manifests/init.pp b/.puppet/profiles/icinga2_dev/manifests/init.pp new file mode 100644 index 000000000..484042b64 --- /dev/null +++ b/.puppet/profiles/icinga2_dev/manifests/init.pp @@ -0,0 +1,24 @@ +# Class: icinga2_dev +# +# This class installs Icinga 2 w/ MySQL and provides Icinga 2 test configuration. +# +# Requires: +# +# icinga2_mysql +# icinga2::config +# +# Sample Usage: +# +# include icinga2_dev +# +class icinga2_dev { + include icinga2_mysql + include icinga2_pgsql + include monitoring_plugins + include monitoring_test_config + + icinga2::config { [ + 'conf.d/test-config', 'conf.d/commands', 'constants' ]: + source => 'puppet:///modules/icinga2_dev', + } +} diff --git a/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/backends.ini b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/backends.ini new file mode 100644 index 000000000..55f8e3115 --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/backends.ini @@ -0,0 +1,12 @@ +[ido-mysql] +type = ido +resource = ido-mysql + +[ido-pgsql] +type = ido +resource = ido-pgsql + +[livestatus] +disabled = 1 +type = livestatus +resource = livestatus diff --git a/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/config.ini b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/config.ini new file mode 100644 index 000000000..9b69fe86f --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/config.ini @@ -0,0 +1,2 @@ +[security] +protected_customvars = "*pw*,*pass*,community" diff --git a/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/instances.ini b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/instances.ini new file mode 100644 index 000000000..a47b06629 --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/files/modules/monitoring/instances.ini @@ -0,0 +1,2 @@ +[icinga] +path = "/var/run/icinga2/cmd/icinga2.cmd" diff --git a/.vagrant-puppet/modules/openldap/files/db.ldif b/.puppet/profiles/icingaweb2_dev/files/openldap/db.ldif similarity index 100% rename from .vagrant-puppet/modules/openldap/files/db.ldif rename to .puppet/profiles/icingaweb2_dev/files/openldap/db.ldif diff --git a/.vagrant-puppet/modules/openldap/files/dit.ldif b/.puppet/profiles/icingaweb2_dev/files/openldap/dit.ldif similarity index 100% rename from .vagrant-puppet/modules/openldap/files/dit.ldif rename to .puppet/profiles/icingaweb2_dev/files/openldap/dit.ldif diff --git a/.vagrant-puppet/modules/openldap/files/users.ldif b/.puppet/profiles/icingaweb2_dev/files/openldap/users.ldif similarity index 100% rename from .vagrant-puppet/modules/openldap/files/users.ldif rename to .puppet/profiles/icingaweb2_dev/files/openldap/users.ldif diff --git a/.puppet/profiles/icingaweb2_dev/manifests/init.pp b/.puppet/profiles/icingaweb2_dev/manifests/init.pp new file mode 100644 index 000000000..379f75247 --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/manifests/init.pp @@ -0,0 +1,140 @@ +class icingaweb2_dev ( + $config = hiera('icingaweb2::config'), + $log = hiera('icingaweb2::log'), + $web_path = hiera('icingaweb2::web_path'), + $db_user = hiera('icingaweb2::db_user'), + $db_pass = hiera('icingaweb2::db_pass'), + $db_name = hiera('icingaweb2::db_name'), +) { + include apache + include php + include icingaweb2::config + include icingacli + include icinga_packages + include openldap + + # TODO(el): Only include zend_framework. Apache does not have to be notified + class { 'zend_framework': + notify => Service['apache'], + } + + # TODO(el): icinga-gui is not a icingaweb2_dev package + package { [ 'php-pdo', 'php-ldap', 'php-phpunit-PHPUnit', 'icinga-gui' ]: + ensure => latest, + notify => Service['apache'], + require => Class['icinga_packages'], + } + + Exec { path => '/usr/local/bin:/usr/bin:/bin' } + + # TODO(el): Enabling/disabling modules should be a resource + User <| alias == apache |> { groups +> 'icingaweb' } + -> exec { 'enable-monitoring-module': + command => 'icingacli module enable monitoring', + user => 'apache', + require => Class[[ 'icingacli', 'apache' ]], + } + -> exec { 'enable-test-module': + command => 'icingacli module enable test', + user => 'apache' + } + + # TODO(el): 'icingacmd' is NOT a icingaweb2_dev group + group { 'icingacmd': + ensure => present, + } + + User <| alias == apache |> { groups +> 'icingacmd' } + + $log_dir = inline_template('<%= File.dirname(@log) %>') + file { $log_dir: + ensure => directory, + owner => 'root', + group => 'icingaweb', + mode => '2775' + } + + $icingaadminSelect = "as CNT from icingaweb_user where name = \'icingaadmin\'\" |grep -qwe \'cnt=0\'" + $icingaadminInsert = "\"INSERT INTO icingaweb_user (name, active, password_hash) VALUES (\'icingaadmin\', 1, \'\\\$1\\\$JMdnEc9M\\\$FW7yapAjv0atS43NkapGo/\');\"" + + mysql::database::populate { "${db_name}": + username => "${db_user}", + password => "${db_pass}", + privileges => 'ALL', + schemafile => '/vagrant/etc/schema/mysql.schema.sql', + } + -> exec { 'mysql-icingaadmin': + onlyif => "mysql -u${db_user} -p${db_pass} ${db_name} -e \"select CONCAT(\'cnt=\', COUNT(name)) ${icingaadminSelect}", + command => "mysql -u${db_user} -p${db_pass} ${db_name} -e ${icingaadminInsert}", + } + + pgsql::database::populate { "${db_name}": + username => "${db_user}", + password => "${db_pass}", + schemafile => '/vagrant/etc/schema/pgsql.schema.sql', + } + -> exec { 'pgsql-icingaadmin': + onlyif => "psql -U ${db_user} -w -d ${db_name} -c \"select 'cnt=' || COUNT(name) ${icingaadminSelect}", + command => "psql -U ${db_user} -w -d ${db_name} -c ${icingaadminInsert}", + environment => "PGPASSWORD=${db_pass}", + } + + file { '/etc/httpd/conf.d/icingaweb.conf': + content => template("$name/icingaweb.conf.erb"), + notify => Service['apache'], + } + + icingaweb2::config::general { 'authentication': + source => $name, + } + + icingaweb2::config::general { [ 'config', 'resources' ]: + source => $name, + replace => false, + } + + icingaweb2::config::module { [ 'backends', 'config', 'instances' ]: + module => 'monitoring', + source => 'puppet:///modules/icingaweb2_dev', + } + + # TODO(el): Should be a resource + package { 'iptables': + ensure => latest + } + -> exec { 'iptables-allow-http': + unless => 'grep -qe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables', + command => '/sbin/iptables -I INPUT 1 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && /sbin/iptables-save > /etc/sysconfig/iptables' + } + + # TODO(el): Don't define inside a class + define openldap_file { + file { "openldap/${name}.ldif": + path => "/usr/share/openldap-servers/${name}.ldif", + source => "puppet:///modules/icingaweb2_dev/openldap/${name}.ldif", + require => Class['openldap'], + } + } + + openldap_file { [ 'db', 'dit', 'users' ]: } + + exec { 'populate-openldap': + # TODO(el): Split the command and use unless instead of trying to populate openldap everytime + command => 'sudo ldapadd -c -Y EXTERNAL -H ldapi:/// -f /usr/share/openldap-servers/db.ldif || true && \ + sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/dit.ldif || true && \ + sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/users.ldif || true', + require => [ + Service['slapd'], + File[[ + 'openldap/db.ldif', + 'openldap/dit.ldif', + 'openldap/users.ldif' + ]] + ], + } + + # TODO(el): Should be a module + package { 'php-deepend-Mockery': + ensure => latest, + } +} diff --git a/.puppet/profiles/icingaweb2_dev/templates/authentication.ini.erb b/.puppet/profiles/icingaweb2_dev/templates/authentication.ini.erb new file mode 100644 index 000000000..f28395e18 --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/templates/authentication.ini.erb @@ -0,0 +1,16 @@ +[autologin] +backend = autologin + +[icingaweb-mysql] +backend = db +resource = icingaweb-mysql + +[icingaweb-pgsql] +backend = db +resource = icingaweb-pgsql + +[local-ldap] +backend = ldap +resource = local-ldap +user_class = inetOrgPerson +user_name_attribute = uid diff --git a/.puppet/profiles/icingaweb2_dev/templates/config.ini.erb b/.puppet/profiles/icingaweb2_dev/templates/config.ini.erb new file mode 100644 index 000000000..13ef6710f --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/templates/config.ini.erb @@ -0,0 +1,7 @@ +[logging] +log = "file" +file = "<%= @log %>" +level = DEBUG + +[preferences] +type = "ini" diff --git a/.vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf b/.puppet/profiles/icingaweb2_dev/templates/icingaweb.conf.erb similarity index 77% rename from .vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf rename to .puppet/profiles/icingaweb2_dev/templates/icingaweb.conf.erb index 0b45bea1f..d19dbe9ee 100644 --- a/.vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf +++ b/.puppet/profiles/icingaweb2_dev/templates/icingaweb.conf.erb @@ -1,4 +1,4 @@ -Alias /icingaweb /vagrant/public +Alias /<%= @web_path %> /vagrant/public Options FollowSymLinks @@ -6,12 +6,12 @@ Alias /icingaweb /vagrant/public Order allow,deny Allow from all - # SetEnv ICINGAWEB_CONFIGDIR /etc/icingaweb + # SetEnv ICINGAWEB_CONFIGDIR <%= @config %> EnableSendfile Off RewriteEngine on - RewriteBase /icingaweb/ + RewriteBase /<%= @web_path %>/ RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d diff --git a/.puppet/profiles/icingaweb2_dev/templates/resources.ini.erb b/.puppet/profiles/icingaweb2_dev/templates/resources.ini.erb new file mode 100644 index 000000000..8066a47a5 --- /dev/null +++ b/.puppet/profiles/icingaweb2_dev/templates/resources.ini.erb @@ -0,0 +1,43 @@ +[icingaweb-mysql] +type = db +db = mysql +host = localhost +port = 3306 +username = <%= @db_user %> +password = <%= @db_pass %> +dbname = <%= @db_name %> + +[icingaweb-pgsql] +type = db +db = pgsql +host = localhost +port = 5432 +username = <%= @db_user %> +password = <%= @db_pass %> +dbname = <%= @db_name %> + +[ido-mysql] +type = db +db = mysql +host = localhost +port = 3306 +password = icinga2 +username = icinga2 +dbname = icinga2 + +[ido-pgsql] +type = db +db = pgsql +host = localhost +port = 5432 +password = icinga2 +username = icinga2 +dbname = icinga2 + +[local-ldap] +type = ldap +hostname = localhost +port = 389 +root_dn = "ou=people,dc=icinga,dc=org" +bind_dn = "cn=admin,cn=config" +bind_pw = admin diff --git a/.vagrant-puppet/files/etc/icingaweb/authentication.ini b/.vagrant-puppet/files/etc/icingaweb/authentication.ini deleted file mode 100644 index 3da806df1..000000000 --- a/.vagrant-puppet/files/etc/icingaweb/authentication.ini +++ /dev/null @@ -1,15 +0,0 @@ -[autologin] -backend = autologin -; -; If you want to strip the domain -; strip_username_regexp = /\@[^$]+$/ - -[internal_ldap_authentication] -backend = ldap -resource = internal_ldap -user_class = inetOrgPerson -user_name_attribute = uid - -[internal_db_authentication] -backend = db -resource = internal_db diff --git a/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini b/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini deleted file mode 100644 index 6805f2e8b..000000000 --- a/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini +++ /dev/null @@ -1,19 +0,0 @@ -[localdb] - -type = ido -resource = "ido" - -[locallive] -disabled = "1" -type = livestatus -resource = livestatus - -[localfile] -disabled = "1" -type = statusdat -resource = statusdat - -;[localfailsafe] -;enabled=false -;type = combo -;backends = localdb, locallive, localfile diff --git a/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/instances.ini b/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/instances.ini deleted file mode 100644 index 037baa8b9..000000000 --- a/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/instances.ini +++ /dev/null @@ -1,2 +0,0 @@ -[icinga] -path = "/var/run/icinga2/cmd/icinga2.cmd" diff --git a/.vagrant-puppet/files/etc/icingaweb/resources.ini b/.vagrant-puppet/files/etc/icingaweb/resources.ini deleted file mode 100644 index 3935906eb..000000000 --- a/.vagrant-puppet/files/etc/icingaweb/resources.ini +++ /dev/null @@ -1,34 +0,0 @@ -[internal_db] -type = db -db = mysql -host = localhost -port = 3306 -password = icingaweb -username = icingaweb -dbname = icingaweb - -[ido] -type = db -db = mysql -host = localhost -port = 3306 -password = icinga2 -username = icinga2 -dbname = icinga2 - -[statusdat] -type = statusdat -status_file = /usr/local/icinga-mysql/var/status.dat -object_file = /usr/local/icinga-mysql/var/objects.cache - -[livestatus] -type = livestatus -socket = /usr/local/icinga-mysql/var/rw/live - -[internal_ldap] -type = ldap -hostname = localhost -port = 389 -root_dn = "ou=people, dc=icinga, dc=org" -bind_dn = "cn=admin,cn=config" -bind_pw = admin diff --git a/.vagrant-puppet/files/etc/init.d/icinga_command_proxy b/.vagrant-puppet/files/etc/init.d/icinga_command_proxy deleted file mode 100644 index 77059981f..000000000 --- a/.vagrant-puppet/files/etc/init.d/icinga_command_proxy +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -# -# chkconfig: 345 99 01 -# -### BEGIN INIT INFO -# Provides: icinga_command_proxy -# Required-Start: $remote_fs $syslog -# Required-Stop: $remote_fs $syslog -# Should-Start: icinga -# Should-Stop: icinga -### END INIT INFO - -# Source function library. -. /etc/rc.d/init.d/functions - -PROG="icinga_command_proxy" -BIN="/usr/local/bin/icinga_command_proxy" - -if [[ -f /etc/sysconfig/$PROG ]]; then - . /etc/sysconfig/$PROG -fi - -ICINGA_CMD=${ICINGA_CMD:-"/usr/local/icinga/var/rw/icinga.cmd"} -ICINGA_MYSQL_CMD=${ICINGA_MYSQL_CMD:-"/usr/local/icinga-mysql/var/rw/icinga.cmd"} -ICINGA_PGSQL_CMD=${ICINGA_PGSQL_CMD:-"/usr/local/icinga-pgsql/var/rw/icinga.cmd"} - -LOCKFILE=${LOCKFILE:-/var/lock/subsys/$PROG} -PIDFILE=${PIDFILE:-/var/lock/subsys/$PROG/$PROG.pid} - -RETVAL=0 - -start() { - echo -n $"Starting $PROG: " - daemon --pidfile="$PIDFILE" "nohup \"$BIN\" \"$ICINGA_CMD\" \"$ICINGA_MYSQL_CMD\" \"$ICINGA_PGSQL_CMD\" >/dev/null 2>&1 &" - RETVAL=$? - echo - [ $RETVAL = 0 ] && touch "$LOCKFILE" - return $RETVAL -} - -stop() { - echo -n $"Stopping $PROG: " - killproc -p "$PIDFILE" "$BIN" - RETVAL=$? - echo - [ $RETVAL = 0 ] && rm -f "$LOCKFILE" "$PIDFILE" -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p "$PIDFILE" "$BIN" - RETVAL=$? - ;; - restart) - stop - start - ;; - *) - echo $"Usage: $PROG {start|stop|restart|status}" - RETVAL=2 -esac - -exit $RETVAL - diff --git a/.vagrant-puppet/files/etc/motd b/.vagrant-puppet/files/etc/motd deleted file mode 100644 index 7e6677c20..000000000 --- a/.vagrant-puppet/files/etc/motd +++ /dev/null @@ -1,16 +0,0 @@ - ______ ___ -/\__ _\ __ /'___`\ -\/_/\ \/ ___ /\_\ ___ __ __ /\_\ /\ \ - \ \ \ /'___\/\ \ /' _ `\ /'_ `\ /'__`\ \/_/// /__ - \_\ \__/\ \__/\ \ \/\ \/\ \/\ \L\ \/\ \L\.\_ // /_\ \ - /\_____\ \____\\ \_\ \_\ \_\ \____ \ \__/.\_\ /\______/ - \/_____/\/____/ \/_/\/_/\/_/\/___L\ \/__/\/_/ \/_____/ - /\____/ - \_/__/ - __ __ __ -/\ \ __/\ \ /\ \ -\ \ \/\ \ \ \ __\ \ \____ - \ \ \ \ \ \ \ /'__`\ \ '__`\ - \ \ \_/ \_\ \/\ __/\ \ \L\ \ - \ `\___x___/\ \____\\ \_,__/ - '\/__//__/ \/____/ \/___/ diff --git a/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy b/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy deleted file mode 100644 index de7cb157c..000000000 --- a/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -# -# Redirect commands from pipe A to pipe B and C -# - -set -e -set -u - -ICINGA_CMD=${1:-"/usr/local/icinga/var/rw/icinga.cmd"} -ICINGA_MYSQL_CMD=${2:-"/usr/local/icinga-mysql/var/rw/icinga.cmd"} -ICINGA_PGSQL_CMD=${3:-"/usr/local/icinga-pgsql/var/rw/icinga.cmd"} - -trap 'rm -f "$ICINGA_CMD"; exit' EXIT SIGKILL - -if [[ -p "$ICINGA_CMD" ]]; then - rm -f "$ICINGA_CMD" -fi - -mkfifo -m 660 "$ICINGA_CMD" -chown icinga.icinga-cmd "$ICINGA_CMD" - -while true -do - if read COMMAND - then - if [[ -p "$ICINGA_MYSQL_CMD" ]]; then - echo "$COMMAND" > "$ICINGA_MYSQL_CMD" - else - logger -p local0.err Can\'t distribute command to the Icinga MySQL instance since its command pipe doesn\'t exist - fi - if [[ -p "$ICINGA_PGSQL_CMD" ]]; then - echo "$COMMAND" > "$ICINGA_PGSQL_CMD" - else - logger -p local0.err Can\'t distribute command to the Icinga PostgreSQL instance since its command pipe doesn\'t exist - fi - fi -done < "$ICINGA_CMD" 3> "$ICINGA_CMD" - -# Reset all traps -trap - EXIT SIGKILL - -exit 0 diff --git a/.vagrant-puppet/files/var/www/html/icingaweb/index.php b/.vagrant-puppet/files/var/www/html/icingaweb/index.php deleted file mode 100644 index 9e452ac70..000000000 --- a/.vagrant-puppet/files/var/www/html/icingaweb/index.php +++ /dev/null @@ -1,5 +0,0 @@ - '/bin:/usr/bin:/sbin:/usr/sbin' } - -$icingaVersion = '1.11.5' -$icinga2Version = '2.0.1' -$pluginVersion = '2.0' -$livestatusVersion = '1.2.4p5' -$phantomjsVersion = '1.9.1' -$casperjsVersion = '1.0.2' - -exec { 'create-mysql-icinga-db': - unless => 'mysql -uicinga -picinga icinga', - command => 'mysql -uroot -e "CREATE DATABASE icinga; \ - GRANT SELECT,INSERT,UPDATE,DELETE ON icinga.* TO icinga@localhost \ - IDENTIFIED BY \'icinga\';"', - require => Service['mysqld'] -} - -exec { 'create-mysql-icinga2-db': - unless => 'mysql -uicinga2 -picinga2 icinga2', - command => 'mysql -uroot -e "CREATE DATABASE icinga2; \ - GRANT SELECT,INSERT,UPDATE,DELETE ON icinga2.* to icinga2@localhost \ - IDENTIFIED BY \'icinga2\';"', - require => Service['mysqld'] -} - -exec{ 'create-pgsql-icinga-db': - unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga\'" | grep -q 1', - command => 'sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD \'icingaweb\';" && \ - sudo -u postgres createdb -O icinga -E UTF8 -T template0 icinga && \ - sudo -u postgres createlang plpgsql icinga', - require => Service['postgresql'] -} - -$icinga_packages = [ 'gcc', 'glibc', 'glibc-common', 'gd', 'gd-devel', - 'libpng', 'libpng-devel', 'net-snmp', 'net-snmp-devel', 'net-snmp-utils', - 'libdbi', 'libdbi-devel', 'libdbi-drivers', - 'libdbi-dbd-mysql', 'libdbi-dbd-pgsql' ] -package { $icinga_packages: ensure => installed } - -php::extension { ['php-mysql', 'php-pgsql', 'php-ldap']: - require => [ Class['mysql'], Class['pgsql'], Class['openldap'] ] -} - -php::extension { 'php-gd': } - -group { 'icinga-cmd': - ensure => present -} - -group { 'icingacmd': - ensure => present, - require => Package['icinga2'] -} - -user { 'icinga': - ensure => present, - groups => 'icinga-cmd', - managehome => false -} - -user { 'apache': - groups => ['icinga-cmd', 'vagrant', 'icingacmd'], - require => [ Class['apache'], Group['icinga-cmd'], Group['icingacmd'] ] -} - -cmmi { 'icinga-mysql': - url => "https://github.com/Icinga/icinga-core/releases/download/v${icingaVersion}/icinga-${icingaVersion}.tar.gz", - output => "icinga-${icingaVersion}.tar.gz", - flags => '--prefix=/usr/local/icinga-mysql --with-command-group=icinga-cmd \ - --enable-idoutils --with-init-dir=/usr/local/icinga-mysql/etc/init.d \ - --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', - creates => '/usr/local/icinga-mysql', - make => 'make all && make fullinstall install-config', - require => [ User['icinga'], Class['monitoring-plugins'], Package['apache'] ], - notify => Service['apache'] -} - -file { '/etc/init.d/icinga-mysql': - source => '/usr/local/icinga-mysql/etc/init.d/icinga', - require => Cmmi['icinga-mysql'] -} - -file { '/etc/init.d/ido2db-mysql': - source => '/usr/local/icinga-mysql/etc/init.d/ido2db', - require => Cmmi['icinga-mysql'] -} - -cmmi { 'icinga-pgsql': - url => "https://github.com/Icinga/icinga-core/releases/download/v${icingaVersion}/icinga-${icingaVersion}.tar.gz", - output => "icinga-${icingaVersion}.tar.gz", - flags => '--prefix=/usr/local/icinga-pgsql \ - --with-command-group=icinga-cmd --enable-idoutils \ - --with-init-dir=/usr/local/icinga-pgsql/etc/init.d \ - --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', - creates => '/usr/local/icinga-pgsql', - make => 'make all && make fullinstall install-config', - require => [ User['icinga'], Class['monitoring-plugins'], Package['apache'] ], - notify => Service['apache'] -} - -file { '/etc/init.d/icinga-pgsql': - source => '/usr/local/icinga-pgsql/etc/init.d/icinga', - require => Cmmi['icinga-pgsql'] -} - -file { '/etc/init.d/ido2db-pgsql': - source => '/usr/local/icinga-pgsql/etc/init.d/ido2db', - require => Cmmi['icinga-pgsql'] -} - -exec { 'populate-icinga-mysql-db': - unless => 'mysql -uicinga -picinga icinga -e "SELECT * FROM icinga_dbversion;" &> /dev/null', - command => "mysql -uroot icinga < /usr/local/src/icinga-mysql/icinga-${icingaVersion}/module/idoutils/db/mysql/mysql.sql", - require => [ Cmmi['icinga-mysql'], Exec['create-mysql-icinga-db'] ] -} - -exec { 'populate-icinga-pgsql-db': - unless => 'psql -U icinga -d icinga -c "SELECT * FROM icinga_dbversion;" &> /dev/null', - command => "sudo -u postgres psql -U icinga -d icinga < /usr/local/src/icinga-pgsql/icinga-${icingaVersion}/module/idoutils/db/pgsql/pgsql.sql", - require => [ Cmmi['icinga-pgsql'], Exec['create-pgsql-icinga-db'] ] -} - -service { 'icinga-mysql': - ensure => running, - require => File['/etc/init.d/icinga-mysql'] -} - -service { 'ido2db-mysql': - ensure => running, - require => File['/etc/init.d/ido2db-mysql'] -} - -file { '/usr/local/icinga-mysql/etc/ido2db.cfg': - content => template('icinga/ido2db-mysql.cfg.erb'), - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-mysql'], - notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ] -} - -file { '/usr/local/icinga-mysql/etc/idomod.cfg': - source => '/usr/local/icinga-mysql/etc/idomod.cfg-sample', - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-mysql'], - notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ] -} - -file { '/usr/local/icinga-mysql/etc/modules/idoutils.cfg': - source => '/usr/local/icinga-mysql/etc/modules/idoutils.cfg-sample', - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-mysql'], - notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ] -} - -service { 'icinga-pgsql': - ensure => running, - require => Cmmi['icinga-pgsql'] -} - -service { 'ido2db-pgsql': - ensure => running, - require => Cmmi['icinga-pgsql'] -} - -file { '/usr/local/icinga-pgsql/etc/ido2db.cfg': - content => template('icinga/ido2db-pgsql.cfg.erb'), - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-pgsql'], - notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ] -} - -file { '/usr/local/icinga-pgsql/etc/idomod.cfg': - source => '/usr/local/icinga-pgsql/etc/idomod.cfg-sample', - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-pgsql'], - notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ] -} - -file { '/usr/local/icinga-pgsql/etc/modules/idoutils.cfg': - source => '/usr/local/icinga-pgsql/etc/modules/idoutils.cfg-sample', - owner => 'icinga', - group => 'icinga', - require => Cmmi['icinga-pgsql'], - notify => [ Service['icinga-pgsql'], Service['ido2db-pgsql'] ] -} - -exec { 'iptables-allow-http': - unless => 'grep -Fxqe "-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT" /etc/sysconfig/iptables', - command => 'iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT && iptables-save > /etc/sysconfig/iptables' -} - -exec { 'icinga-htpasswd': - creates => '/usr/share/icinga/htpasswd.users', - command => 'mkdir -p /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga', - require => Class['apache'] -} - -include monitoring-plugins - -cmmi { 'mk-livestatus': - url => "http://mathias-kettner.de/download/mk-livestatus-${livestatusVersion}.tar.gz", - output => "mk-livestatus-${livestatusVersion}.tar.gz", - flags => '--prefix=/usr/local/icinga-mysql --exec-prefix=/usr/local/icinga-mysql', - creates => '/usr/local/icinga-mysql/lib/mk-livestatus', - make => 'make && make install', - require => Cmmi['icinga-mysql'] -} - -file { '/usr/local/icinga-mysql/etc/modules/mk-livestatus.cfg': - content => template('mk-livestatus/mk-livestatus.cfg.erb'), - owner => 'icinga', - group => 'icinga', - require => Cmmi['mk-livestatus'], - notify => [ Service['icinga-mysql'], Service['ido2db-mysql'] ] -} - -file { 'openldap/db.ldif': - path => '/usr/share/openldap-servers/db.ldif', - source => 'puppet:///modules/openldap/db.ldif', - require => Class['openldap'] -} - -file { 'openldap/dit.ldif': - path => '/usr/share/openldap-servers/dit.ldif', - source => 'puppet:///modules/openldap/dit.ldif', - require => Class['openldap'] -} - -file { 'openldap/users.ldif': - path => '/usr/share/openldap-servers/users.ldif', - source => 'puppet:///modules/openldap/users.ldif', - require => Class['openldap'] -} - -exec { 'populate-openldap': - # TODO: Split the command and use unless instead of trying to populate openldap everytime - command => 'sudo ldapadd -c -Y EXTERNAL -H ldapi:/// -f /usr/share/openldap-servers/db.ldif || true && \ - sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/dit.ldif || true && \ - sudo ldapadd -c -D cn=admin,dc=icinga,dc=org -x -w admin -f /usr/share/openldap-servers/users.ldif || true', - require => [ Service['slapd'], File['openldap/db.ldif'], - File['openldap/dit.ldif'], File['openldap/users.ldif'] ] -} - -class { 'phantomjs': - url => "https://phantomjs.googlecode.com/files/phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2", - output => "phantomjs-${phantomjsVersion}-linux-x86_64.tar.bz2", - creates => '/usr/local/phantomjs' -} - -class { 'casperjs': - url => "https://github.com/n1k0/casperjs/tarball/${casperjsVersion}", - output => "casperjs-${casperjsVersion}.tar.gz", - creates => '/usr/local/casperjs' -} - -file { '/etc/profile.d/env.sh': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/profile.d/env.sh' -} - -include epel - -exec { 'install PHPUnit': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-phpunit-PHPUnit', - unless => 'rpm -qa | grep php-phpunit-PHPUnit', - require => Class['epel'] -} - -exec { 'install PHP CodeSniffer': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-pear-PHP-CodeSniffer', - unless => 'rpm -qa | grep php-pear-PHP-CodeSniffer', - require => Class['epel'] -} - -exec { 'install nodejs': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install npm', - unless => 'rpm -qa | grep ^npm', - require => Class['epel'] -} - -exec { 'install npm/mocha': - command => 'npm install -g mocha', - creates => '/usr/lib/node_modules/mocha', - require => Exec['install nodejs'] -} - -exec { 'install npm/mocha-cobertura-reporter': - command => 'npm install -g mocha-cobertura-reporter', - creates => '/usr/lib/node_modules/mocha-cobertura-reporter', - require => Exec['install npm/mocha'] -} - -exec { 'install npm/jshint': - command => 'npm install -g jshint', - creates => '/usr/lib/node_modules/jshint', - require => Exec['install nodejs'] -} - -exec { 'install npm/expect': - command => 'npm install -g expect', - creates => '/usr/lib/node_modules/expect', - require => Exec['install nodejs'] -} - -exec { 'install npm/should': - command => 'npm install -g should', - creates => '/usr/lib/node_modules/should', - require => Exec['install nodejs'] -} - -exec { 'install npm/URIjs': - command => 'npm install -g URIjs', - creates => '/usr/lib/node_modules/URIjs', - require => Exec['install nodejs'] -} - -exec { 'install php-ZendFramework': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework', - unless => 'rpm -qa | grep php-ZendFramework', - require => Class['epel'] -} - -package { ['cmake', 'boost-devel', 'bison', 'flex']: - ensure => installed -} - -# icinga 2 -define icinga2::feature ($feature = $title) { - exec { "icinga2-feature-${feature}": - path => '/bin:/usr/bin:/sbin:/usr/sbin', - unless => "readlink /etc/icinga2/features-enabled/${feature}.conf", - command => "icinga2-enable-feature ${feature}", - require => [ Package['icinga2'] ], - notify => Service['icinga2'] - } -} - -yumrepo { 'icinga2-repo': - baseurl => "http://packages.icinga.org/epel/6/snapshot/", - enabled => '1', - gpgcheck => '1', - gpgkey => 'http://packages.icinga.org/icinga.key', - descr => "Icinga Repository - ${::architecture}" -} - -exec { 'install nagios-plugins-all': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install nagios-plugins-all', - unless => 'rpm -qa | grep nagios-plugins-all', - require => [ Class['epel'], Package['icinga2'] ], -} - -package { 'icinga2': - ensure => latest, - require => Yumrepo['icinga2-repo'], - alias => 'icinga2' -} - -package { 'icinga2-bin': - ensure => latest, - require => [ Yumrepo['icinga2-repo'], Package['icinga2'] ], - alias => 'icinga2-bin' -} - -package { 'icinga2-doc': - ensure => latest, - require => Yumrepo['icinga2-repo'], - alias => 'icinga2-doc' -} - -# icinga 2 classic ui -package { 'icinga2-classicui-config': - ensure => latest, - before => Package["icinga-gui"], - require => [ Yumrepo['icinga2-repo'], Package['icinga2'] ], - notify => Service['apache'] -} - -package { 'icinga-gui': - ensure => latest, - require => Yumrepo['icinga2-repo'], - alias => 'icinga-gui' -} - -icinga2::feature { 'statusdata': - require => Package['icinga2-classicui-config'] -} - -icinga2::feature { 'command': - require => Package['icinga2-classicui-config'] -} - -icinga2::feature { 'compatlog': - require => Package['icinga2-classicui-config'] -} - -# icinga 2 ido mysql -package { 'icinga2-ido-mysql': - ensure => latest, - require => Yumrepo['icinga2-repo'], - alias => 'icinga2-ido-mysql' -} - -exec { 'populate-icinga2-mysql-db': - unless => 'mysql -uicinga2 -picinga2 icinga2 -e "SELECT * FROM icinga_dbversion;" &> /dev/null', - command => 'mysql -uroot icinga2 < /usr/share/icinga2-ido-mysql/schema/mysql.sql', - require => [ Exec['create-mysql-icinga2-db'], Package['icinga2-ido-mysql'] ] -} - -file { '/etc/icinga2/features-available/ido-mysql.conf': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/features-available/ido-mysql.conf', - owner => 'icinga', - group => 'icinga', - require => Package['icinga2'], - notify => Service['icinga2'] -} - -file { '/etc/icinga2/features-enabled/ido-mysql.conf': - ensure => 'link', - target => '/etc/icinga2/features-available/ido-mysql.conf', - owner => 'root', - group => 'root', - require => Package['icinga2-ido-mysql'] -} - -icinga2::feature { 'ido-mysql': - require => Exec['populate-icinga2-mysql-db'] -} - - -# icinga 2 test config -file { '/etc/icinga2/conf.d/test-config.conf': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/conf.d/test-config.conf', - owner => 'icinga', - group => 'icinga', - require => [ Package['icinga2'], Exec['create_monitoring_test_config'] ] -} - -file { '/etc/icinga2/conf.d/commands.conf': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/conf.d/commands.conf', - owner => 'icinga', - group => 'icinga', - require => Package['icinga2'] -} - -file { '/etc/icinga2/constants.conf': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icinga2/constants.conf', - owner => 'icinga', - group => 'icinga', - require => Package['icinga2'] -} - -service { 'icinga2': - ensure => running, - require => [ - Package['icinga2'], - File['/etc/icinga2/features-enabled/ido-mysql.conf'], - File['/etc/icinga2/conf.d/test-config.conf'], - File['/etc/icinga2/conf.d/commands.conf'] - ] -} - -exec { 'install php-ZendFramework-Db-Adapter-Pdo-Mysql': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Mysql', - unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Mysql', - require => Exec['install php-ZendFramework'] -} - -file { '/etc/motd': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/motd', - owner => root, - group => root -} - -user { 'vagrant': - groups => 'icinga-cmd', - require => Group['icinga-cmd'] -} - -exec { 'create-mysql-icinga_unittest-db': - unless => 'mysql -uicinga_unittest -picinga_unittest icinga_unittest', - command => 'mysql -uroot -e "CREATE DATABASE icinga_unittest; \ - GRANT ALL ON icinga_unittest.* TO icinga_unittest@localhost \ - IDENTIFIED BY \'icinga_unittest\';"', - require => Service['mysqld'] -} - -exec{ 'create-pgsql-icinga_unittest-db': - unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icinga_unittest\'" | grep -q 1', - command => 'sudo -u postgres psql -c "CREATE ROLE icinga_unittest WITH LOGIN PASSWORD \'icinga_unittest\';" && \ - sudo -u postgres createdb -O icinga_unittest -E UTF8 -T template0 icinga_unittest && \ - sudo -u postgres createlang plpgsql icinga_unittest', - require => Service['postgresql'] -} - -exec { 'install php-ZendFramework-Db-Adapter-Pdo-Pgsql': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install php-ZendFramework-Db-Adapter-Pdo-Pgsql', - unless => 'rpm -qa | grep php-ZendFramework-Db-Adapter-Pdo-Pgsql', - require => Exec['install php-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 */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/${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'] ] -} - -# -# Following section creates and populates MySQL and PostgreSQL Icinga Web 2 databases -# -exec { 'create-mysql-icingaweb-db': - unless => 'mysql -uicingaweb -picingaweb icingaweb', - command => 'mysql -uroot -e "CREATE DATABASE icingaweb; \ - GRANT ALL ON icingaweb.* TO icingaweb@localhost \ - IDENTIFIED BY \'icingaweb\';"', - require => Service['mysqld'] -} - -exec { 'create-pgsql-icingaweb-db': - unless => 'sudo -u postgres psql -tAc "SELECT 1 FROM pg_roles WHERE rolname=\'icingaweb\'" | grep -q 1', - command => 'sudo -u postgres psql -c "CREATE ROLE icingaweb WITH LOGIN PASSWORD \'icinga\';" && \ - sudo -u postgres createdb -O icingaweb -E UTF8 -T template0 icingaweb && \ - sudo -u postgres createlang plpgsql icingaweb', - require => Service['postgresql'] -} - -exec { 'populate-icingaweb-mysql-db-tables': - unless => 'mysql -uicingaweb -picingaweb icingaweb -e "SELECT * FROM icingaweb_group;" &> /dev/null', - command => 'mysql -uicingaweb -picingaweb icingaweb < /vagrant/etc/schema/mysql.schema.sql', - require => [ Exec['create-mysql-icingaweb-db'] ] -} - -exec { 'populate-icingweba-pgsql-db-tables': - unless => 'psql -U icingaweb -d icingaweb -c "SELECT * FROM icingaweb_group;" &> /dev/null', - command => 'sudo -u postgres psql -U icingaweb -d icingaweb -f /vagrant/etc/schema/pgsql.schema.sql', - require => [ Exec['create-pgsql-icingaweb-db'] ] -} - -# -# Following section creates the Icinga command proxy to /usr/local/icinga-mysql/var/rw/icinga.cmd (which is the -# config's default path for the Icinga command pipe) in order to send commands to both the MySQL and PostgreSQL instance -# -file { [ '/usr/local/icinga/', '/usr/local/icinga/var/', '/usr/local/icinga/var/rw/' ]: - ensure => directory, - owner => icinga, - group => icinga, - require => User['icinga'] -} - -file { '/usr/local/bin/icinga_command_proxy': - source => 'puppet:////vagrant/.vagrant-puppet/files/usr/local/bin/icinga_command_proxy', - owner => root, - group => root, - mode => 755 -} - -file { '/etc/init.d/icinga_command_proxy': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/init.d/icinga_command_proxy', - owner => root, - group => root, - mode => 755, - require => File['/usr/local/bin/icinga_command_proxy'] -} - -service { 'icinga_command_proxy': - ensure => running, - require => [ File['/etc/init.d/icinga_command_proxy'], Service['icinga-mysql'], Service['icinga-pgsql'] ] -} - -exec { 'create-mysql-icinga_web-db': - unless => 'mysql -uicinga_web -picinga_web icinga_web', - command => 'mysql -uroot -e "CREATE DATABASE icinga_web; \ - GRANT ALL ON icinga_web.* TO icinga_web@localhost \ - IDENTIFIED BY \'icinga_web\';"', - require => Service['mysqld'] -} - -cmmi { 'icinga-web': - url => 'http://sourceforge.net/projects/icinga/files/icinga-web/1.10.0-beta/icinga-web-1.10.0-beta.tar.gz/download', - output => 'icinga-web-1.10.0-beta.tar.gz', - flags => '--prefix=/usr/local/icinga-web', - creates => '/usr/local/icinga-web', - make => 'make install && make install-apache-config', - require => Service['icinga_command_proxy'], - notify => Service['apache'] -} - -exec { 'populate-icinga_web-mysql-db': - unless => 'mysql -uicinga_web -picinga_web icinga_web -e "SELECT * FROM nsm_user;" &> /dev/null', - command => 'mysql -uicinga_web -picinga_web icinga_web < /usr/local/src/icinga-web/icinga-web-1.10.0-beta/etc/schema/mysql.sql', - require => [ Exec['create-mysql-icinga_web-db'], Cmmi['icinga-web'] ] -} - -file { '/var/www/html/icingaweb': - ensure => absent, -} - -file { '/etc/httpd/conf.d/icingaweb.conf': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/httpd/conf.d/icingaweb.conf', - require => Package['apache'], - notify => Service['apache'] -} - -file { '/etc/icingaweb': - ensure => 'directory', - owner => 'apache', - group => 'apache' -} - -file { '/etc/icingaweb/preferences': - ensure => 'directory', - owner => 'apache', - group => 'apache', - require => File['/etc/icingaweb'] -} - -file { '/etc/icingaweb/authentication.ini': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/authentication.ini', - owner => 'apache', - group => 'apache', - require => File['/etc/icingaweb'] -} - -file { '/etc/icingaweb/config.ini': - ensure => file, - owner => 'apache', - group => 'apache', -} - -file { '/etc/icingaweb/resources.ini': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/resources.ini', - owner => 'apache', - group => 'apache', - replace => false -} - -file { ['/etc/icingaweb/enabledModules', '/etc/icingaweb/modules', '/etc/icingaweb/modules/monitoring']: - ensure => 'directory', - owner => 'apache', - group => 'apache', -} - -file { '/etc/icingaweb/modules/monitoring/backends.ini': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/backends.ini', - owner => 'apache', - group => 'apache', -} - -file { '/etc/icingaweb/modules/monitoring/config.ini': - source => 'puppet:////vagrant/config/modules/monitoring/config.ini', - owner => 'apache', - group => 'apache', -} - -file { '/etc/icingaweb/modules/monitoring/instances.ini': - source => 'puppet:////vagrant/.vagrant-puppet/files/etc/icingaweb/modules/monitoring/instances.ini', - owner => 'apache', - group => 'apache', -} - -# pear::package { 'deepend/Mockery': -# channel => 'pear.survivethedeepend.com' -# } - -# icingacli -file { '/usr/local/bin/icingacli': - ensure => 'link', - target => '/vagrant/bin/icingacli', - owner => 'apache', - group => 'apache', - require => [ File['/etc/icingaweb'], File['/etc/bash_completion.d/icingacli'] ] -} - -exec { 'install bash-completion': - command => 'yum -d 0 -e 0 -y --enablerepo=epel install bash-completion', - unless => 'rpm -qa | grep bash-completion', - require => Class['epel'] -} - -file { '/etc/bash_completion.d/icingacli': - source => 'puppet:////vagrant/etc/bash_completion.d/icingacli', - owner => 'root', - group => 'root', - mode => 755, - require => Exec['install bash-completion'] -} diff --git a/.vagrant-puppet/manifests/finalize.sh b/.vagrant-puppet/manifests/finalize.sh deleted file mode 100644 index 3b1418575..000000000 --- a/.vagrant-puppet/manifests/finalize.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -set -e - -installJquery () { - # The npm module jquery won't install via puppet because of an mysterious error - # when node-gyp rebuilding the dependent contextify module - if [ ! -d /usr/lib/node_modules/jquery ]; then - npm install --silent -g jquery - fi -} - -startServicesWithNonLSBCompliantExitStatusCodes () { - # Unfortunately the ido2db init script is not LSB compliant and hence not started via puppet - service ido2db-mysql start || true - service ido2db-pgsql start || true -} - -mountIcinga2webVarLog () { - if ! $(/bin/mount | /bin/grep -q "/vagrant/var/log"); then - # Remount /vagrant/var/log/ with appropriate permissions since the group apache is missing initially - /bin/mount -t vboxsf -o \ - uid=`id -u vagrant`,gid=`id -g apache`,dmode=775,fmode=664 \ - /vagrant/var/log/ \ - /vagrant/var/log/ - fi -} - -installJquery -startServicesWithNonLSBCompliantExitStatusCodes -mountIcinga2webVarLog - -exit 0 diff --git a/.vagrant-puppet/modules/casperjs/manifests/init.pp b/.vagrant-puppet/modules/casperjs/manifests/init.pp deleted file mode 100644 index fd54e37f9..000000000 --- a/.vagrant-puppet/modules/casperjs/manifests/init.pp +++ /dev/null @@ -1,66 +0,0 @@ -# Class: casperjs -# -# This module downloads, extracts, and installs casperjs tar.gz archives -# using wget and tar. -# -# Parameters: -# [*url*] - fetch archive via wget from this url. -# [*output*] - filename to fetch the archive into. -# [*creates*] - target directory the software will install to. -# -# Actions: -# -# Requires: -# -# Sample Usage: -# -# class {'casperjs': -# url => 'https://github.com/n1k0/casperjs/tarball/1.0.2', -# output => 'casperjs-1.0.2.tar.gz', -# creates => '/usr/local/casperjs' -# } -# -class casperjs( - $url, - $output, - $creates -) { - - Exec { path => '/usr/bin:/bin' } - - $cwd = '/usr/local/src' - - include wget - - exec { 'download-casperjs': - cwd => $cwd, - command => "wget -q ${url} -O ${output}", - creates => "${cwd}/${output}", - timeout => 120, - require => Class['wget'] - } - - $tld = inline_template('<%= File.basename(@output, ".tar.bz2") %>') - $src = "${cwd}/casperjs" - - exec { 'extract-casperjs': - cwd => $cwd, - command => "mkdir -p casperjs && tar --no-same-owner \ - --no-same-permissions -xzf ${output} -C ${src} \ - --strip-components 1", - creates => $src, - require => Exec['download-casperjs'] - } - - file { 'install-casperjs': - path => $creates, - source => $src, - recurse => true, - require => Exec['extract-casperjs'] - } - - file { 'link-casperjs-bin': - ensure => "${creates}/bin/casperjs", - path => '/usr/local/bin/casperjs' - } -} diff --git a/.vagrant-puppet/modules/cmmi/manifests/init.pp b/.vagrant-puppet/modules/cmmi/manifests/init.pp deleted file mode 100644 index e0116fbc9..000000000 --- a/.vagrant-puppet/modules/cmmi/manifests/init.pp +++ /dev/null @@ -1,80 +0,0 @@ -# Define: cmmi -# -# This module downloads, extracts, builds and installs tar.gz archives using -# wget, tar and the autotools stack. Build directory is always /usr/local/src. -# -# *Note* make sure to install build essentials before running cmmi. -# -# Parameters: -# [*url*] - fetch archive via wget from this url. -# [*output*] - filename to fetch the archive into. -# [*flags*] - configure options. -# [*creates*] - target directory the software will install to. -# [*make* ] - command to make and make install the software. -# [*make_timeout* ] - timeout for the make command. -# -# Actions: -# -# Requires: -# -# Sample Usage: -# -# cmmi { 'example-software': -# url => 'http://example-software.com/download/', -# output => 'example-software.tar.gz', -# flags => '--prefix=/opt/example-software', -# creates => '/opt/example-software', -# make => 'make && make install' -# make_timeout => 600 -# } -# -define cmmi( - $url, - $output, - $flags='', - $creates, - $make, - $make_timeout=300, - $configure_command='sh ./configure' -) { - - Exec { path => '/bin:/usr/bin' } - - $cwd = '/usr/local/src' - - include wget - - exec { "download-${name}": - cwd => $cwd, - command => "wget -q \"${url}\" -O ${output}", - creates => "${cwd}/${output}", - require => Class['wget'] - } - - $tld = inline_template('<%= File.basename(@output, ".tar.gz") %>') - $src = "${cwd}/${name}/${tld}" - - exec { "extract-${name}": - cwd => $cwd, - command => "mkdir -p ${name}/${tld} && tar --no-same-owner \ - --no-same-permissions -xzf ${output} -C ${name}/${tld} \ - --strip-components 1", - creates => $src, - require => Exec["download-${name}"] - } - - exec { "configure-${name}": - cwd => $src, - command => "${configure_command} ${flags}", - creates => "${src}/Makefile", - require => Exec["extract-${name}"] - } - - exec { "make-${name}": - cwd => $src, - command => $make, - creates => $creates, - require => Exec["configure-${name}"], - timeout => $make_timeout - } -} diff --git a/.vagrant-puppet/modules/configure/manifests/init.pp b/.vagrant-puppet/modules/configure/manifests/init.pp deleted file mode 100644 index beeb98b17..000000000 --- a/.vagrant-puppet/modules/configure/manifests/init.pp +++ /dev/null @@ -1,17 +0,0 @@ -# Define: configure -# -# Run a gnu configure to prepare software for environment -# -# Parameters: -# [*flags*] - configure options. -# [*path*] - Target and working dir -# -define configure( - $path, - $flags -) { - exec { "configure-${name}": - cwd => $path, - command => "sh ./configure ${flags}" - } -} \ No newline at end of file diff --git a/.vagrant-puppet/modules/cpan/manifests/init.pp b/.vagrant-puppet/modules/cpan/manifests/init.pp deleted file mode 100644 index 9cbdaf8b0..000000000 --- a/.vagrant-puppet/modules/cpan/manifests/init.pp +++ /dev/null @@ -1,49 +0,0 @@ -# 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 - } -} diff --git a/.vagrant-puppet/modules/cpan/templates/MyConfig.pm.erb b/.vagrant-puppet/modules/cpan/templates/MyConfig.pm.erb deleted file mode 100644 index da410a188..000000000 --- a/.vagrant-puppet/modules/cpan/templates/MyConfig.pm.erb +++ /dev/null @@ -1,68 +0,0 @@ -$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__ diff --git a/.vagrant-puppet/modules/mk-livestatus/templates/mk-livestatus.cfg.erb b/.vagrant-puppet/modules/mk-livestatus/templates/mk-livestatus.cfg.erb deleted file mode 100644 index f61ffc001..000000000 --- a/.vagrant-puppet/modules/mk-livestatus/templates/mk-livestatus.cfg.erb +++ /dev/null @@ -1,6 +0,0 @@ -define module{ - module_name mklivestatus - path /usr/local/icinga-mysql/lib/mk-livestatus/livestatus.o - module_type neb - args /usr/local/icinga-mysql/var/rw/live - } diff --git a/.vagrant-puppet/modules/pear/manifests/init.pp b/.vagrant-puppet/modules/pear/manifests/init.pp deleted file mode 100644 index 0c748f2bc..000000000 --- a/.vagrant-puppet/modules/pear/manifests/init.pp +++ /dev/null @@ -1,43 +0,0 @@ -# Class: pear -# -# This class installs pear. -# -# Parameters: -# -# Actions: -# -# Requires: -# -# php -# -# Sample Usage: -# -# include pear -# -class pear { - - Exec { path => '/usr/bin:/bin' } - - include php - - package { 'php-pear': - ensure => installed, - require => Class['php'] - } - - exec { 'pear upgrade': - command => 'pear upgrade', - require => Package['php-pear'] - } - - exec { 'pear update-channels': - command => 'pear update-channels', - require => Package['php-pear'] - } - - exec { 'pear auto discover channels': - command => 'pear config-set auto_discover 1', - unless => 'pear config-get auto_discover | grep 1', - require => Package['php-pear'] - } -} diff --git a/.vagrant-puppet/modules/pear/manifests/package.pp b/.vagrant-puppet/modules/pear/manifests/package.pp deleted file mode 100644 index 90b807b3d..000000000 --- a/.vagrant-puppet/modules/pear/manifests/package.pp +++ /dev/null @@ -1,50 +0,0 @@ -# Define: pear::package -# -# Install additional PEAR packages -# -# Parameters: -# -# Actions: -# -# Requires: -# -# pear -# -# Sample Usage: -# -# pear::package { 'phpunit': } -# -define pear::package( - $channel -) { - - Exec { path => '/usr/bin' } - - include pear - - if $::require { - $require_ = [Class['pear'], $::require] - } else { - $require_ = Class['pear'] - } - - if $channel { - exec { "pear discover ${channel}": - command => "sudo pear channel-discover ${channel}", - unless => "pear channel-info ${channel}", - require => $require_, - before => Exec["pear install ${name}"] - } - } - - exec { "pear install ${name}": - command => "pear install --alldeps ${name}", - unless => "pear list ${name}", - require => $require_ - } - - exec { "pear upgrade ${name}": - command => "pear upgrade ${name}", - require => Exec["pear install ${name}"] - } -} diff --git a/.vagrant-puppet/modules/phantomjs/manifests/init.pp b/.vagrant-puppet/modules/phantomjs/manifests/init.pp deleted file mode 100644 index ea65b1f26..000000000 --- a/.vagrant-puppet/modules/phantomjs/manifests/init.pp +++ /dev/null @@ -1,65 +0,0 @@ -# Class: phantomjs -# -# This module downloads, extracts, and installs phantomjs tar.bz2 archives -# using wget and tar. -# -# Parameters: -# [*url*] - fetch archive via wget from this url. -# [*output*] - filename to fetch the archive into. -# [*creates*] - target directory the software will install to. -# -# Actions: -# -# Requires: -# -# Sample Usage: -# -# class {'phantomjs': -# url => 'https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2', -# output => 'phantomjs-1.9.1-linux-x86_64.tar.bz2', -# creates => '/usr/local/phantomjs' -# } -# -class phantomjs( - $url, - $output, - $creates -) { - - Exec { path => '/usr/bin:/bin' } - - $cwd = '/usr/local/src' - - include wget - - exec { 'download-phantomjs': - cwd => $cwd, - command => "wget -q ${url} -O ${output}", - creates => "${cwd}/${output}", - timeout => 120, - require => Class['wget'] - } - - $src = "${cwd}/phantomjs" - - exec { 'extract-phantomjs': - cwd => $cwd, - command => "mkdir -p phantomjs && tar --no-same-owner \ - --no-same-permissions -xjf ${output} -C ${src} \ - --strip-components 1", - creates => $src, - require => Exec['download-phantomjs'] - } - - file { 'install-phantomjs': - path => $creates, - source => $src, - recurse => true, - require => Exec['extract-phantomjs'] - } - - file { 'link-phantomjs-bin': - ensure => "${creates}/bin/phantomjs", - path => '/usr/local/bin/phantomjs' - } -} diff --git a/.vagrant-puppet/modules/wget/manifests/init.pp b/.vagrant-puppet/modules/wget/manifests/init.pp deleted file mode 100644 index 560e10b2f..000000000 --- a/.vagrant-puppet/modules/wget/manifests/init.pp +++ /dev/null @@ -1,20 +0,0 @@ -# Class: wget -# -# This class installs wget. -# -# Parameters: -# -# Actions: -# -# Requires: -# -# Sample Usage: -# -# include wget -# -class wget { - - package { 'wget': - ensure => installed, - } -} diff --git a/Vagrantfile b/Vagrantfile index d73944173..28b69cab9 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -2,7 +2,7 @@ # vi: set ft=ruby : VAGRANTFILE_API_VERSION = "2" -VAGRANT_REQUIRED_VERSION = "1.2.0" +VAGRANT_REQUIRED_VERSION = "1.5.0" # Require 1.2.x at least if ! defined? Vagrant.require_version @@ -15,93 +15,36 @@ else end Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # All Vagrant configuration is done here. The most common configuration - # options are documented and commented below. For a complete reference, - # please see the online documentation at vagrantup.com. - - # Every Vagrant virtual environment requires a box to build off of. - config.vm.box = "centos-6.4-x64-vbox" - - # The url from where the 'config.vm.box' box will be fetched if it - # doesn't already exist on the user's system. - config.vm.box_url = "http://vagrant-boxes.icinga.org/centos-64-x64-vbox4212.box" - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - config.vm.network :forwarded_port, guest: 80, host: 8080, - # Port collision auto-correction must be manually enabled for each forwarded port, - # since it is often surprising when it occurs and can lead the Vagrant user to - # think that the port wasn't properly forwarded. During a vagrant up or vagrant reload, - # Vagrant will output information about any collisions detections and auto corrections made, - # so you can take notice and act accordingly. + config.vm.network "forwarded_port", guest: 80, host: 8080, auto_correct: true - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network :private_network, ip: "192.168.33.10" + config.vm.provision :shell, :path => ".puppet/manifests/puppet.sh" - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network :public_network + config.vm.provider :virtualbox do |v, override| + override.vm.box = "puppetlabs/centos-6.5-64-puppet" - # If true, then any SSH connections made will enable agent forwarding. - # Default value: false - # config.ssh.forward_agent = true - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder "./var/log", "/vagrant/var/log" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - # config.vm.provider :virtualbox do |vb| - # # Don't boot with headless mode - # vb.gui = true - # - # # Use VBoxManage to customize the VM. For example to change memory: - # vb.customize ["modifyvm", :id, "--memory", "1024"] - # end - # - # View the documentation for the provider you're using for more - # information on available options. - config.vm.provider "virtualbox" do |vb| - vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate//vagrant/config", "1"] - vb.customize ["modifyvm", :id, "--memory", "1024"] + v.customize ["modifyvm", :id, "--memory", "1024"] + end + + config.vm.provider :parallels do |p, override| + override.vm.box = "parallels/centos-6.5" + + p.name = "Icinga Web 2 Development" + + # Update Parallels Tools automatically + p.update_guest_tools = true + + # Set power consumption mode to "Better Performance" + p.optimize_power_consumption = false + + p.memory = 1024 + p.cpus = 2 end - # Enable provisioning with Puppet stand alone. Puppet manifests - # are contained in a directory path relative to this Vagrantfile. - # You will need to create the manifests directory and a manifest in - # the file base.pp in the manifests_path directory. - # - # An example Puppet manifest to provision the message of the day: - # - # # group { "puppet": - # # ensure => "present", - # # } - # # - # # File { owner => 0, group => 0, mode => 0644 } - # # - # # file { '/etc/motd': - # # content => "Welcome to your Vagrant-built virtual machine! - # # Managed by Puppet.\n" - # # } - # - # config.vm.provision :puppet do |puppet| - # puppet.manifests_path = "manifests" - # puppet.manifest_file = "init.pp" - # end config.vm.provision :puppet do |puppet| - puppet.module_path = ".vagrant-puppet/modules" - puppet.manifests_path = ".vagrant-puppet/manifests" - # puppet.options = "-v -d" + puppet.hiera_config_path = ".puppet/hiera/hiera.yaml" + puppet.module_path = [ ".puppet/modules", ".puppet/profiles" ] + puppet.manifests_path = ".puppet/manifests" + puppet.manifest_file = "site.pp" end - - config.vm.provision :shell, :path => ".vagrant-puppet/manifests/finalize.sh" end diff --git a/Vagrantfile.parallels b/Vagrantfile.parallels deleted file mode 100644 index 551345f2b..000000000 --- a/Vagrantfile.parallels +++ /dev/null @@ -1,27 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.vm.box = "parallels/centos-6.5" - - config.vm.network "forwarded_port", guest: 80, host: 8080, - auto_correct: true - - config.vm.provider "parallels" do |v| - v.name = "Icinga Web 2 Development" - # Update Parallels Tools automatically - v.update_guest_tools = true - # Set power consumption mode to "Better Performance" - v.optimize_power_consumption = false - v.memory = 1024 - v.cpus = 2 - end - - config.puppet_install.puppet_version = :latest - - config.vm.provision :puppet do |puppet| - puppet.module_path = ".vagrant-puppet/modules" - puppet.manifests_path = ".vagrant-puppet/manifests" - # puppet.options = "-v -d" - end -end diff --git a/application/layouts/scripts/pdf.phtml b/application/layouts/scripts/pdf.phtml index c4a1b25f7..38c9bdc2c 100644 --- a/application/layouts/scripts/pdf.phtml +++ b/application/layouts/scripts/pdf.phtml @@ -31,7 +31,7 @@ if ( isset($pdf) ) } -img('img/logo_icinga_big_dark.png', array('align' => 'right', 'width' => '150')) ?> +img('img/logo_icinga_big_dark.png', array('align' => 'right', 'width' => '75')) ?> - - monitoringState($host, 'host')) ?>
+ + host_state, true)); ?>
host_state !== 99): ?> prefixedTimeSince($host->host_last_state_change, true) ?> host_state > 0 && (int) $host->host_state_type === 0): ?> diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index 365d32f56..845effbc5 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -1,3 +1,10 @@ + + compact): ?>
tabs ?> @@ -36,13 +43,13 @@ foreach ($notifications as $notification): 'host' => $notification->host, 'service' => $notification->service )); - $stateName = strtolower($this->util()->getServiceStateName($notification->notification_state)); + $stateName = Service::getStateText($notification->notification_state); } else { $isService = false; $href = $this->href('monitoring/show/host', array( 'host' => $notification->host )); - $stateName = strtolower($this->util()->getHostStateName($notification->notification_state)); + $stateName = Host::getStateText($notification->notification_state); } ?> diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index 19aef5d64..dd9be0394 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -1,3 +1,8 @@ + compact): ?>
tabs; ?> @@ -63,7 +68,7 @@ $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ' + )); ?>" title="escape($service->service_output); ?>" class="state_service_state); ?> service_handled ? 'handled' : ''; ?>"> · diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 2ea125527..994304f08 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -1,4 +1,7 @@ getHelper('MonitoringState'); $selfUrl = 'monitoring/list/services'; @@ -51,12 +54,11 @@ foreach ($services as $service): 'host' => $service->host_name, ) ); - $serviceStateName = strtolower($this->util()->getServiceStateName($service->service_state)); + $serviceStateName = Service::getStateText($service->service_state); ?> - - translate(strtoupper($helper->monitoringState($service, 'service'))) ?>
- + + service_state, true)); ?>
compact): ?>prefixedTimeSince($service->service_last_state_change); ?>timeSince($service->service_last_state_change); ?> service_state > 0 && (int) $service->service_state_type === 0): ?>
@@ -65,7 +67,7 @@ foreach ($services as $service): - perfdata($service->service_perfdata, true, true) ?> + perfdata($service->service_perfdata, true) ?> service_handled && $service->service_state > 0): ?> icon('attention-alt', $this->translate('Unhandled')) ?> @@ -106,7 +108,7 @@ foreach ($services as $service): service_display_name ?>showHost): ?> on host_name; ?> host_state != 0): ?> - (monitoringState($service, 'host')); ?>) + (host_state, true)); ?>)

escape(substr(strip_tags($service->service_output), 0, 10000)); ?>

diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml index af05979fb..18071c152 100644 --- a/modules/monitoring/application/views/scripts/services/show.phtml +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -59,6 +59,13 @@
+
+ + icon('reply'); ?> + translate('Submit passive check results'); ?> + +
+

translate('Command') ?> - escape($command) ?> + + escape($command) ?> + passive_checks_enabled): ?> + getType() === $object::TYPE_HOST): ?> + icon('reply'); ?> translate('Process check result'); ?> + + icon('reply'); ?> translate('Process check result'); ?> + + getType() === $object::TYPE_SERVICE ?> +getType() === $object::TYPE_SERVICE; + +?> compact): ?> - + - +
> - translate($this->util()->getHostStateName($object->host_state)) ?>
+ host_state, true)); ?>
prefixedTimeSince($object->host_last_state_change, true) ?>
escape($object->host_name) ?>
- translate($this->util()->getServiceStateName($object->service_state)) ?>
+ service_state, true)); ?>
prefixedTimeSince($object->service_last_state_change, true) ?>
translate('Service') ?>: escape($object->service_description) ?> diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index dfc1cbf0e..5b922d4a0 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -1,3 +1,10 @@ + +
render('show/components/header.phtml'); ?>

translate('This Object\'s Event History'); ?>

@@ -13,6 +20,7 @@ getType() === 'host'; function contactsLink($match, $view) { $links = array(); foreach (preg_split('/,\s/', $match[1]) as $contact) { @@ -32,11 +40,7 @@ function contactsLink($match, $view) { case 'notify': $icon = 'notification'; $title = $this->translate('Notification'); - $stateClass = ( - $isService - ? strtolower($this->util()->getServiceStateName($event->state)) - : strtolower($this->util()->getHostStateName($event->state)) - ); + $stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); $msg = preg_replace_callback( '/^\[([^\]]+)\]/', @@ -86,23 +90,23 @@ function contactsLink($match, $view) { break; case 'hard_state': $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); - $stateClass = ( - $isService - ? strtolower($this->util()->getServiceStateName($event->state)) - : strtolower($this->util()->getHostStateName($event->state)) - ); + $stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); $icon = 'attention-alt'; - $title = strtoupper($stateClass); // TODO: Should be translatable! + $title = strtoupper( + $isService + ? Service::getStateText($event->state) + : Host::getStateText($event->state) + ); break; case 'soft_state': $icon = 'spinner'; $msg = '[ ' . $event->attempt . '/' . $event->max_attempts . ' ] ' . $this->escape($event->output); - $stateClass = ( + $stateClass = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state); + $title = strtoupper( $isService - ? strtolower($this->util()->getServiceStateName($event->state)) - : strtolower($this->util()->getHostStateName($event->state)) + ? Service::getStateText($event->state) + : Host::getStateText($event->state) ); - $title = strtoupper($stateClass); // TODO: Should be translatable! break; case 'dt_start': $icon = 'downtime_start'; @@ -132,7 +136,13 @@ $output = $this->tickets ? preg_replace_callback( ?> - escape($event->service_description) . ' ' . $this->translate('on') . ' ' . $this->escape($event->host_name); ?> + qlink( + $this->escape($event->service_description), + 'monitoring/show/service', + array( + 'host' => $event->host_name, + 'service' => $event->service_description) + ) : $this->escape($event->service_description); ?> translate('on') . ' ' . $this->escape($event->host_name); ?> escape($event->host_name); ?> diff --git a/modules/monitoring/library/Monitoring/Command/Object/ProcessCheckResultCommand.php b/modules/monitoring/library/Monitoring/Command/Object/ProcessCheckResultCommand.php index 9866aeb52..8e3155de5 100644 --- a/modules/monitoring/library/Monitoring/Command/Object/ProcessCheckResultCommand.php +++ b/modules/monitoring/library/Monitoring/Command/Object/ProcessCheckResultCommand.php @@ -34,7 +34,7 @@ class ProcessCheckResultCommand extends ObjectCommand /** * Host unreachable */ - const HOST_UNREACHABLE = 2; + const HOST_UNREACHABLE = 2; // TODO: Icinga 2.x does not support submitting results with this state, yet /** * Service ok diff --git a/modules/monitoring/library/Monitoring/Command/Renderer/IcingaCommandFileCommandRenderer.php b/modules/monitoring/library/Monitoring/Command/Renderer/IcingaCommandFileCommandRenderer.php index d2dca183c..2843974ea 100644 --- a/modules/monitoring/library/Monitoring/Command/Renderer/IcingaCommandFileCommandRenderer.php +++ b/modules/monitoring/library/Monitoring/Command/Renderer/IcingaCommandFileCommandRenderer.php @@ -126,7 +126,7 @@ class IcingaCommandFileCommandRenderer implements IcingaCommandRendererInterface } else { /** @var \Icinga\Module\Monitoring\Object\Service $object */ $commandString = sprintf( - 'PROCESS_SVC_CHECK_RESULT;%s;%s', + 'PROCESS_SERVICE_CHECK_RESULT;%s;%s', $object->getHost()->getName(), $object->getName() ); diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index 72cd4f286..53a6bb8a8 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -461,8 +461,8 @@ class WebWizard extends Wizard implements SetupWizard mt('setup', 'PHP Module: GD'), mt( 'setup', - 'In case you want icons and graphs being exported to PDF' - . ' as well, you\'ll need the GD extension for PHP.' + 'In case you want icons being exported to PDF as' + . ' well, you\'ll need the GD extension for PHP.' ), Platform::extensionLoaded('gd'), Platform::extensionLoaded('gd') ? mt('setup', 'The PHP module GD is available') : ( @@ -470,6 +470,19 @@ class WebWizard extends Wizard implements SetupWizard ) ); + $requirements->addOptional( + mt('setup', 'PHP Module: Imagick'), + mt( + 'setup', + 'In case you want graphs being exported to PDF as well' + . ', you\'ll need the ImageMagick extension for PHP.' + ), + Platform::extensionLoaded('imagick'), + Platform::extensionLoaded('imagick') ? mt('setup', 'The PHP module Imagick is available') : ( + mt('setup', 'The PHP module Imagick is missing') + ) + ); + $requirements->addOptional( mt('setup', 'PHP Module: PDO-MySQL'), mt( diff --git a/public/css/icinga/monitoring-colors.less b/public/css/icinga/monitoring-colors.less index 52154c24e..86268d2ce 100644 --- a/public/css/icinga/monitoring-colors.less +++ b/public/css/icinga/monitoring-colors.less @@ -65,11 +65,12 @@ table.action td a:hover { text-decoration: underline; } -table.action div.inlinepie { +table.action span.sparkline, table.action img.inlinepie { margin: 0.5em 0.25em 0.5em 0.25em; + float:right; } -.dashboard table.action div.inlinepie { +.dashboard table.action span.sparkline, .dashboard table.action img.inlinepie { margin: 0em 0.25em 0em 0.25em; } @@ -194,7 +195,7 @@ tr.state.handled td.state { } /* HOVER colors */ -tr[href]:hover { +tr.state:hover, tr[href]:hover { color: black; background-color: #eee; } diff --git a/public/css/pdf/pdfprint.less b/public/css/pdf/pdfprint.less index 874a5e518..117bef546 100644 --- a/public/css/pdf/pdfprint.less +++ b/public/css/pdf/pdfprint.less @@ -1,10 +1,15 @@ // {{{ICINGA_LICENSE_HEADER}}} // {{{ICINGA_LICENSE_HEADER}}} -.controls form, .controls .pagination, .controls > .tabs, .dontprint, .inlinepie { +.controls form, .controls .pagination, .controls .widgetLimiter, .controls > .tabs, .dontprint { display: none !important; } +table.action img.inlinepie { + width: 50%; + height: 50%; +} + @page { margin: 2cm; }