Merge branch 'develop', version 0.2
This commit is contained in:
commit
86df485369
3 changed files with 109 additions and 3 deletions
91
README.md
91
README.md
|
@ -1,4 +1,93 @@
|
|||
#puppet-icinga2
|
||||
- - -
|
||||
|
||||
This module installs and configures the Icinga 2 monitoring system.
|
||||
This module installs and configures the [Icinga 2 monitoring system](https://www.icinga.org/icinga2/). It can also install and configure [NRPE](http://exchange.nagios.org/directory/Addons/Monitoring-Agents/NRPE--2D-Nagios-Remote-Plugin-Executor/details) on client systems that are being monitored by an Icinga 2 server.
|
||||
|
||||
The module has only been tested on [CentOS 6.5](http://www.centos.org/download/) and Ubuntu [12.04](http://releases.ubuntu.com/12.04/) and [14.04](http://releases.ubuntu.com/14.04/). Red Hat and other EL derivatives, like Fedora, should work, but have not been tested.
|
||||
|
||||
Currently, this module does not install or configure any web UIs for Icinga 2. This module also does not install or configure a mail transfer agent (MTA) to send outgoing alert emails.
|
||||
|
||||
While NRPE is required for Icinga 2 to check non-network-reachble things on client machines (CPU, load average, etc.), this module itself doesn't have any dependencies between the server component (the `icinga2::server` class) and client component (the `icinga2::client` class). Either one can be used independently of the other.
|
||||
|
||||
###Requirements
|
||||
|
||||
For Ubuntu systems, this module requires the [Puppet Labs apt module](https://github.com/puppetlabs/puppetlabs-apt).
|
||||
|
||||
On EL-based systems (CentOS, Red Hat Enterprise Linux, Fedora, etc.), the [EPEL package repository](https://fedoraproject.org/wiki/EPEL) is required.
|
||||
|
||||
####Server requirements
|
||||
|
||||
Icinga 2 requires either a [MySQL](http://www.mysql.com/) or a [Postgres](http://www.postgresql.org/) database.
|
||||
|
||||
Currently, this module does not set up any databases. You'll have to create one before installing Icinga 2 via the module.
|
||||
|
||||
If you would like to set up your own database, either of the Puppet Labs [MySQL](https://github.com/puppetlabs/puppetlabs-mysql) or [Postgres](https://github.com/puppetlabs/puppetlabs-postgresql) modules can be used.
|
||||
|
||||
Database connection parameters can be specified by the `db_host`, `db_port`, `db_name`, `db_user` and `db_password` parameters.
|
||||
|
||||
The example below shows the [Puppet Labs Postgres module](https://github.com/puppetlabs/puppetlabs-postgresql) being used to install Postgres and create a database and database user for Icinga 2:
|
||||
|
||||
<pre>
|
||||
class { 'postgresql::server': }
|
||||
|
||||
postgresql::server::db { 'icinga2_data':
|
||||
user => 'icinga2',
|
||||
password => postgresql_password('icinga2', 'password'),
|
||||
}
|
||||
</pre>
|
||||
|
||||
For production use, you'll probably want to get the database password via a [Hiera lookup](http://docs.puppetlabs.com/hiera/1/puppet.html) so the password isn't sitting in your site manifests in plain text.
|
||||
|
||||
To configure Icinga with the password you set up for the Postgres Icinga user, use the `server_db_password` parameter (shown here with a Hiera lookup):
|
||||
|
||||
<pre>
|
||||
class { 'icinga2::server':
|
||||
server_db_password => hiera('icinga_db_password_key_here')
|
||||
}
|
||||
</pre>
|
||||
|
||||
###Usage
|
||||
|
||||
####Server usage
|
||||
|
||||
To install Icinga 2 with a Postgres database, first set up the database.
|
||||
|
||||
Once the database is set up, use the `icinga2::server` class with the database connection parameters to specify
|
||||
|
||||
<pre>
|
||||
#Install Icinga 2:
|
||||
class { 'icinga2::server':
|
||||
server_db_type => 'pgsql',
|
||||
db_host => 'localhost'
|
||||
db_port => '5432'
|
||||
db_name => 'icinga2_data'
|
||||
db_user => 'icinga2'
|
||||
db_password => 'password',
|
||||
}
|
||||
</pre>
|
||||
|
||||
When the `server_db_type` parameter is set, the right IDO database connection packages are automatically installed and the schema is loaded.
|
||||
|
||||
**Note:** For production use, you'll probably want to get the database password via a [Hiera lookup](http://docs.puppetlabs.com/hiera/1/puppet.html) so the password isn't sitting in your site manifests in plain text:
|
||||
|
||||
<pre>
|
||||
#Install Icinga 2:
|
||||
class { 'icinga2::server':
|
||||
server_db_type => 'pgsql',
|
||||
db_host => 'localhost'
|
||||
db_port => '5432'
|
||||
db_name => 'icinga2_data'
|
||||
db_user => 'icinga2'
|
||||
db_password => hiera('icinga_db_password_key_here'),
|
||||
}
|
||||
</pre>
|
||||
|
||||
####Client usage
|
||||
|
||||
To install NRPE and allow the local machine and Icinga 2 servers (or Icinga 1 or plain old Nagios servers) with various IP addresess to connect:
|
||||
|
||||
<pre>
|
||||
class { 'icinga2::client':
|
||||
nrpe_allowed_hosts => ['10.0.1.79', '10.0.1.80', '10.0.1.85', '127.0.0.1'],
|
||||
}
|
||||
</pre>
|
|
@ -57,12 +57,23 @@ class icinga2::params {
|
|||
'RedHat', 'CentOS': {
|
||||
#Icinga 2 server package
|
||||
$icinga2_server_package = 'icinga2'
|
||||
$icinga2_server_plugin_packages = ["nagios-plugins-nrpe", "nagios-plugins-all", "nagios-plugins-openmanage", "nagios-plugins-check-updates"]
|
||||
}
|
||||
|
||||
#Debian/Ubuntu systems:
|
||||
/^(Debian|Ubuntu)$/: {
|
||||
#Icinga 2 server package
|
||||
$icinga2_server_package = 'icinga2'
|
||||
case $operatingsystemrelease {
|
||||
#Ubuntu 12.04 doesn't have nagios-plugins-common or nagios-plugins-contrib packages available...
|
||||
'12.04': {
|
||||
$icinga2_server_package = 'icinga2'
|
||||
$icinga2_server_plugin_packages = ["nagios-plugins", "nagios-plugins-basic", "nagios-plugins-standard", "nagios-snmp-plugins", "nagios-plugins-extra"]
|
||||
}
|
||||
#...but 14.04 does:
|
||||
'14.04': {
|
||||
$icinga2_server_package = 'icinga2'
|
||||
$icinga2_server_plugin_packages = ["nagios-plugins", "nagios-plugins-basic", "nagios-plugins-common", "nagios-plugins-standard", "nagios-snmp-plugins", "nagios-plugins-extra", "nagios-plugins-contrib"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#Fail if we're on any other OS:
|
||||
|
|
|
@ -75,6 +75,12 @@ class icinga2::server::install::packages inherits icinga2::server {
|
|||
provider => $package_provider,
|
||||
}
|
||||
|
||||
#Install the Nagios plugins packages:
|
||||
package {$icinga2_server_plugin_packages:
|
||||
ensure => installed,
|
||||
provider => $package_provider,
|
||||
}
|
||||
|
||||
#Pick the right DB lib package name based on the database type the user selected:
|
||||
case $server_db_type {
|
||||
#MySQL:
|
||||
|
|
Loading…
Reference in a new issue