Поднимаем мониторинг на базе Icinga2/Web/Director/Grafana за 5 минут

0fd7736eaf7ddc22dd0db4159066da1c.png

root@icinga9:~/IcingaAnsible# ansible-playbook 0-icinga.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Install Icinga2 Software] ****************************************************************************************************************************************************
changed: [debian]

TASK [Change root password] ********************************************************************************************************************************************************
changed: [debian]

TASK [Create ~/.my.cnf] ************************************************************************************************************************************************************
changed: [debian]

TASK [Insert into ~/.my.cnf] *******************************************************************************************************************************************************
changed: [debian]

TASK [SQL Flush Privileges] ********************************************************************************************************************************************************
changed: [debian]

TASK [Remove test database] ********************************************************************************************************************************************************
ok: [debian]

TASK [Enable ReWrite Apache Module] ************************************************************************************************************************************************
changed: [debian]

TASK [Set date.timezone in PHP configuration] **************************************************************************************************************************************
changed: [debian]

TASK [Enable Icinga2 feature — COMMAND] ********************************************************************************************************************************************
changed: [debian]

TASK [Get random password for IDO module from ido-mysql.conf] **********************************************************************************************************************
changed: [debian → 127.0.0.1]

TASK [set_fact] ********************************************************************************************************************************************************************
ok: [debian]

TASK [debug] ***********************************************************************************************************************************************************************
ok: [debian] => {
«ido_password»: «d6qyFduTCvpi»
}

TASK [Drop IDO Database] ***********************************************************************************************************************************************************
ok: [debian]

TASK [Create Database for IDO Icinga Module] ***************************************************************************************************************************************
changed: [debian]

TASK [Fill icinga2 database from Template] *****************************************************************************************************************************************
changed: [debian]

TASK [Create SQL User icinga2 for Access to IDO Database] **************************************************************************************************************************
changed: [debian]

TASK [Flush privileges in SQL] *****************************************************************************************************************************************************
changed: [debian]

TASK [Enable Icinga2 feature — IDO-MYSQL] ******************************************************************************************************************************************
changed: [debian]

TASK [Restart Icinga2 Service] *****************************************************************************************************************************************************
changed: [debian]

TASK [Drop Icingaweb2 Database] ****************************************************************************************************************************************************
ok: [debian]

TASK [Create Database for Icingaweb2 Module] ***************************************************************************************************************************************
changed: [debian]

TASK [Create SQL Database for Icingaweb2] ******************************************************************************************************************************************
changed: [debian]

TASK [Grant Access for Database for Icingaweb2] ************************************************************************************************************************************
changed: [debian]

TASK [Create Icingaweb2 User in Database] ******************************************************************************************************************************************
changed: [debian]

TASK [Flush privileges in SQL] *****************************************************************************************************************************************************
changed: [debian]

TASK [Restart Apache2 Service] *****************************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=27 changed=21 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 1-icingaweb-modules.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Install Grafana module for Icingaweb2] ***************************************************************************************************************************************
changed: [debian]

TASK [Install IPL module for Icingaweb2] *******************************************************************************************************************************************
changed: [debian]

TASK [Install Incubator module for Icingaweb2] *************************************************************************************************************************************
changed: [debian]

TASK [Install Reactbundle module for Icingaweb2] ***********************************************************************************************************************************
changed: [debian]

TASK [Install Director module for Icingaweb2] **************************************************************************************************************************************
changed: [debian]

TASK [Enable Monitoring Module in Icingaweb2] **************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=7 changed=6 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 2-icingaweb-init-configuration.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Install authentication.ini] **************************************************************************************************************************************************
changed: [debian]

TASK [Install config.ini] **********************************************************************************************************************************************************
changed: [debian]

TASK [Install groups.ini] **********************************************************************************************************************************************************
changed: [debian]

TASK [Get random password for IDO module from ido-mysql.conf] **********************************************************************************************************************
changed: [debian → 127.0.0.1]

TASK [set_fact] ********************************************************************************************************************************************************************
ok: [debian]

TASK [debug] ***********************************************************************************************************************************************************************
ok: [debian] => {
«ido_password»: «d6qyFduTCvpi»
}

TASK [Install resources.ini] *******************************************************************************************************************************************************
changed: [debian]

TASK [Install roles.ini] ***********************************************************************************************************************************************************
changed: [debian]

TASK [Create monitoring cfg folder] ************************************************************************************************************************************************
changed: [debian]

TASK [Enable API Function in Icinga2] **********************************************************************************************************************************************
changed: [debian]

TASK [Get random password for API Icinga2 after api setup] *************************************************************************************************************************
changed: [debian → 127.0.0.1]

TASK [set_fact] ********************************************************************************************************************************************************************
ok: [debian]

TASK [debug] ***********************************************************************************************************************************************************************
ok: [debian] => {
«api_password»: «cd53fe09a2bca6d7»
}

TASK [Create backends.ini for module monitoring] ***********************************************************************************************************************************
changed: [debian]

TASK [Create commandtransports.ini for module monitoring] **************************************************************************************************************************
changed: [debian]

TASK [Create config.ini for module monitoring] *************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=17 changed=12 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 3-influx.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Install InfluxDB Software] ***************************************************************************************************************************************************
changed: [debian]

TASK [Create InfluxDB Database for Icinga Metrics] *********************************************************************************************************************************
changed: [debian]

TASK [Create InfluxDB User] ********************************************************************************************************************************************************
changed: [debian]

TASK [Grant Access for User to Database] *******************************************************************************************************************************************
changed: [debian]

TASK [Enable InfluxDB Module in Icinga Service] ************************************************************************************************************************************
changed: [debian]

TASK [Enable InfluxDB in Icinga] ***************************************************************************************************************************************************
changed: [debian]

TASK [Restart Icinga Service] ******************************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=8 changed=7 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 4-director.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Remove director database if exists] ******************************************************************************************************************************************
ok: [debian]

TASK [Create database for Director Icingaweb Module] *******************************************************************************************************************************
changed: [debian]

TASK [Create user for Director Access] *********************************************************************************************************************************************
changed: [debian]

TASK [Grant access user for director database] *************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=5 changed=3 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 5-director-kickstart.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Get random password for API Icinga2 after api setup] *************************************************************************************************************************
changed: [debian → 127.0.0.1]

TASK [set_fact] ********************************************************************************************************************************************************************
ok: [debian]

TASK [debug] ***********************************************************************************************************************************************************************
ok: [debian] => {
«api_password»: «cd53fe09a2bca6d7»
}

TASK [Get Icinga hostname] *********************************************************************************************************************************************************
changed: [debian → 127.0.0.1]

TASK [set_fact] ********************************************************************************************************************************************************************
ok: [debian]

TASK [debug] ***********************************************************************************************************************************************************************
ok: [debian] => {
«icinga_hostname»: «icinga9.test.local»
}

TASK [Create director kickstart cfg folder] ****************************************************************************************************************************************
changed: [debian]

TASK [Create config.ini to set director database name] *****************************************************************************************************************************
changed: [debian]

TASK [Create kickstart.ini for configure director] *********************************************************************************************************************************
changed: [debian]

TASK [Populate Director Database] **************************************************************************************************************************************************
changed: [debian]

TASK [Kickstat Director] ***********************************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=12 changed=7 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 6-grafana-dpkg-install.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Install grafana dependencies] ************************************************************************************************************************************************
changed: [debian]

TASK [Download Grafana Debian Package from Custom URL Source] **********************************************************************************************************************
changed: [debian]

TASK [Install Grafana Server] ******************************************************************************************************************************************************
changed: [debian]

TASK [Reload systemctl Daemons Lists] **********************************************************************************************************************************************
changed: [debian]

TASK [Enable Grafana Service] ******************************************************************************************************************************************************
changed: [debian]

TASK [Set allow_embedding in grafana.ini] ******************************************************************************************************************************************
changed: [debian]

TASK [Enable anonymous access] *****************************************************************************************************************************************************
changed: [debian]

TASK [Enable anonymous name] *******************************************************************************************************************************************************
changed: [debian]

TASK [Enable anonymous role] *******************************************************************************************************************************************************
changed: [debian]

TASK [Start Grafana Server] ********************************************************************************************************************************************************
changed: [debian]

TASK [Install Grafana plugin — grafana-image-renderer] *****************************************************************************************************************************
changed: [debian]

TASK [Final change all permission on Icingaweb2 folder] ****************************************************************************************************************************
changed: [debian]

TASK [Restart Grafana Service] *****************************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=14 changed=13 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

root@icinga9:~/IcingaAnsible# ansible-playbook 7-icingadb.yml

PLAY [debian] **********************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************
ok: [debian]

TASK [Add IcingaDB Repository] *****************************************************************************************************************************************************
changed: [debian]

TASK [Add APT Key from Icinga Repository] ******************************************************************************************************************************************
changed: [debian]

TASK [Install IcingaDB and other services] *****************************************************************************************************************************************
changed: [debian]

TASK [Drop IDO Database] ***********************************************************************************************************************************************************
ok: [debian]

TASK [Drop user] *******************************************************************************************************************************************************************
ok: [debian]

TASK [FLUSH PRIVIGELES] ************************************************************************************************************************************************************
changed: [debian]

TASK [Create icingadb database] ****************************************************************************************************************************************************
changed: [debian]

TASK [Create user icingadb] ********************************************************************************************************************************************************
changed: [debian]

TASK [Create icingadb database] ****************************************************************************************************************************************************
changed: [debian]

TASK [Fill SQL Database for IcingaDB] **********************************************************************************************************************************************
changed: [debian]

TASK [Set password for icingadb cfg] ***********************************************************************************************************************************************
changed: [debian]

TASK [Enable icingadb feature] *****************************************************************************************************************************************************
changed: [debian]

TASK [Restart Icinga2 Service] *****************************************************************************************************************************************************
changed: [debian]

TASK [Create icingadb modules folder] **********************************************************************************************************************************************
changed: [debian]

TASK [Create config.ini for module icingadb] ***************************************************************************************************************************************
changed: [debian]

TASK [Create redis.ini for module icingadb] ****************************************************************************************************************************************
changed: [debian]

TASK [Enable Icingaweb2 module IcingaDB] *******************************************************************************************************************************************
changed: [debian]

TASK [Restart IcingaDB Service] ****************************************************************************************************************************************************
changed: [debian]

PLAY RECAP *************************************************************************************************************************************************************************
debian: ok=19 changed=16 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

© Habrahabr.ru