SUSE Manager/Icinga

From MicroFocusInternationalWiki
Jump to: navigation, search

SUSE Manager Main Page

Icinga Quick Start on SLE12

Icinga packages are in the SUSE Manager Tools channel for SLE12. Install Icinga on a SLE client - not on the SUSE Manager server itself.

Here is a quickstart process to get icinga installed with the IDOUtils and running on postgres:

1. Add client and update channels, you need to be in the sles12 / sles12sp1 server

2. Install the necessary packages:

zypper in icinga icinga-idoutils-pgsql postgresql postgresql94-server monitoring-plugins-all apache2 apache2-example-pages

3. Edit the contacts.cfg config file with your favorite editor and change the email address associated with the icingaadmin contact definition to the address you'd like to use for receiving alerts.

vi /etc/icinga/objects/contacts.cfg

4. Set postgres to start on bootup and start the DB:

systemctl enable postgresql.service
systemctl start postgresql.service

5. Create database and User:

#su - postgres
 
 >psql
 postgres=# ALTER USER postgres WITH PASSWORD '<newpassword>';
 postgres=# CREATE USER icinga;
 postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 postgres=# CREATE DATABASE icinga;
 postgres=# GRANT ALL ON DATABASE icinga TO icinga;
 postgres=# \q
 exit

6. Modify the postgres config file - /var/lib/pgsql/data/pg_hba.conf - commenting out everything, and placing this at the bottom:

# database administrative login by UNIX sockets

#icinga
 local    icinga     icinga                    trust
 local    all        postgres                  ident
 # TYPE   DATABASE   USER       CIDR-ADDRESS   METHOD 
 
 # "local" is for Unix domain socket connections only
 local    all        all                       trust
 # IPv4 local connections
 host     all        all        127.0.0.1/32   trust
 # IPV6 local connections
 host     all        all        ::1/128        trust


Then reload the postgresql service:

systemctl reload postgresql.service

7. Configure the database schema:

cd /usr/share/doc/packages/icinga-idoutils-pgsql/pgsql/

psql -U icinga -d icinga < pgsql.sql

8. Edit the following lines in the DB config file to customize IDOUtils for postgres

 vi /etc/icinga/ido2db.cfg

 db_servertype=pgsql
 db_port=5432

8. Create an icingaadmin account for logging into the web interface:

htpasswd -c /etc/icinga/htpasswd.users icingaadmin

9. Enable and start the ido2db, icinga, and apache2 services:

systemctl enable icinga.service
systemctl start icinga.service
systemctl enable ido2db.service
systemctl start ido2db.service
systemctl enable apache2.service
systemctl start apache2.service

10. You should now be able to access the Icinga classic web interface at the URL below. You'll be prompted for the username ( icingaadmin ) and password you specified earlier.

http://localhost/icinga/

11. Note: In order to have the Postgresql service start _before_ the ido2db service on a server restart, make sure to edit the ido2db.service file.

Edit the "/etc/systemd/system/multi-user.target.wants/ido2db.service" file, and add postgresql.service to both the "After=" and "Wants=" lines in the [Unit] section.

For example :

 [Unit]
 Description=Icinga Data Out Utilities (IDOUtils)
 After=syslog.target network.target postgresql.service
 Wants=postgresql.service

When a different database than postgresql is used, replace postgresql for the database of choice.


Tip: If you cannot access the web interface ensure port 5432 has been opened in your firewall.

Now you are monitoring localhost! Edit your config files and add other hosts to monitor following guidelines here:

http://docs.icinga.org/latest/en/ch03.html