Difference between revisions of "SUSE Manager/Icinga"

From MicroFocusInternationalWiki
Jump to: navigation, search
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Icinga packages are in the SUSE Manager Tools channel for SLE12.
+
[[SUSE_Manager|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:
 
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
+
1. Add client and update channels, you need to be in the sles12 / sles12sp1 server
  
 
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
 +
postgres=# ALTER USER postgres WITH PASSWORD '<newpassword>';
 
  postgres=# CREATE USER icinga;
 
  postgres=# CREATE USER icinga;
 
  postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 
  postgres=# ALTER USER icinga WITH PASSWORD 'icinga';
 
  postgres=# CREATE DATABASE icinga;
 
  postgres=# CREATE DATABASE icinga;
 +
postgres=# GRANT ALL ON DATABASE icinga TO icinga;
 
  postgres=# \q
 
  postgres=# \q
 +
exit
 +
</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
 +
 
 +
#icinga
 +
local    icinga    icinga                    trust
 
  local    all        postgres                  ident
 
  local    all        postgres                  ident
 
  # TYPE  DATABASE  USER      CIDR-ADDRESS  METHOD  
 
  # TYPE  DATABASE  USER      CIDR-ADDRESS  METHOD  
  #icinga
+
   
local    icinga    icinga                    trust
+
 
  # "local" is for Unix domain socket connections only
 
  # "local" is for Unix domain socket connections only
 
  local    all        all                      trust
 
  local    all        all                      trust
Line 44: Line 53:
 
  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 icinga.service
 +
systemctl start icinga.service
 
systemctl enable ido2db.service
 
systemctl enable ido2db.service
 
 
systemctl start ido2db.service
 
systemctl start ido2db.service
 +
systemctl enable 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.
  
systemctl enable icinga.service
+
http://localhost/icinga/
  
systemctl start icinga.service
+
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.
  
systemctl enable apache2.service
+
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.
  
systemctl start apache2.service
+
For example :
 +
<nowiki>
 +
[Unit]
 +
Description=Icinga Data Out Utilities (IDOUtils)
 +
After=syslog.target network.target postgresql.service
 +
Wants=postgresql.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.
+
When a different database than postgresql is used, replace postgresql for the database of choice.
 +
<!-- For details, see bugzilla #1064855 -->
  
  http://localhost/icinga/
+
 
 +
=== 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

Latest revision as of 09:18, 8 January 2018

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