Giter Club home page Giter Club logo

puppet-icingaweb2's Introduction

Build Status

Icinga Web 2 Puppet Module

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with Icinga Web 2
  4. Usage - Configuration options and additional functionality
  5. Reference
  6. Development - Guide for contributing to the module

Overview

Icinga Web 2 is the associated web interface for the open source monitoring tool Icinga 2. This module helps with installing and managing configuration of Icinga Web 2 and its modules on multiple operating systems.

Description

This module installs and configures Icinga Web 2 on your Linux host by using the official packages from packages.icinga.com. Dependend packages are installed as they are defined in the Icinga Web 2 package.

This module can manage all configurations files of Icinga Web 2 and import an initial database schema. It can install and manage all official modules as well as modules developed by the community.

What's new in version 4.0.0

NOTICE: With this release come some breaking changes, please also read the CHANGELOG and test this new version with your manifests beforehand.

The puppet module icinga is required. Some functions, data types and defined resources of this module are now used. Depends on #380.

The additional services for the Director, reporting and x509 module are not optinal anymore. The service classes are private now and cannot declared individually. However, in order to still manage the service new parameters manage_service, service_ensure and service_enable are added. See #281 and #379.

Support of INI files as configuration backend for user preferences is dropped. The parameter config_backend also dropped because the only supported backend by Icinga Web is db since v2.11.0.

We switched the default logging to syslog. Done in #376.

All parameters db_type must be set now (#373), e.g. for icingaweb2, icingaweb2::module::monitoring and all other modules that require a database.

The default location of all private keys and certificates for authentication or validation has changed to /var/lib/icingaweb2/<module name>/. For more details #380.

Support of earlier version of Icinga Web as v2.9.0 is dropped. So we also removed the module classes of ipl, reactbundle and incubator. If you use Icinga Web modules installed from git that require the incubator, please use icingaweb2::extra_packages to install the official package icinga-php-incubator.

For more flexibility, we have added a parameter db_resource_name for an individual name for the automatically maintained Icinga Web resources, e.g. the database resources for the Icinga Web backend, the Director database and so on. As a result, the default names have also changed.

What's new in version 3.9.1

The Icinga team removed package icingaweb2-module-monitoring (only on Debian/Ubuntu) for Icinga Web 2 >= 2.12.0. For now we add an parameter manage_package (set to true bye default) to do not managed the missing transition package.

Setup

What the Icinga 2 Puppet module supports

  • Installation of Icinga Web 2 via packages
  • Configuration
  • MySQL / PostgreSQL database schema import
  • Install and manage official Icinga Web 2 modules
  • Install community modules

Dependencies

This module depends on

Limitations

This module has been tested on:

Other operating systems or versions may work but have not been tested.

Usage

NOTE: If you plan to use additional modules from git, the CLI git command has to be installed. You can manage it yourself as package resource or declare the package name in extra_packages.

By default, your distribution's packages are used to install Icinga Web 2.

Use the manage_repos parameter to configure repositories by default the official and stable packages.icinga.com. To configure your own repositories, or use the official testing or nightly snapshot stage, see https://github.com/icinga/puppet-icinga.

class { '::icingaweb2':
  manage_repos => true,
}

The usage of this module isn't simple. That depends on how Icinga Web 2 is implemented. Monitoring is here just a module in a framework. All basic stuff like authentication, logging or authorization is done by this framework. To store user and usergroups in a MySQL database, the database has to exist:

mysql::db { 'icingaweb2':
  user     => 'icingaweb2',
  password => 'supersecret',
  host     => 'localhost',
  grant    => [ 'ALL' ],
}

class { 'icingaweb2':
  manage_repos   => true,
  import_schema  => true,
  db_type        => 'mysql',
  db_host        => 'localhost',
  db_port        => 3306,
  db_username    => 'icingaweb2',
  db_password    => 'supersecret',
  extra_packages => [ 'git' ],
  require        => Mysql::Db['icingaweb2'],
}

If you set import_schema to true an default admin user icingaadmin with password icinga will be created automatically and you're allowed to login.

In case that import_schema is disabled or you'd like to use a different backend for authorization like LDAP, more work is required. At first we need a ressource with credentials to connect a LDAP server:

class {'icingaweb2':
  manage_repos   => true,
}

icingaweb2::resource::ldap { 'my-ldap':
  type    => 'ldap',
  host    => 'localhost',
  port    => 389,
  root_dn => 'ou=users,dc=icinga,dc=com',
  bind_dn => 'cn=icingaweb2,ou=users,dc=icinga,dc=com',
  bind_pw => 'supersecret',
}

With the help of this resource, we are now creating user and group backends. Users are permitted to login and users and groups will later be used for authorization.

icingaweb2::config::authmethod { 'ldap-auth':
  backend                  => 'ldap',
  resource                 => 'my-ldap',
  ldap_user_class          => 'user',
  ldap_filter              => '(memberof:1.2.840.113556.1.4.1941:=CN=monitoring,OU=groups,DC=icinga,DC=com)',
  ldap_user_name_attribute => 'cn',
  order                    => '05',
}

icingaweb2::config::groupbackend { 'ldap-groups':
  backend                     => 'ldap',
  resource                    => 'my-ldap',
  ldap_group_class            => 'group',
  ldap_group_name_attribute   => 'cn',
  ldap_group_member_attribute => 'member',
  ldap_base_dn                => 'ou=groups,dc=icinga,dc=com',
  domain                      => 'icinga.com',
}

A role must be managed for a group to receive admin rights:

icingaweb2::config::role { 'default admin user':
  groups      => 'icingaadmins',
  permissions => '*',
  parent      => 'default protection',
}

But the values of some custom variables are not displayed via inheritance:

icingaweb2::config::role { 'default protection':
  filters => {
    'icingadb/protect/variables' => '*pw*, *pass*, community',
  }
}

All available permissions for module icingadb are listed here.

Finally we configure the icingadb with the needed connection to the database and the redis server and an API user to send commands to Icinga 2:

class {'icingaweb2::module::icingadb':
  db_type     => 'mysql',
  db_host     => 'db.icinga.com',
  db_port     => 1800,
  db_name     => 'icinga2',
  db_username => 'icinga2',
  db_password => Sensitive('supersecret'),
  redis_host  => 'localhost',
  commandtransports => {
    icinga2 => {
      transport => 'api',
      username  => 'icingaweb2',
      password  => Sensitive('supersecret'),
    }
  },
}

Reference

See REFERENCE.md

Development

A roadmap of this project is located at https://github.com/Icinga/puppet-icingaweb2/milestones. Please consider this roadmap when you start contributing to the project.

Contributing

When contributing several steps such as pull requests and proper testing implementations are required. Find a detailed step by step guide in CONTRIBUTING.md.

Testing

Testing is essential in our workflow to ensure a good quality. We use RSpec as well as Serverspec to test all components of this module. For a detailed description see TESTING.md.

Release Notes

When releasing new versions we refer to [SemVer 1.0.0] for version numbers. All steps required when creating a new release are described in RELEASE.md

See also CHANGELOG.md

Authors

AUTHORS is generated on each release.

puppet-icingaweb2's People

Contributors

arioch avatar baurmatt avatar benjamink avatar bobapple avatar carraroj avatar dhoppe avatar invlid avatar jhoblitt avatar joernott avatar johanfleury avatar lazyfrosch avatar lbetz avatar n00by avatar ngoduykhanh avatar noqqe avatar olasd avatar petems avatar quixoten avatar rgevaert avatar rick-pri avatar rincewindshat avatar rubueno avatar rwaffen avatar saz avatar smbambling avatar tdb avatar timogoebel avatar visibilityspots avatar ziaunys avatar zilchms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-icingaweb2's Issues

Create parameter manage_package

Add a parameter manage_package that defaults to true. This is a global parameter where the user can decide if the module should install all packages or if he wants to handle it by himself. Same behaviour as in the Icinga 2 module.

Following parameters can be removed when this is implemented:

  • pgk_deps
  • pkg_ensure
  • pkg_list

General configuration

The class icingaweb2::config should handle general configurations only. Since we’re supporting package installations only and we’re not handling web server installation and configuration, we can omit the ability to set config_dir_purge and web_root. We also should not handle files or directories created by the package.

We should discuss if we want to set PHP settings (Date/Time) in this class.

Resources.ini should not be world-readable

resources.ini contains DB-Passwords and should not be world-readable:

root@mil:/etc# ls -al /etc/icingaweb2/resources.ini 
-rw-r--r-- 1 icingaweb2 icingaweb2 313 Feb 25 01:15 /etc/icingaweb2/resources.ini

Documentation updates

  • More examples
  • Requirements
    • CentOS 6/7 needs EPEL
  • Testing
  • Contributing
  • Limitations
    • Support OS

Ensure support for certain operating systems

Ensure we fully support the installation of Icinga Web 2 via packages.icinga.com for the following operating systems:

  • Debian 7,8
  • Ubuntu 14.04, 16.04
  • RHEL 6,7
  • SLES 12

Add supported operating systems and versions to the README.md and metadata.json. Other versions may follow later.

Add some basic examples

The examples directory should contain some basic examples on how this module can be used.

[dev.icinga.com #11584] what is the standard password set by initialize.pp?

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11584

Created by rwaffen on 2016-04-13 16:44:26 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-04-14 11:16:45 +00:00 (in Redmine)


i'm using the puppet module and asking myself, what would be the standard password after "initialization"?

there is no docu about that, only an encrypted password in "puppet-icingaweb2/manifests/initialize.pp".

Remove deprecated parameters

Following parameters are deprecated and can be removed:

  • pkg_repo_version
  • pkg_repo_release_key
  • pkg_repo_release_url
  • pkg_repo_snapshot_key
  • pkg_repo_snapshot_url

Please remove also other deprecated parameters that you may find.

The parameter 'ido_db_host' is declared more than once

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: The parameter 'ido_db_host' is declared more than once in the parameter list at /etc/puppetlabs/code/environments/production/modules/icingaweb2/manifests/init.pp:181:3 on node client1.XXX.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run

Update general documentation

  • Add section “Overview”
  • Add section “Module Description”
  • Add section “What the Icinga Web 2 Puppet module supports”
  • Add section “Dependencies”
  • Add section “Limitations”
  • Update section “Usage”

[dev.icinga.com #11507] installing icinga web2

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11507

Created by kyle_zeng on 2016-04-01 20:33:05 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-04-01 20:33:05 +00:00 (in Redmine)


Hi, I have encountered following problem when I`m trying to install Icinga web2:

 install icinga2 and mySQL
 install epel
 install icinagweb2 and icinga-cli, at this step, when running :yum install icingaweb2 icingacli

it pops out this error:

>Error: Package: php-pecl-imagick-2.2.2-5.el6.x86_64 (epel)
> Requires: libMagickWand.so.5()(64bit)
>Error: Package: php-pecl-imagick-2.2.2-5.el6.x86_64 (epel)
> Requires: libMagickCore.so.5()(64bit)

and I have tried to install php-imagick but did not solve the problem, and my system is :RHEL6

Could you help me?

Remove git installation method for Icinga Web 2

We drop support for installing Icinga Web 2 via a git repository. Installation method is always packages.icinga.com. This does not apply to modules.

Remove related parameters install_method, git_repo and git_revision and others that I forgot to mention.

[dev.icinga.com #11719] Missing packages if APT::Install-Recommends "false";

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11719

Created by plarivee on 2016-05-03 14:07:15 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-05-03 14:07:15 +00:00 (in Redmine)


If a system is setup with "APT::Install-Recommends "false";" some packages will not be installed. The module will only install

ii  icingaweb2                          2.3.2-1~ppa2                     all          simple and responsive web interface for Icinga
ii  icingaweb2-common                   2.3.2-1~ppa2                     all          simple and responsive web interface for Icinga - common files
ii  php-icinga                          2.3.2-1~ppa2                     all          PHP library to communicate with and use Icinga

On a system without the option set to false we get :

root@web:~\# dpkg -l | grep icinga
ii icingacli 2.3.2-1~ppa2 all simple CLI tool for Icingaweb2 and its modules
ii icingaweb2 2.3.2-1~ppa2 all simple and responsive web interface for Icinga
ii icingaweb2-common 2.3.2-1~ppa2 all simple and responsive web interface for Icinga - common files
ii icingaweb2-module-doc 2.3.2-1~ppa2 all simple and responsive web interface for Icinga - documentation module
ii icingaweb2-module-monitoring 2.3.2-1~ppa2 all simple and responsive web interface for Icinga - monitoring module
ii php-icinga 2.3.2-1~ppa2 all PHP library to communicate with and use Icinga

So the monitoring module package is missing, doc module and also icingacli.

We need to find a way to make sure those are installed if an Icingaweb2 module is dependent of it.

Ubuntu 14.04.4

Roles setting is not up to date and is not supporting businessprocess-prefix

The options provided by icingaweb2::config::roles are not up to date for filtering monitoring objects (should be "monitoring/filter/objects") and does not support:

  • "application/share/users" and" application/share/groups" for sharing items with users from core
  • "monitoring/blacklist/properties" to exclude customvars from monitoring module
  • "businessprocess/prefix" from the businessprocess module

Add defined type that handles Ini configurations

This type should be capable of generally creating ini configuration files based on a configurable target. It should be able to add and remove ini configuration sections and associated settings. External configuration changes should not be touched, so the user is able to still create configs via the Icinga Web 2 interface.

Deprecate default install method

When install_method is not set explicitly, the next version of the module should but a failure (or warning)

So we bring users to move to package, and take it as default in a 2.x

Could not find declared class icingaweb2::mod::monitoring

Hello,

this is from your example:
`

default is local

class { '::icingaweb2::mod::monitoring':
transport => 'local',
transport_path => '/run/icinga2/cmd/icinga2.cmd',
}`

this happens when running:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not find declared class icingaweb2::mod::monitoring at /etc/puppetlabs/code/environments/production/modules/icinga2server/manifests/init.pp:64:3 on node clie

I can confirm .. ;)

bla@woody $ ll
total 24
drwxr-xr-x 2 bla bla 4096 Mär 9 15:52 ./
drwxr-xr-x 5 bla bla 4096 Mär 9 16:15 ../
-r--r--r-- 1 bla bla 1177 Apr 23 2015 businessprocess.pp
-r--r--r-- 1 bla bla 1479 Mai 7 2015 deployment.pp
-r--r--r-- 1 bla bla 1846 Apr 23 2015 graphite.pp
-r--r--r-- 1 bla bla 1629 Apr 27 2015 nagvis.pp
.../modules/icingaweb2/manifests/mod
bla@woody $

best regards

Add reference documentation

Add a reference documentation for each class and defined type. Also, add a separate TOC for the reference documentation.

Improve Apache integration and document it

Currently a user needs to add Apache and some modules in order for Icingaweb2 to work.

  • Moving Apache to an extra class File conflicts with Apaches files...
  • Add rewrite and php
  • Add documentation how to configure Apache to work with PHP mpm_worker => prefork
  • Document timezone setting for PHP

Basic Apache configuration with example

We’re not managing Apache configuration, but provide only the configuration so the user can use it. Add a sample configuration for Apache and provide a basic example in the “Usage” section of the README.md. If necessary, add an extended example in the examples directory.

Acceptance tests

Add at least some basic tests, so we have a test environment

  • Code & Specs
  • Add more test environments
  • Test in Travis with docker?
  • Document for manual testing in TESTING.md

[dev.icinga.com #11876] Path for mysql-command is missing

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11876

Created by pgress on 2016-06-01 13:37:49 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-06-01 13:37:49 +00:00 (in Redmine)


Hey,

tried to initialize the db via the icingaweb2-puppet-module. Got the following error:

Error: Failed to apply catalog: Validation of Exec[create web user] failed: 'mysql -h localhost -uuser -ppassword icingaweb_db -e " INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '\$1\$EzxLOFDr\$giVx3bGhVm4lDUAw6srGX1');"' is not qualified and no path was specified. Please qualify the command or specify a path. at /etc/puppet/environments/development/modules/icingaweb2/manifests/initialize.pp:51
Wrapped exception:
'mysql -h localhost -uuser -ppassword icingaweb_db -e " INSERT INTO icingaweb_user (name, active, password_hash) VALUES ('icingaadmin', 1, '\$1\$EzxLOFDr\$giVx3bGhVm4lDUAw6srGX1');"' is not qualified and no path was specified. Please qualify the command or specify a path.

I used Debian 8 in this case (so /usr/bin/ in front of mysql worked pretty good)

Greetings

[dev.icinga.com #12142] Why does initialize.pp require /root/.my.cnf on RedHat/CentOS, not Debian/Ubuntu?

This issue has been migrated from Redmine: https://dev.icinga.com/issues/12142

Created by westbywest on 2016-07-12 17:46:51 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2016-07-12 17:46:51 +00:00 (in Redmine)


I noticed these recent commits altering initialize.pp to support a remote MySQL host under Debian/Ubuntu:
475e0c9
41c46bd

However, the clause for RedHat/CentOS still references the file /root/.my.cnf, meaning a remote MySQL host would only be possible by inserting references to it into /root/.my.cnf prior to invoking icingaweb2 module.

Is there a reason for this difference between RedHat and Debian?

How to enable module monitoring Via Puppet

Hello, I have installed Icingaweb2 on Ubuntu 16.04 via Puppet. (using Hiera) For some reason module monitoring is not enabled by default (shouldn't it be?). Please help, whatever i try, puppet simply doesn't apply anything. I have fixed file permissions, and still nothing. I have tried something like this:

icingaweb2::mod::monitoring::transport: 'local'
icingaweb2::mod::monitoring::transport_path: '/run/icinga2/cmd/icinga2.cmd'

Update basic specs

Depending on changes during the “2.0 Installation Basics” Project, update the rspec tests.

missing groups.ini

Hi,
I'm missing the configuration for the groups.ini.
If using groups for authentication with ldap:

roles.ini:
[admin-group]
groups = "admin-group"
permissions = ""
monitoring/hosts/filter = "
"

there has to be a group.ini like:
[icinga_ldap]
user_backend = icingaweb2
backend = msldap
resource = ldap

Maybe I'm wrong? But if not, is it possible to implement this in this puppet-module.

Thanks

[dev.icinga.com #9243] add ldaps to resource_ldap.pp

This issue has been migrated from Redmine: https://dev.icinga.com/issues/9243

Created by crpeck on 2015-05-07 16:16:19 +00:00

Assignee: (none)
Status: New
Target Version: (none)
Last Update: 2015-05-07 16:16:19 +00:00 (in Redmine)


Could the file manifests/config/resource_ldap.pp please be extended to include these 2 options:
encryption => ldaps or ldap (default is ldap)
reqcert => true or false (default is true) as to if it checks for a valid cert on ldap bind

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.