At G&D we have one ICINGA system specialized in monitoring our complex SAP environment. To keep ICINGA “up to date” the “Config Build” is automated with the help of GLPI.
All technical information’s are collected by GLPI’s “Fusioninventory” plugin, some custom ICINGA fields are added with the “Fields” plugin to our Server- , Database- and SAP Objects.
To build the ICINGA configuration we use various database views (GLPI’s mysql) and some python scripts … but it would be possible to use the “Icinga Director” as well.
Finally, we are informed if the monitoring configuration would change due to system changes detected by GLPI. This means that we can adjust our monitoring fully- or semi-automatically.
3. Come on … why so complicated?
74
Advantages of automated generation via GLPI:
the solution scales
can't forget anything in your Icinga2 configuration
relevant changes on all systems are “immediately” visible
full automation is possible (because GLPI “feeds” Icinga2 with “sys data” )
system administrator has an GUI inside GLPI to change I2 settings
Easy setting of downtimes for entire “landscapes”
.. dependencies become transparent (VM >> ESX >> Switch)
…. and “YOU” (the I2 Admin) can concentrate on more important things
6. Special views and tables added to GLPI
v_info: all basic information’s on servers, network, SAP, etc in one view
v_icinga2_computer: special information’s from fields plugin
v_sap_instances , v_sap_instances_hosts:
v_sap_database , v_sap_db_instances: all special information’s from the
database plugin and fields plugin inside “databases”
v_ip , v_network_interfaces: technical network information’s
info_process: special table with processes extracted from the hosts xml file
tcp_scan: tcp scan results ( glpi host id, IP , tcp port, ssl, certificate, … )
v_icinga2_sap_maintenance: special view to set maininance in icinga
v_docu: all link’s and dokuments for glpi objects like computer, network, etc
77
7. Additional tools to enrich data in GLPI
scanhostmulti.py >> purpose: TCP scan of the host to determine all open TCP
ports and put these in a special GLPI table
xml_to_db.py >> purpose: extra process information’s from xml files in
glpi/files/_plugins/fusioninventory/xml/computer/… on GLPI
server, reason: <PROCESSES> section is ignored during import
further planned personal expansions for fusioninventory:
Link between TCP Port and Process, so what process is “listening” on the
servers TCP port
prozess.ps1 >> purpose: add running processes list to fusioninventory xml on
Windows systems (unfortunately process information's are missing in fi4win )
Transfer of Interesting config settings to an additional GLPI table:
Ansible values, SAP Profile, DB2 settings, mysql config, etc …
78
8. host
script
(py)
-
overview
79
GLPI-DB
table Tabelle Tabelle Tabelle
View
GET GROUPS
GET SERVER LIST
GET USERS
Tabelle
Missing files ?
Redundant files?
Updates?
LOOP SERVER Host Info SQL
EXIT
SQL
Disc Info
Network Info
SQL
SQL
Process Info SQL
CONFIG
FILES
START
9. python scripts and other files to extract the
Icinga config from GLPI
glpi-to-sap-host.py ( 1300 lines only )
Parameter’s -p sap-process , -t sap-tcp , -d sap-disk , -z “Icinga-Parent-Zone”
reads the host table, check for rescan & monitoring = yes and dst file exists
If there are any changes or missing files:
Create complete list of Users / Groups
Loop through this host for:
Info’s: v_info, v_icinga2_computer, v_icinga2_computer_group
Disk: Looping with for computer through glpi_items_disks
IP & Interfaces: looping glpi_ipaddresses, v_ip
Processes: looping through info_process
TCP Ports: looping through tcp_scan
80
10. python scripts and other files to extract the
Icinga config from GLPI
sap-process:
# 1: programm to search
# 2: display name in icinga
# 3: process check string - if field is X it will be ignored
# 4: number of process for warning (X = ignored )
# 5: number of process for critical (X = ignored )
# 6: user (X = ignored )
# 7: mail or sms&mail or ignore M/S/C/I , default is I OR X for Ignore
# 8: hostname filter - starting with string
# 9: variable that will be created when we found this process
Example: %/squid -f%;squid proxy;X; 0:20;0:40;X;M;;SQUID;
81
11. python scripts and other files to extract the
Icinga config from GLPI
sap-disk:
# 1: 1=enabled , 0 = disabled !
# 2: warning - X is host default
# 3: critical - X is host default
# 4: mail or sms&mail or ignore M/S/I , default is Ignore
# 5: pattern , like om1
Example: /db2/.*/log_dir;1;20%;15%;S;p;
82
12. python scripts and other files to extract the
Icinga config from GLPI
sap-tcp:
# 1: portnumer
# 2: display
# 3: warntime # 4: crittime
# 5: ssl # 6: certificatewarndays
# 7: http # 8: httpSearchString
# 9: checkIntervall # 10: retryInterval
# 11: mail or sms&mail or ignore M/S/I , default is Ignore
Example: 4443;https;2;3;Y;30,7;X;X;X;X;S
Example: 5044;logstash beats;2;3;X;X;X;X;X;X;M
83
13. Host Configuration – additional GLPI views
84
View
created
from
standard
GLPI
tables
View
created
from
standard
tables
and
tables
created
by
fields
plugin
24. Database configured – additional views
95
View
created
from
standard
tables
and
database
/
fields
plugin
tables
View
created
from
standard
tables
and
database
plugin
tables
30. SAP Instance configured – additional views
101
View
created
from
standard
tables
and
SAP
/
fields
plugin
tables
View
created
from
standard
tables
and
SAP
plugin
tables
31. SAP Instance in Icinga generated from GLPI – mostly via RFC – RZ20
102