A lightweight and extensible web interface to keep an eye on your environment. Analyse problems and act on them.
Go to file
Eric Lippmann 6eefa2bacb Use require_once instead of require in ConfigTest
refs #4354
2013-07-12 15:52:35 +02:00
.vagrant-puppet Vargant: Dat motd 2013-06-28 16:13:44 +02:00
application Adapt usage of config class 2013-07-12 15:43:23 +02:00
bin phpDocumentator: Add runner to create apidocs 2013-07-10 13:51:35 +02:00
config Adapt usage of config class 2013-07-12 15:43:23 +02:00
doc Remove magic retrieval of configuration files 2013-07-12 15:41:35 +02:00
etc Add Autoconf based installation with most parameters 2013-07-03 14:07:54 +02:00
library Enable registerMenuEntries for modules since this works now 2013-07-12 15:44:55 +02:00
modules/monitoring Adapt usage of config class 2013-07-12 15:43:23 +02:00
public Adapt usage of config class 2013-07-12 15:43:23 +02:00
test Use require_once instead of require in ConfigTest 2013-07-12 15:52:35 +02:00
.gitignore Add phpDocumentator to project 2013-07-10 13:51:35 +02:00
COPYING License writer 2013-07-03 14:17:48 +02:00
Makefile.in Add modules to install web files 2013-07-08 16:08:15 +02:00
README.md Vagrant: Add Icinga 2 2013-06-11 12:37:37 +02:00
Vagrantfile Adapt usage of config class 2013-07-12 15:43:23 +02:00
aclocal.m4 Add Autoconf based installation with most parameters 2013-07-03 14:05:59 +02:00
configure Add Autoconf based installation with most parameters 2013-07-03 14:05:59 +02:00
configure.ac Add Autoconf based installation with most parameters 2013-07-03 14:07:54 +02:00
install-sh Add local install-sh 2013-07-03 14:07:55 +02:00

README.md

Icinga 2 Web

Table of Contents

  1. Vagrant - Virtual development environment

Vagrant

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 environment. This enables developers and users to test Livestatus, status.dat, MySQL and PostgreSQL backends as well as the LDAP authentication. All you have to do is install Vagrant and run:

vagrant up

Note that the first boot of the vm takes a fairly long time because you'll download a plain CentOS base box and Vagrant will automatically provision the environment on the first go.

After you should be able to browse localhost:8080/icinga2-web.

Environment

Forwarded ports:

Proctocol Local port (virtual machine host) Remote port (the virtual machine)
SSH 2222 22
HTTP 8080 80

Installed packages:

  • Apache2 with PHP enabled
  • PHP with MySQL and PostgreSQL libraries
  • MySQL server and client software
  • PostgreSQL server and client software
  • Icinga prerequisites

Installed users and groups:

  • User icinga with group icinga and icinga-cmd
  • Webserver user added to group icinga-cmd

Installed software:

  • Icinga 1.9.1 with IDOUtils using a MySQL database
  • Icinga 1.9.1 with IDOUtils using a PostgreSQL database
  • Icinga 2 version 0.0.1

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

Services:

  • icinga-mysql
  • ido2db-mysql

Connect to the icinga mysql database using the following command:

mysql -u icinga -p icinga icinga

Access the Classic UI (CGIs) via localhost:8080/icinga-mysql. For logging into the Icinga classic web interface use user icingaadmin with password icinga.

Icinga with IDOUtils using a PostgreSQL database

Installation path: /usr/local/icinga-pgsql

Services:

  • icinga-pgsql
  • ido2db-pgsql

Connect to the icinga mysql database using the following command:

sudo -u postgres psql -U icinga -d icinga

Access the Classic UI (CGIs) via localhost:8080/icinga-pgsql. For logging into the Icinga classic web interface use user icingaadmin with password icinga.

MK Livestatus

MK Livestatus is added to the Icinga installation using a MySQL database.

Installation path:

  • /usr/local/icinga-mysql/bin/unixcat
  • /usr/local/icinga-mysql/lib/mk-livestatus/livecheck
  • /usr/local/icinga-mysql/lib/mk-livestatus/livestatus.o
  • /usr/local/icinga-mysql/etc/modules/mk-livestatus.cfg
  • /usr/local/icinga-mysql/var/rw/live

Example usage:

echo "GET hosts" | /usr/local/icinga-mysql/bin/unixcat /usr/local/icinga-mysql/var/rw/live

LDAP example data

The environment includes a openldap server with example data. Domain suffix is dc=icinga,dc=org. Administrator (rootDN) of the slapd configuration database is cn=admin,cn=config and the administrator (rootDN) of our database instance is cn=admin,dc=icinga,dc=org. Both share the password admin.

Examples to query the slapd configuration database:

ldapsearch -x -W -LLL -D cn=admin,cn=config -b cn=config dn
ldapsearch -Y EXTERNAL -H ldapi:/// -LLL -b cn=config dn

Examples to query our database instance:

ldapsearch -x -W -LLL -D cn=admin,dc=icinga,dc=org -b dc=icinga,dc=org dn
ldapsearch -Y EXTERNAL -H ldapi:/// -LLL -b dc=icinga,dc=org dn

This is what the dc=icinga,dc=org DIT looks like:

dn: dc=icinga,dc=org

dn: ou=people,dc=icinga,dc=org

dn: ou=groups,dc=icinga,dc=org

dn: cn=Users,ou=groups,dc=icinga,dc=org cn: Users uniqueMember: cn=Jon Doe,ou=people,dc=icinga,dc=org uniqueMember: cn=Jane Smith,ou=people,dc=icinga,dc=org uniqueMember: cn=John Q. Public,ou=people,dc=icinga,dc=org uniqueMember: cn=Richard Roe,ou=people,dc=icinga,dc=org

dn: cn=John Doe,ou=people,dc=icinga,dc=org cn: John Doe uid: jdoe

dn: cn=Jane Smith,ou=people,dc=icinga,dc=org cn: Jane Smith uid: jsmith

dn: cn=John Q. Public,ou=people,dc=icinga,dc=org cn: John Q. Public uid: jqpublic

dn: cn=Richard Roe,ou=people,dc=icinga,dc=org cn: Richard Roe uid: rroe

All users share the password password.

Testing the code

All software required to run tests is installed in the virtual machine. In order to run all tests you have to execute the following commands:

vagrant ssh -c /vagrant/test/php/runtests
vagrant ssh -c /vagrant/test/php/checkswag
vagrant ssh -c /vagrant/test/js/runtests
vagrant ssh -c /vagrant/test/js/checkswag
vagrant ssh -c /vagrant/test/frontend/runtests

runtests will execute unit and regression tests and checkswag will report code style issues.

Icinga 2

Installation path: /usr/local/icinga2

Example usage:

cd /usr/local/icinga2
./sbin/icinga2 -c etc/icinga2/icinga2.conf.dist