Changes between Version 8 and Version 9 of NSM2021/Agenda/iCinga


Ignore:
Timestamp:
May 22, 2021, 11:58:05 PM (4 years ago)
Author:
deepthi
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NSM2021/Agenda/iCinga

    v8 v9  
    1 = Configuring iCinga on Single server =
     1= Configuring iCinga2 on Single server =
    22
    33This will guide you through installing Icinga setup on Ubuntu 20.04 LTS server;
     
    66
    77* Linux Server running Ubuntu 20.04 LTS
    8 * NGINX Installed.
    98* SSL/ HTTPS Certificates issued ( May be using Letsencrypt or Otherwise)
    109* sudo access to the server. All following commands have to be entered as the root user. Best way to do it is, by login in as root with {{{ sudo su }}}
    1110
     11Execute the commands as super user
     12
     13== Installing using a Script ==
     14
     15Download the script into your server
     16
     17`wget https://raw.githubusercontent.com/LEARN-LK/Tutorials/master/installing_icinga2_ubuntu.sh`
     18
     19Assign execute permission for the script
     20
     21`chmod +x installing_icinga2_ubuntu.sh`
     22
     23Then execute file using terminal
     24
     25`./installing_icinga2_ubuntu.sh`
     26
     27Select `yes` for the options pop up when icinga2-ido-mysql starts installing and creating database for module. Enter a password for when it prompt(it is used for icinga2 database)
     28
     29== Manual Installation ==
     30
    1231=== Ubuntu Repositories===
    1332
     
    2241`. /etc/os-release; if [ ! -z ${UBUNTU_CODENAME+x} ]; then DIST="${UBUNTU_CODENAME}"; else DIST="$(lsb_release -c| awk '{print $2}')"; fi; `
    2342
    24  `echo "deb https://packages.icinga.com/ubuntu icinga-${DIST} main" >  /etc/apt/sources.list.d/${DIST}-icinga.list`
    25 
    26  `echo "deb-src https://packages.icinga.com/ubuntu icinga-${DIST} main" >> /etc/apt/sources.list.d/${DIST}-icinga.list`
     43`echo "deb https://packages.icinga.com/ubuntu icinga-${DIST} main" >  /etc/apt/sources.list.d/${DIST}-icinga.list`
     44
     45`echo "deb-src https://packages.icinga.com/ubuntu icinga-${DIST} main" >> /etc/apt/sources.list.d/${DIST}-icinga.list`
    2746
    2847`apt-get update`
     
    95114`apt-get install icinga2-ido-mysql`
    96115
     116Select `yes` for the options pop up and enter a password for when it prompt(it is used for icinga2 database)
     117
    97118Note :
    98119
    99 The Ubuntu packages provide a database configuration wizard by default. You can skip the automated setup and install/upgrade the database manually if you prefer.
     120(OPTIONAL)The Ubuntu packages provide a database configuration wizard by default. You can skip the automated setup and install/upgrade the database manually if you prefer.
    100121
    101122==== Setting up the MySQL database ====
     
    128149
    129150`systemctl restart icinga2`
     151
     152
    130153
    131154==== Setting Up Icinga 2 REST API ====
     
    148171}
    149172
     173(add an api user for the director as well)
     174
    150175Restart Icinga 2 to activate the configuration.
    151176
     
    169194This is due to local security restrictions whereas the web wizard cannot create a database/user through a local unix domain socket.
    170195
    171 `mysql -u root -p`;
     196==== Database for backend use ====
     197
     198log as root user
     199
     200`mysql -u root -p`
     201
     202then execute the following commands to create icingaweb db and director db
     203
     204===== For icingaweb db ====
    172205
    173206`CREATE DATABASE icingaweb2;`
    174207
    175 `CREATE USER icingaweb2@localhost IDENTIFIED BY '###PASSWORD###';`
     208`CREATE USER icingaweb2@localhost IDENTIFIED BY '##PASSWORD##';`
    176209
    177210`GRANT ALL ON icingaweb2.* TO icingaweb2@localhost;`
    178211
    179 `flush privileges;`
     212`Flush privileges;`
    180213
    181214`quit`
    182215
    183 === Enabling Director in Icinga ==
     216===== director db =====
     217
     218`CREATE DATABASE director CHARACTER SET 'utf8';`
     219
     220`CREATE USER director@localhost IDENTIFIED BY '##PASSWORD##';`
     221
     222`GRANT ALL ON director.* TO director@localhost;`
     223
     224`Flush privileges;`
     225
     226`quit`
     227
     228=== enabling reactbundle module ===
     229
     230Copy following script to a bash flle and execute or execute in the terminal.
     231
     232`REACTBUNDLE_MODULE_NAME=reactbundle`
     233
     234`REACTBUNDLE_MODULE_VERSION=v0.9.0`
     235
     236`REACTBUNDLE_REPO="https://github.com/Icinga/icingaweb2-module-${REACTBUNDLE_MODULE_NAME}"`
     237
     238`MODULES_PATH="/usr/share/icingaweb2/modules"`
     239
     240`git config --global advice.detachedHead false`
     241
     242`git clone ${REACTBUNDLE_REPO} "${MODULES_PATH}/${REACTBUNDLE_MODULE_NAME}" --branch "${REACTBUNDLE_MODULE_VERSION}"`
     243
     244`icingacli module enable "${REACTBUNDLE_MODULE_NAME}"`
     245
     246=== enabling ipl module ===
     247
     248Copy following script to a bash flle and execute or execute in the terminal.
     249
     250`IPL_MODULE_NAME=ipl`
     251
     252`IPL_MODULE_VERSION=v0.5.0`
     253
     254`IPL_REPO="https://github.com/Icinga/icingaweb2-module-${IPL_MODULE_NAME}"`
     255
     256`MODULES_PATH="/usr/share/icingaweb2/modules"`
     257
     258`git clone ${IPL_REPO} "${MODULES_PATH}/${IPL_MODULE_NAME}" --branch "${IPL_MODULE_VERSION}"`
     259
     260`icingacli module enable "${IPL_MODULE_NAME}"`
     261
     262=== enabling incubator module ===
     263
     264Copy following script to a bash flle and execute or execute in the terminal.
     265
     266`INCUBATOR_MODULE_NAME=incubator`
     267
     268`INCUBATOR_MODULE_VERSION=v0.6.0`
     269
     270`INCUBATOR_REPO="https://github.com/Icinga/icingaweb2-module-${INCUBATOR_MODULE_NAME}"`
     271
     272`MODULES_PATH="/usr/share/icingaweb2/modules"`
     273
     274`git clone ${INCUBATOR_REPO} "${MODULES_PATH}/${INCUBATOR_MODULE_NAME}" --branch "${INCUBATOR_MODULE_VERSION}"`
     275
     276`icingacli module enable "${INCUBATOR_MODULE_NAME}"`
     277
     278=== Enabling Director in Icinga ===
    184279
    185280Copy following script to a bash flle and execute. The script with the files to the relevant directory using the script
    186281
    187 ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"
    188 
    189 REPO_URL="https://github.com/icinga/icingaweb2-module-director"
    190 
    191 TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"
    192 
    193 MODULE_VERSION="1.8.0"
    194 
    195 git clone "${REPO_URL}" "${TARGET_DIR}" --branch v${MODULE_VERSION}
     282`ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"`
     283
     284`REPO_URL="https://github.com/icinga/icingaweb2-module-director"`
     285
     286`TARGET_DIR="${ICINGAWEB_MODULEPATH}/director"`
     287
     288`MODULE_VERSION="1.8.0"`
     289
     290`git clone "${REPO_URL}" "${TARGET_DIR}" --branch v${MODULE_VERSION}`
    196291
    197292and then enable the icinga-director module
     
    199294`icingacli module enable director`
    200295
    201 === Starting Web Setup ===
     296=== enabling business process module ===
     297
     298Copy following script to a bash flle and execute or execute in the terminal.
     299
     300`BS_PROCESS_ICINGAWEB_MODULEPATH="/usr/share/icingaweb2/modules"`
     301
     302`BS_PROCESS_REPO_URL="https://github.com/Icinga/icingaweb2-module-businessprocess"`
     303
     304`BS_PROCESS_TARGET_DIR="${ICINGAWEB_MODULEPATH}/businessprocess"`
     305
     306`git clone "${BS_PROCESS_REPO_URL}" "${BS_PROCESS_TARGET_DIR}"`
     307
     308`icingacli module enable businessprocess`
     309
     310=== changing the permission for relevant users ===
     311
     312`chown -R www-data:icingaweb2 /etc/icingaweb2/`
     313
     314=== Running a demon for director service ===
     315
     316`useradd -r -g icingaweb2 -d /var/lib/icingadirector -s /bin/false icingadirector`
     317
     318`install -d -o icingadirector -g icingaweb2 -m 0750 /var/lib/icingadirector`
     319
     320`MODULE_PATH=/usr/share/icingaweb2/modules/director`
     321
     322`cp "${MODULE_PATH}/contrib/systemd/icinga-director.service" /etc/systemd/system/`
     323
     324`systemctl daemon-reload`
     325
     326`systemctl enable icinga-director.service`
     327
     328`systemctl start icinga-director.service`
     329
     330== Starting Web Setup ==
    202331
    203332Finally visit Icinga Web 2 in your browser to access the setup wizard and complete the installation: