Icinga Web as package on SUSE
-----------------------------

NOTE: Keep in mind to read the Changelog!
      /usr/share/doc/icinga-web-<version>/

For detailed information on

* how to build a package with provided icinga-web.spec
* how to proceed with setup after package install
    - setup the icinga_web database
    - configure the backend for IDOUtils and internal Web DB

Please checkout the official docs for a more detailed introduction

https://docs.icinga.com
https://docs.icinga.com/latest/en/icinga-web-introduction.html

Requirements
~~~~~~~~~~~~

* Icinga
* Icinga IDOUtils (providing database 'icinga')
* MySQL or Postgresql (for the 'icinga_web' database storing user credentials, sessions, etc)


Installation
~~~~~~~~~~~~

# zypper install <packagename>

* icinga-web - main package
* icinga-web-{mysql,pgsql} - database config for 'icinga_web' database
* icinga-web-module-pnp - pnp integration templates

Database Setup
~~~~~~~~~~~~~~

* Create the database, user and permissions.

# mysql -u root -p

mysql> 	CREATE DATABASE icinga_web;

	GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga_web.* TO 'icinga_web'@'localhost' IDENTIFIED BY 'icinga_web';

        quit

* Import the Icinga Web schema

# mysql -u root -p icinga_web <  /usr/share/doc/icinga-web-<version>/schema/mysql.sql

Web Interface
~~~~~~~~~~~~~

After installing the package, Icinga Web will be available at

http://localhost/icinga-web
User: root
Password: password

You can edit or add users from the admin panel then. Check the icinga
docs for some details on that.
http://docs.icinga.org/latest/en/icinga-web-introduction.html

Configuration
~~~~~~~~~~~~~

Configuration is stored within *.xml files in /etc/icinga-web/conf.d
After editing the config, clearing the cache is required running

# /usr/bin/icinga-web-clearcache

If you've chosen different database usernames/passwords please edit
/etc/icinga-web/conf.d/databases.xml in the 'icinga web' and 'icinga
idoutils' sections. 

Check the documentation for more details
http://docs.icinga.org/latest/en/icinga-web-config.html

Configuration for Icinga 2
~~~~~~~~~~~~~~~~~~~~~~~~~~

Icinga Web 1.x targets a default Icinga Core & IDOUtils installation. You will
need to adjust certain configuration parameters in order to point them to Icinga 2's
locations.

* IDO DB Backend

Only if the default credentials have been changed during the setup.

# vim /etc/icinga-web/conf.d/databases.xml

* External Command Pipe

# vim /etc/icinga-web/access.xml

            <write>
                <files>
                    <resource name="icinga_pipe">/var/run/icinga2/cmd/icinga.cmd</resource>
                </files>
            </write>

# icinga-web-clearcache

Logs & Errors
~~~~~~~~~~~~~

Icinga Web logs are stored in /var/log/icinga-web
Common errors may also be within apache logs.

Your browsers developer tools & console may help too.

File Locations
~~~~~~~~~~~~~~

| /etc/icinga-web/conf.d 		| xml configuration
| /usr/share/icinga-web 		| data root dir (where the php, js will live)
| /etc/apache2/conf.d/icinga-web.conf 	| apache config
| /var/log/icinga-web 			| contains all log files
| /var/cache/icinga-web 		| config cache files (cleared with icinga-web-clearcache)

The icinga package places the external command pipe into '/var/icinga/rw/icinga.cmd'
which will be the default location in the access.xml configuration file.

