차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
zabbix-elasticsearch [2024/04/20 12:05] 14.63.160.16 이전 판으로 되돌림 (2023/11/21 17:27) |
zabbix-elasticsearch [2024/04/27 02:06] 14.63.160.16 이전 판으로 되돌림 (2023/11/21 13:51) |
||
---|---|---|---|
줄 1: | 줄 1: | ||
- | ====== How to configure elasticsearch in zabbix ====== | ||
- | |||
- | * Elasticsearch version: 7.3 | ||
- | * Zabbix-server version: 4.2 | ||
- | * Officlal documentation: | ||
- | |||
- | ===== Zabbix server and frontend ===== | ||
- | |||
- | ==== Zabbix server ==== | ||
- | |||
- | File: / | ||
- | |||
- | < | ||
- | ### Option: HistoryStorageURL | ||
- | # History storage HTTP[S] URL. | ||
- | # | ||
- | # Mandatory: no | ||
- | # Default: | ||
- | # HistoryStorageURL= | ||
- | ### Option: HistoryStorageTypes | ||
- | # Comma separated list of value types to be sent to the history storage. | ||
- | # | ||
- | # Mandatory: no | ||
- | # Default: | ||
- | # HistoryStorageTypes=uint, | ||
- | </ | ||
- | |||
- | For example (on elasticsearch 7.3, only `dbl` working): | ||
- | |||
- | < | ||
- | HistoryStorageURL=http:// | ||
- | HistoryStorageTypes=dbl, | ||
- | </ | ||
- | |||
- | ==== Zabbix frontend ==== | ||
- | |||
- | File: / | ||
- | |||
- | < | ||
- | // Elasticsearch url (can be string if same url is used for all types). | ||
- | $HISTORY[' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ' | ||
- | ]; | ||
- | // Value types stored in Elasticsearch. | ||
- | $HISTORY[' | ||
- | </ | ||
- | |||
- | and modify `global' | ||
- | |||
- | < | ||
- | // Zabbix GUI configuration file. | ||
- | global $DB, $HISTORY; | ||
- | </ | ||
- | |||
- | For example: | ||
- | |||
- | < | ||
- | // Zabbix GUI configuration file. | ||
- | global $DB, $HISTORY; | ||
- | |||
- | (skip) | ||
- | |||
- | $HISTORY[' | ||
- | $HISTORY[' | ||
- | </ | ||
- | |||
- | ===== Creating mapping to Elasticsearch ===== | ||
- | |||
- | ==== What difference between offical document and this? (troubleshooting) ==== | ||
- | |||
- | The `mapping types` was removed on elasticsearch 7.0 and higher. It is cause to occur mapping error. details is [[https:// | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | } | ||
- | </ | ||
- | |||
- | So, you have to following this sentence: | ||
- | |||
- | ==== Creating indices and templates === | ||
- | |||
- | step 1 | ||
- | |||
- | < | ||
- | curl -X PUT \ | ||
- | | ||
- | -H ' | ||
- | -d '{ | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | }' | ||
- | </ | ||
- | |||
- | step 2 | ||
- | |||
- | < | ||
- | curl -X PUT \ | ||
- | | ||
- | -H ' | ||
- | -d '{ | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | }, | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | } | ||
- | }' | ||
- | </ | ||
- | |||
- | step 3 | ||
- | |||
- | < | ||
- | curl -X PUT \ | ||
- | | ||
- | -H ' | ||
- | -d '{ | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | } | ||
- | ] | ||
- | }' | ||
- | </ | ||
- | |||
- | ===== Creating date-based indices on Elasticsearch (Optional) ===== | ||
- | |||
- | Devide indices by each date when creating index. 0 is diable. 1 is enable. | ||
- | |||
- | < | ||
- | ### Option: HistoryStorageDateIndex | ||
- | # Enable preprocessing of history values in history storage to store values in different indices based on date. | ||
- | # 0 - disable | ||
- | # 1 - enable | ||
- | # | ||
- | # Mandatory: no | ||
- | # Default: | ||
- | # HistoryStorageDateIndex=0 | ||
- | </ | ||
- | |||
- | ===== Restart zabbix service ===== | ||
- | |||
- | Do execute command `service zabbix-server restart` or systemd, systemctl, etc. | ||
- | |||
- | ==== Troubleshooting: | ||
- | < | ||
- | 7426: | ||
- | 7426: | ||
- | 7426: | ||
- | 7426: | ||
- | 7426: | ||
- | 7424: | ||
- | 7424: | ||
- | 7424: | ||
- | 7424: | ||
- | </ | ||
![CC Attribution-Share Alike 4.0 International](/wiki/lib/images/license/button/cc-by-sa.png)