forked from Icinga/icinga-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.RHEL.idoutils
157 lines (103 loc) · 3.8 KB
/
README.RHEL.idoutils
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
IDOUtils Notes for RHEL packages
================================
CHANGES for 1.7
* bindir/idomod.o => libdir/idomod.so
* /var/icinga => /var/spool/icinga
* icinga-idoutils => icinga-idoutils-libdbi-mysql and icinga-idoutils-libdbi-pgsql
* IDOMOD Setup
DO NOT EDIT icinga.cfg for broker_module entry!!! Icinga RPMs will use the
/etc/icinga/modules/idoutils.cfg with the module definition automatically.
Defining that twice can lead into unwanted errors!
Verify that by looking into the modules/idoutils.cfg file
# vim /etc/icinga/modules/idoutils.cfg
Other event broker modules can be defined using this module definition as well.
* IDO2DB Setup
Edit your database credentials in ido2db.cfg ...
# vim /etc/icinga/ido2db.cfg
db_servertype=mysql
#db_servertype=pgsql
db_host=localhost
db_port=3306
#db_port=5432
db_name=icinga
db_prefix=icinga_
db_user=icinga
db_pass=icinga
... and create the database like described below.
=========
= MySQL
=========
Create Database, User, Grants
-----------------------------
# mysql -u root -p
mysql> CREATE DATABASE icinga;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga';
quit
Import database schema
----------------------
# cd /usr/share/doc/icinga-idoutils-libdbi-mysql-*/db/mysql
# mysql -u root -p icinga < mysql.sql
=============
= Postgresql
=============
Create Database, User, Grants
-----------------------------
# su - postgres
postgres:~$ psql template1
template1=# create database icinga;
template1=# \q
postgres:~$ createlang plpgsql icinga
postgres:~$ psql
postgres=# create role icinga;
postgres=# alter role icinga login;
postgres=# grant all on database icinga to icinga;
postgres=# \q
Import database schema
----------------------
postgres:~$ cd /usr/share/doc/icinga-idoutils-libdbi-pgsql-*/db/pgsql
postgres:~$ psql -U icinga -d icinga < pgsql.sql
Setup trusted local icinga user
-------------------------------
Now that Postgresql does use a local user to be trusted (insecure, but good as startup),
edit pg_hba.conf accordingly. See Postgresql Manual for a more advanced setup on user
auth and privilegues.
# vim /var/lib/pgsql/data/pg_hba.conf
# 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
#icinga
local icinga icinga trust
and reload the Postgresql server.
==========
= Upgrade
==========
There is no db upgrade script like in Debian, so you need to keep track of that yourself.
First, get the schema version
# mysql -u root -p icinga
mysql> SELECT * from icinga_dbversion;
+--------------+----------+---------+
| dbversion_id | name | version |
+--------------+----------+---------+
| 1 | idoutils | 1.6.0 |
+--------------+----------+---------+
1 row in set (0.01 sec)
and then decide, what to do - based on the official upgrade docs:
http://docs.icinga.org/latest/en/upgrading_idoutils.html
Remember - the upgrade steps need to be applied incremential, version by version.
Make sure to stop ido2db before applying the db upgrade!
# service ido2db stop
# cd /usr/share/doc/icinga-idoutils-libdbi-mysql-*/db/mysql/upgrade/
# mysql -u root -p icinga < mysql-upgrade-1.9.0.sql
# service ido2db start
# service icinga restart
===========
= Advanced
===========
Advanced guides and upgrade information can be found in the docs and wiki:
http://docs.icinga.org/latest/en/quickstart-idoutils.html
http://docs.icinga.org/latest/en/upgrading_idoutils.html
https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+IDOUtils+on+RHEL