Appuntivari » Cronologia » Versione 5
japoco romagnoli, 23-07-2013 18:08
| 1 | 2 | japoco romagnoli | h1. Breve descrizione report icinga con jasper |
|---|---|---|---|
| 2 | |||
| 3 | https://www.icinga.org/about/icinga-reporting/get-started/ |
||
| 4 | https://wiki.icinga.org/display/howtos/Icinga+Web+Reporting+Integration |
||
| 5 | |||
| 6 | h2. Installo _php-soap_: |
||
| 7 | |||
| 8 | <pre> |
||
| 9 | apt-get install php-soap |
||
| 10 | </pre> |
||
| 11 | |||
| 12 | h2. Abilitazione reporting: |
||
| 13 | |||
| 14 | Si abilita il reporting da parte di icinga andando ad aprire il file @/etc/icinga-web/conf.d/module_reporting.xml@ in particolare si cambia a _true_ il valore di _module enabled_ : |
||
| 15 | |||
| 16 | <pre> |
||
| 17 | nano /etc/icinga-web/conf.d/module_reporting.xml |
||
| 18 | </pre> |
||
| 19 | |||
| 20 | <pre> |
||
| 21 | <module enabled="true"> |
||
| 22 | </pre> |
||
| 23 | |||
| 24 | Dopo di che si deve effettuare la pulitura della cache, che deve essere fatta ogni volta che si cambia il file di configurazione di icinga-web: |
||
| 25 | |||
| 26 | <pre> |
||
| 27 | /usr/lib/icinga-web/bin/clearcache.sh |
||
| 28 | </pre> |
||
| 29 | |||
| 30 | Nel file @/etc/icinga-web/conf.d/module_reporting.xml@ si cambiano anche i valori relativi ai parametri di collegamento a _jasperserver_ |
||
| 31 | cambiando le righe: |
||
| 32 | |||
| 33 | <pre> |
||
| 34 | ... |
||
| 35 | <ae:parameter name="jasper_url">http://127.0.0.1:8080/jasperserver</ae:parameter> |
||
| 36 | ... |
||
| 37 | ... |
||
| 38 | <ae:parameter name="tree_root">/icinga</ae:parameter> |
||
| 39 | ... |
||
| 40 | </pre> |
||
| 41 | |||
| 42 | in: |
||
| 43 | |||
| 44 | <pre> |
||
| 45 | ... |
||
| 46 | <ae:parameter name="jasper_url">http://192.168.1.126:8080/jasperserver</ae:paramete> |
||
| 47 | ... |
||
| 48 | ... |
||
| 49 | <ae:parameter name="tree_root">/icinga/reports</ae:parameter> |
||
| 50 | ... |
||
| 51 | </pre> |
||
| 52 | |||
| 53 | Si effettua una nuova pulizia della cache: |
||
| 54 | |||
| 55 | <pre> |
||
| 56 | /usr/lib/icinga-web/bin/clearcache.sh |
||
| 57 | </pre> |
||
| 58 | |||
| 59 | h2. Cronks: |
||
| 60 | |||
| 61 | Si procede con le modifiche al file @/etc/icinga-web/conf.d/cronks.xml@ cambiando la riga: |
||
| 62 | |||
| 63 | <pre> |
||
| 64 | ... |
||
| 65 | <ae:parameter name="hide">true</ae:parameter> |
||
| 66 | ... |
||
| 67 | </pre> |
||
| 68 | |||
| 69 | nella riga: |
||
| 70 | |||
| 71 | <pre> |
||
| 72 | ... |
||
| 73 | <ae:parameter name="hide">false</ae:parameter> |
||
| 74 | ... |
||
| 75 | </pre> |
||
| 76 | |||
| 77 | Per le distribuzione Debian si deve creare una giusta cartella per i report con: |
||
| 78 | |||
| 79 | <pre> |
||
| 80 | install --directory --mode=0770 --owner=www-data --group=www-data /var/cache/icinga-web/reports |
||
| 81 | </pre> |
||
| 82 | |||
| 83 | Tornando al file @/etc/icinga-web/conf.d/module_reporting.xml@ si deve aggiungere una riga per ridefinire cartella dei report: |
||
| 84 | |||
| 85 | <pre> |
||
| 86 | nano /etc/icinga-web/conf.d/module_reporting.xml |
||
| 87 | </pre> |
||
| 88 | |||
| 89 | aggiungendo una linea: |
||
| 90 | |||
| 91 | <pre> |
||
| 92 | <setting name="dir.download">/var/cache/icinga-web/reports</setting> |
||
| 93 | </pre> |
||
| 94 | |||
| 95 | ottenendo qualcosa del tipo: |
||
| 96 | |||
| 97 | <pre> |
||
| 98 | <module enabled="true"> |
||
| 99 | <settings> |
||
| 100 | <setting name="jasperconfig.default"> |
||
| 101 | <ae:parameter name="jasper_url">http://192.168.1.126:8080/jasperserver</ae:parameter> |
||
| 102 | <ae:parameter name="jasper_user">jasperadmin</ae:parameter> |
||
| 103 | <ae:parameter name="jasper_pass">jasperadmin</ae:parameter> |
||
| 104 | <ae:parameter name="tree_root">/icinga/reports</ae:parameter> |
||
| 105 | </setting> |
||
| 106 | |||
| 107 | <setting name="dir.download">/var/cache/icinga-web/reports</setting> |
||
| 108 | </settings> |
||
| 109 | </module> |
||
| 110 | </pre> |
||
| 111 | 3 | japoco romagnoli | |
| 112 | |||
| 113 | h2. MySQL |
||
| 114 | |||
| 115 | si fornisce a MySQL le funzioni su cui si basano i servizi importando il file _availability.sql_ sulla macchina su cui è installato icinga con: |
||
| 116 | |||
| 117 | <pre> |
||
| 118 | mysql icinga < icinga-reports-1.9.0/db/icinga/mysql/availability.sql |
||
| 119 | </pre> |
||
| 120 | |||
| 121 | oppure copiandolo dalla macchina su cui si trova icinga-reports: |
||
| 122 | |||
| 123 | <pre> |
||
| 124 | scp db/icinga/mysql/availability.sql mysqlmast: |
||
| 125 | </pre> |
||
| 126 | 4 | japoco romagnoli | |
| 127 | per controllare che tutto sia effettivamente andato a buon fine si può fare: |
||
| 128 | |||
| 129 | <pre> |
||
| 130 | mysql -u icinga-idoutils -p |
||
| 131 | Enter password: |
||
| 132 | </pre> |
||
| 133 | |||
| 134 | <pre> |
||
| 135 | mysql> SELECT * FROM INFORMATION_SCHEMA.ROUTINES; |
||
| 136 | </pre> |
||
| 137 | |||
| 138 | ottenendo qualcosa del tipo: |
||
| 139 | |||
| 140 | <pre> |
||
| 141 | +---------------------+-----------------+----------------+---------------------+--------------+----------------+--------------+--------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+----------+-----------------+----------------+----------------------+----------------------+--------------------+ |
||
| 142 | | SPECIFIC_NAME | ROUTINE_CATALOG | ROUTINE_SCHEMA | ROUTINE_NAME | ROUTINE_TYPE | DTD_IDENTIFIER | ROUTINE_BODY | ROUTINE_DEFINITION | EXTERNAL_NAME | EXTERNAL_LANGUAGE | PARAMETER_STYLE | IS_DETERMINISTIC | SQL_DATA_ACCESS | SQL_PATH | SECURITY_TYPE | CREATED | LAST_ALTERED | SQL_MODE | ROUTINE_COMMENT | DEFINER | CHARACTER_SET_CLIENT | COLLATION_CONNECTION | DATABASE_COLLATION | |
||
| 143 | +---------------------+-----------------+----------------+---------------------+--------------+----------------+--------------+--------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+----------+-----------------+----------------+----------------------+----------------------+--------------------+ |
||
| 144 | | icinga_availability | NULL | icinga | icinga_availability | FUNCTION | decimal(7,4) | SQL | NULL | NULL | NULL | SQL | NO | READS SQL DATA | NULL | DEFINER | 2013-07-22 13:57:32 | 2013-07-22 13:57:32 | | | root@localhost | latin1 | latin1_swedish_ci | latin1_swedish_ci | |
||
| 145 | +---------------------+-----------------+----------------+---------------------+--------------+----------------+--------------+--------------------+---------------+-------------------+-----------------+------------------+-----------------+----------+---------------+---------------------+---------------------+----------+-----------------+----------------+----------------------+----------------------+--------------------+ |
||
| 146 | 1 row in set (0.00 sec) |
||
| 147 | |||
| 148 | </pre> |
||
| 149 | |||
| 150 | |||
| 151 | si danno i permessi necessari all'utente che si collegherà ad icinga col client: |
||
| 152 | |||
| 153 | <pre> |
||
| 154 | GRANT ALL ON icinga.* To 'icinga-idoutils'@'macchina_jasper' IDENTIFIED BY PASSWORD 'xxxxxxxxxxxxxxxxx'; |
||
| 155 | </pre> |
||
| 156 | |||
| 157 | anche se da documentazione basterebbe un: |
||
| 158 | |||
| 159 | <pre> |
||
| 160 | GRANT EXECUTE ON icinga.* To <username>@<host>; |
||
| 161 | </pre> |
||
| 162 | |||
| 163 | infine ottenendo qualcosa del tipo: |
||
| 164 | |||
| 165 | <pre> |
||
| 166 | mysql> show grants for 'icinga-idoutils'@'macchina_jasper'; |
||
| 167 | +----------------------------------------------------------------------------------------------------------------------------+ |
||
| 168 | | Grants for icinga-idoutils@miller.fi.trl | |
||
| 169 | +----------------------------------------------------------------------------------------------------------------------------+ |
||
| 170 | | GRANT USAGE ON *.* TO 'icinga-idoutils'@'macchina_jasper' IDENTIFIED BY PASSWORD 'xxxxxxxxxxxxxxxxx' | |
||
| 171 | | GRANT EXECUTE ON `icinga`.* TO 'icinga-idoutils'@'macchina_jasper' | |
||
| 172 | +----------------------------------------------------------------------------------------------------------------------------+ |
||
| 173 | 2 rows in set (0.00 sec) |
||
| 174 | </pre> |
||
| 175 | |||
| 176 | |||
| 177 | h3. Accorgimenti su macchina Icinga: |
||
| 178 | |||
| 179 | a installazione avvenuta c'erano alcuni problemi riguardo i valori attribuiti di default ad alcune variabili del file _/etc/php5/conf.d/suhosin.ini_ |
||
| 180 | per cui è risultato necessario cambiare alcuni valori da 64 a 128, seguendo le indicazioni ricavate consultando i log nel syslog: |
||
| 181 | |||
| 182 | <pre> |
||
| 183 | less /var/log/syslog |
||
| 184 | </pre> |
||
| 185 | |||
| 186 | |||
| 187 | h2. Macchina Jasper: |
||
| 188 | |||
| 189 | Bisogna installare _icinga-reports_ per cui: |
||
| 190 | |||
| 191 | <pre> |
||
| 192 | git clone git://git.icinga.org/icinga-reports.git ; cd icinga-reports |
||
| 193 | </pre> |
||
| 194 | |||
| 195 | dopo di che: |
||
| 196 | |||
| 197 | <pre> |
||
| 198 | ./configure --with-icinga-user=root --with-icinga-group=root --with-jasper-server=/opt/jasperreports-server-cp-5.1.0/ |
||
| 199 | </pre> |
||
| 200 | |||
| 201 | anche se da letteratura sarebbe stato: |
||
| 202 | |||
| 203 | <pre> |
||
| 204 | ./configure --with-jasper-server=/opt/jasperreports-server-cp-5.1.0/ |
||
| 205 | </pre> |
||
| 206 | |||
| 207 | ma vengono fuori problemi con l'username. |
||
| 208 | |||
| 209 | A questo punto poi si fa: |
||
| 210 | |||
| 211 | <pre> |
||
| 212 | make install-mysql-connect |
||
| 213 | |||
| 214 | o |
||
| 215 | |||
| 216 | make install |
||
| 217 | </pre> |
||
| 218 | |||
| 219 | ed infine si riavvia jasper: |
||
| 220 | |||
| 221 | <pre> |
||
| 222 | cd /opt/jasperreports-server-cp-5.1.0/ |
||
| 223 | |||
| 224 | ./ctlscript.sh stop |
||
| 225 | |||
| 226 | ./ctlscript.sh start |
||
| 227 | </pre> |
||
| 228 | |||
| 229 | |||
| 230 | 5 | japoco romagnoli | Si accede a questo punto tramite pagina web con pw e username di default _jasperadmin_: |
| 231 | |||
| 232 | <pre> |
||
| 233 | http://localhost:8080/jasperserver/login.html |
||
| 234 | </pre> |
||
| 235 | |||
| 236 | nella sezione _cartelle_ andiamo in _root --> Icinga --> Data Sources_ e si controlla la pagina di configurazione _IDO_ secondo quanto suggerito da letteratura (https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+Reporting) |
||
| 237 | avendo cura di cambiare la sezione _Host_ e _URL_ nel caso le installazioni di Jasper e Icinga fossero fatte su due macchine diverse (come nel caso da noi trattato). |
||
| 238 | |||
| 239 | |||
| 240 | 4 | japoco romagnoli | h3. Accorgimento su macchina jasper: |
| 241 | |||
| 242 | si è dovuto creare un utente Icinga sulla macchina per generare dei file che nel processo di installazione vengono controllati e nel caso non vengano trovati l'installazione non riesce ad andare a buon fine. |