Difference between revisions of "SUSE Manager/Icinga"

From MicroFocusInternationalWiki
Jump to: navigation, search
Line 10: Line 10:
  
 
2. Install the necessary packages:
 
2. Install the necessary packages:
 
+
<nowiki>
 
zypper in icinga icinga-idoutils-pgsql postgresql postgresql94-server monitoring-plugins-all apache2 apache2-example-pages
 
zypper in icinga icinga-idoutils-pgsql postgresql postgresql94-server monitoring-plugins-all apache2 apache2-example-pages
 
+
</nowiki>
 
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.
 
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.
 
+
<nowiki>
 
vi /etc/icinga/objects/contacts.cfg
 
vi /etc/icinga/objects/contacts.cfg
 
+
</nowiki>
 
4.  Set postgres to start on bootup and start the DB:
 
4.  Set postgres to start on bootup and start the DB:
  
systemctl enable postgresql.service
+
<nowiki>systemctl enable postgresql.service
  
 
systemctl start postgresql.service
 
systemctl start postgresql.service
 
+
</nowiki>
  
 
5. Create database and User:
 
5. Create database and User:
  
  #su - postgres
+
  <nowiki>#su - postgres
 
   
 
   
 
  >psql
 
  >psql
Line 32: Line 32:
 
  postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 
  postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 
  postgres=# CREATE DATABASE icinga;
 
  postgres=# CREATE DATABASE icinga;
  postgres=# \q
+
  postgres=# \q</nowiki>
  
 
6. Modify the postgres config file - /var/lib/pgsql/data/pg_hba.conf - commenting out everything, and placing this at the bottom:
 
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
+
  <nowiki># database administrative login by UNIX sockets
 
  local    all        postgres                  ident
 
  local    all        postgres                  ident
 
  # TYPE  DATABASE  USER      CIDR-ADDRESS  METHOD  
 
  # TYPE  DATABASE  USER      CIDR-ADDRESS  METHOD  
Line 48: Line 48:
 
  host    all        all        ::1/128        trust
 
  host    all        all        ::1/128        trust
  
 
+
</nowiki>
 
Then reload the postgresql service:
 
Then reload the postgresql service:
 
+
<nowiki>
systemctl reload postgresql.service
+
systemctl reload postgresql.service</nowiki>
  
 
7.  Configure the database schema:
 
7.  Configure the database schema:
 
+
<nowiki>
 
cd /usr/share/doc/packages/icinga-idoutils-pgsql/pgsql/
 
cd /usr/share/doc/packages/icinga-idoutils-pgsql/pgsql/
  
 
psql -U icinga -d icinga < pgsql.sql
 
psql -U icinga -d icinga < pgsql.sql
 
+
</nowiki>
 
8. Edit the following lines in the DB config file to customize IDOUtils for postgres
 
8. Edit the following lines in the DB config file to customize IDOUtils for postgres
 
+
<nowiki>
 
  vi /etc/icinga/ido2db.cfg
 
  vi /etc/icinga/ido2db.cfg
  
 
  db_servertype=pgsql
 
  db_servertype=pgsql
 
  db_port=5432
 
  db_port=5432
 
+
</nowiki>
  
 
8. Create an icingaadmin account for logging into the web interface:
 
8. Create an icingaadmin account for logging into the web interface:
 
+
<nowiki>
 
htpasswd -c /etc/icinga/htpasswd.users icingaadmin
 
htpasswd -c /etc/icinga/htpasswd.users icingaadmin
 
+
</nowiki>
 
9. Enable and start the ido2db, icinga, and apache2  services:
 
9. Enable and start the ido2db, icinga, and apache2  services:
 
+
<nowiki>
 
systemctl enable ido2db.service
 
systemctl enable ido2db.service
  
Line 84: Line 84:
  
 
systemctl start apache2.service
 
systemctl start apache2.service
 
+
</nowiki>
 
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.
 
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.
  

Revision as of 23:10, 15 March 2016

SUSE Manager Main Page

Icinga Quick Start on SLE

Icinga packages are in the SUSE Manager Tools channel for SLE12.

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

1. Add the SUMA client and update channels to your 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=# CREATE USER icinga;
 postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 postgres=# CREATE DATABASE icinga;
 postgres=# \q

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
 local    all        postgres                  ident
 # TYPE   DATABASE   USER       CIDR-ADDRESS   METHOD 
 #icinga
 local    icinga     icinga                    trust
 # "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 ido2db.service

systemctl start ido2db.service

systemctl enable icinga.service

systemctl start icinga.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/

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