parent
ebfe5ab7f0
commit
039ab7ec55
|
@ -1,7 +1,6 @@
|
||||||
include apache
|
include apache
|
||||||
include mysql
|
include mysql
|
||||||
include pgsql
|
include pgsql
|
||||||
include php
|
|
||||||
|
|
||||||
Exec { path => '/bin:/usr/bin:/sbin' }
|
Exec { path => '/bin:/usr/bin:/sbin' }
|
||||||
|
|
||||||
|
@ -25,6 +24,9 @@ $icinga_packages = [ 'gcc', 'glibc', 'glibc-common', 'gd', 'gd-devel',
|
||||||
'libdbi-dbd-mysql', 'libdbi-dbd-pgsql' ]
|
'libdbi-dbd-mysql', 'libdbi-dbd-pgsql' ]
|
||||||
package { $icinga_packages: ensure => installed }
|
package { $icinga_packages: ensure => installed }
|
||||||
|
|
||||||
|
php::extension { ['php-mysql', 'php-pgsql']:
|
||||||
|
require => [Class['mysql'], Class['pgsql']]
|
||||||
|
}
|
||||||
|
|
||||||
group { 'icinga-cmd':
|
group { 'icinga-cmd':
|
||||||
ensure => present
|
ensure => present
|
||||||
|
@ -48,10 +50,11 @@ cmmi { 'icinga-mysql':
|
||||||
--enable-idoutils --with-init-dir=/tmp/icinga-mysql/etc/init.d \
|
--enable-idoutils --with-init-dir=/tmp/icinga-mysql/etc/init.d \
|
||||||
--with-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \
|
--with-htmurl=/icinga-mysql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-mysql.conf \
|
||||||
--with-cgiurl=/icinga-mysql/cgi-bin \
|
--with-cgiurl=/icinga-mysql/cgi-bin \
|
||||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users',
|
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||||
|
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||||
creates => '/usr/local/icinga-mysql',
|
creates => '/usr/local/icinga-mysql',
|
||||||
make => 'make all && make fullinstall install-config',
|
make => 'make all && make fullinstall install-config',
|
||||||
require => User['icinga'],
|
require => [User['icinga'], Cmmi['icinga-plugins']],
|
||||||
notify => Service["${apache::apache}"]
|
notify => Service["${apache::apache}"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,10 +76,11 @@ cmmi { 'icinga-pgsql':
|
||||||
--with-init-dir=/tmp/icinga-pgsql/etc/init.d \
|
--with-init-dir=/tmp/icinga-pgsql/etc/init.d \
|
||||||
--with-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \
|
--with-htmurl=/icinga-pgsql --with-httpd-conf-file=/etc/httpd/conf.d/icinga-pgsql.conf \
|
||||||
--with-cgiurl=/icinga-pgsql/cgi-bin \
|
--with-cgiurl=/icinga-pgsql/cgi-bin \
|
||||||
--with-http-auth-file=/usr/share/icinga/htpasswd.users',
|
--with-http-auth-file=/usr/share/icinga/htpasswd.users \
|
||||||
|
--with-plugin-dir=/usr/lib64/nagios/plugins/libexec',
|
||||||
creates => '/usr/local/icinga-pgsql',
|
creates => '/usr/local/icinga-pgsql',
|
||||||
make => 'make all && make fullinstall install-config',
|
make => 'make all && make fullinstall install-config',
|
||||||
require => User['icinga'],
|
require => [User['icinga'], Cmmi['icinga-plugins']],
|
||||||
notify => Service["${apache::apache}"]
|
notify => Service["${apache::apache}"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,3 +184,14 @@ exec { 'icinga-htpasswd':
|
||||||
command => 'mkdir /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
command => 'mkdir /usr/share/icinga && htpasswd -b -c /usr/share/icinga/htpasswd.users icingaadmin icinga',
|
||||||
require => Package["${apache::apache}"]
|
require => Package["${apache::apache}"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmmi { 'icinga-plugins':
|
||||||
|
url => 'http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz/download',
|
||||||
|
output => 'nagios-plugins-1.4.16.tar.gz',
|
||||||
|
flags => '--prefix=/usr/lib64/nagios/plugins \
|
||||||
|
--with-nagios-user=icinga --with-nagios-group=icinga \
|
||||||
|
--with-cgiurl=/icinga-mysql/cgi-bin',
|
||||||
|
creates => '/usr/lib64/nagios/plugins/libexec',
|
||||||
|
make => 'make && make install',
|
||||||
|
require => User['icinga']
|
||||||
|
}
|
||||||
|
|
|
@ -31,25 +31,21 @@ define cmmi(
|
||||||
$output,
|
$output,
|
||||||
$flags,
|
$flags,
|
||||||
$creates,
|
$creates,
|
||||||
$make='make all && make install',
|
$make,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
Exec { path => '/bin:/usr/bin' }
|
Exec { path => '/bin:/usr/bin' }
|
||||||
|
|
||||||
if ! defined(Package['wget']) {
|
|
||||||
package{ 'wget':
|
|
||||||
ensure => installed
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$cwd = '/usr/local/src'
|
$cwd = '/usr/local/src'
|
||||||
|
|
||||||
|
include wget
|
||||||
|
|
||||||
exec { "download-${name}":
|
exec { "download-${name}":
|
||||||
cwd => $cwd,
|
cwd => $cwd,
|
||||||
command => "wget -q ${url} -O ${output}",
|
command => "wget -q ${url} -O ${output}",
|
||||||
creates => "${cwd}/${output}",
|
creates => "${cwd}/${output}",
|
||||||
timeout => 120,
|
timeout => 120,
|
||||||
require => Package['wget']
|
require => Class['wget']
|
||||||
}
|
}
|
||||||
|
|
||||||
$tld = inline_template('<%= File.basename(output, ".tar.gz") %>')
|
$tld = inline_template('<%= File.basename(output, ".tar.gz") %>')
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
# define: php::extension
|
||||||
|
#
|
||||||
|
# Install additional PHP modules.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
#
|
||||||
|
# Actions:
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
#
|
||||||
|
# Sample Usage:
|
||||||
|
#
|
||||||
|
# php::extension { 'php-ldap': }
|
||||||
|
# php::extension { ['php-mysql'], ['php-pgsql']: }
|
||||||
|
#
|
||||||
|
define php::extension(
|
||||||
|
$ensure=installed
|
||||||
|
) {
|
||||||
|
|
||||||
|
include php
|
||||||
|
|
||||||
|
if $::require {
|
||||||
|
$require_ = [Class['php'], $::require]
|
||||||
|
} else {
|
||||||
|
$require_ = Class['php']
|
||||||
|
}
|
||||||
|
|
||||||
|
package { $name:
|
||||||
|
ensure => $ensure,
|
||||||
|
require => $require_
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
# Class: php
|
# Class: php
|
||||||
#
|
#
|
||||||
# This class installs the php and php-mysql packages.
|
# This class installs php.
|
||||||
#
|
#
|
||||||
# Parameters:
|
# Parameters:
|
||||||
#
|
#
|
||||||
|
@ -15,17 +15,6 @@
|
||||||
class php {
|
class php {
|
||||||
|
|
||||||
package { 'php':
|
package { 'php':
|
||||||
ensure => installed,
|
ensure => installed
|
||||||
require => Package["${apache::apache}"]
|
|
||||||
}
|
|
||||||
|
|
||||||
package { 'php-mysql':
|
|
||||||
ensure => installed,
|
|
||||||
require => Package['mysql-server']
|
|
||||||
}
|
|
||||||
|
|
||||||
package { 'php-pgsql':
|
|
||||||
ensure => installed,
|
|
||||||
require => Package['postgresql-server']
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
# Class: wget
|
||||||
|
#
|
||||||
|
# This class installs wget.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
#
|
||||||
|
# Actions:
|
||||||
|
#
|
||||||
|
# Requires:
|
||||||
|
#
|
||||||
|
# Sample Usage:
|
||||||
|
#
|
||||||
|
# include wget
|
||||||
|
#
|
||||||
|
class wget {
|
||||||
|
|
||||||
|
package { 'wget':
|
||||||
|
ensure => installed,
|
||||||
|
}
|
||||||
|
}
|
25
README.md
25
README.md
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
1. [Vagrant - Virtual development environment](#vagrant)
|
1. [Vagrant - Virtual development environment](#vagrant)
|
||||||
|
|
||||||
### Vagrant
|
## Vagrant
|
||||||
|
|
||||||
The Icinga 2 Web project ships with a Vagrant virtual machine that integrates
|
The Icinga 2 Web project ships with a Vagrant virtual machine that integrates
|
||||||
the source code with various services and example data in a controlled
|
the source code with various services and example data in a controlled
|
||||||
|
@ -16,7 +16,7 @@ have to do is install Vagrant and run:
|
||||||
|
|
||||||
After you should be able to browse [localhost:8080/icinga2-web](http://localhost:8080/icinga2-web).
|
After you should be able to browse [localhost:8080/icinga2-web](http://localhost:8080/icinga2-web).
|
||||||
|
|
||||||
#### Environment
|
### Environment
|
||||||
|
|
||||||
**Forwarded ports**:
|
**Forwarded ports**:
|
||||||
|
|
||||||
|
@ -40,8 +40,8 @@ After you should be able to browse [localhost:8080/icinga2-web](http://localhost
|
||||||
|
|
||||||
**Installed packages**:
|
**Installed packages**:
|
||||||
|
|
||||||
* Apache2 with PHP library
|
* Apache2 with PHP enabled
|
||||||
* PHP with MySQL libray
|
* PHP with MySQL and PostgreSQL libraries
|
||||||
* MySQL server and client software
|
* MySQL server and client software
|
||||||
* PostgreSQL server and client software
|
* PostgreSQL server and client software
|
||||||
* [Icinga prerequisites](http://docs.icinga.org/latest/en/quickstart-idoutils.html#installpackages)
|
* [Icinga prerequisites](http://docs.icinga.org/latest/en/quickstart-idoutils.html#installpackages)
|
||||||
|
@ -51,16 +51,17 @@ After you should be able to browse [localhost:8080/icinga2-web](http://localhost
|
||||||
* User icinga with group icinga and icinga-cmd
|
* User icinga with group icinga and icinga-cmd
|
||||||
* Webserver user added to group icinga-cmd
|
* Webserver user added to group icinga-cmd
|
||||||
|
|
||||||
**Installed files**:
|
|
||||||
|
|
||||||
* `/usr/share/icinga/htpasswd.users` account information for logging into the Icinga classic web interface for both instances
|
|
||||||
|
|
||||||
**Installed software**:
|
**Installed software**:
|
||||||
|
|
||||||
* Icinga 1.9.1 with IDOUtils using a MySQL database
|
* Icinga 1.9.1 with IDOUtils using a MySQL database
|
||||||
* Icinga 1.9.1 with IDOUtils using a PostgreSQL database
|
* Icinga 1.9.1 with IDOUtils using a PostgreSQL database
|
||||||
|
|
||||||
##### Icinga with IDOUtils using a MySQL database
|
**Installed files**:
|
||||||
|
|
||||||
|
* `/usr/share/icinga/htpasswd.users` account information for logging into the Icinga classic web interface for both icinga instances
|
||||||
|
* `/usr/lib64/nagios/plugins` Nagios Plugins 1.4.16 for both icinga instances
|
||||||
|
|
||||||
|
#### Icinga with IDOUtils using a MySQL database
|
||||||
|
|
||||||
**Installation path**: `/usr/local/icinga-mysql`
|
**Installation path**: `/usr/local/icinga-mysql`
|
||||||
|
|
||||||
|
@ -74,9 +75,9 @@ Connect to the **icinga mysql database** using the following command:
|
||||||
mysql -u icinga -p icinga icinga
|
mysql -u icinga -p icinga icinga
|
||||||
|
|
||||||
Access the **Classic UI** (CGIs) via [localhost:8080/icinga-mysql](http://localhost:8080/icinga-mysql).
|
Access the **Classic UI** (CGIs) via [localhost:8080/icinga-mysql](http://localhost:8080/icinga-mysql).
|
||||||
For logging into the Icinga classic web interface use user *icingaadmin* with password *icinga*.
|
For **logging into** the Icinga classic web interface use user *icingaadmin* with password *icinga*.
|
||||||
|
|
||||||
##### Icinga with IDOUtils using a PostgreSQL database
|
#### Icinga with IDOUtils using a PostgreSQL database
|
||||||
|
|
||||||
**Installation path**: `/usr/local/icinga-pgsql`
|
**Installation path**: `/usr/local/icinga-pgsql`
|
||||||
|
|
||||||
|
@ -90,4 +91,4 @@ Connect to the **icinga mysql database** using the following command:
|
||||||
sudo -u postgres psql -U icinga -d icinga
|
sudo -u postgres psql -U icinga -d icinga
|
||||||
|
|
||||||
Access the **Classic UI** (CGIs) via [localhost:8080/icinga-pgsql](http://localhost:8080/icinga-pgsql).
|
Access the **Classic UI** (CGIs) via [localhost:8080/icinga-pgsql](http://localhost:8080/icinga-pgsql).
|
||||||
For logging into the Icinga classic web interface use user *icingaadmin* with password *icinga*.
|
For **logging into** the Icinga classic web interface use user *icingaadmin* with password *icinga*.
|
||||||
|
|
Loading…
Reference in New Issue