Commit 573531b0 authored by Ecklory's avatar Ecklory

Refactoring in README.md

parent f5154924
# zabbix-agent-extension-elasticsearch
# Elasticsearch template for Zabbix
zabbix-agent-extension-elasticsearch - this extension for monitoring Elasticsearch cluster and node health/status.
### Supported features
This extension obtains stats of two types:
ROOT:
BUILD AND INSTALLING
Download golang:
cd ~ && wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz && tar -xvzf go1.14.1.linux-amd64.tar.gz && rm go1.14.1.linux-amd64.tar.gz
Added path:
export PATH=$PATH:/root/go/bin
Install git:
apt -y --no-install-recommends install git
Install dep:
cd /root/go/bin && wget https://raw.githubusercontent.com/golang/dep/master/install.sh && chmod +x install.sh && ./install.sh && cd ~
Build:
git clone https://git.ckcorp.ru/ck/zabbix/elasticsearch && cd elasticsearch/src && apt -y --no-install-recommends install make && make
## Features
- Monitoring cluster and node health/status.
#### Node stat
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html
- [ ] roles
......@@ -46,7 +24,9 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-st
- [ ] ingest
#### Cluster health
https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html
- [x] cluster_name
- [x] status
- [x] timed_out
......@@ -69,71 +49,79 @@ https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.h
- [x] task_max_waiting_in_queue_millis
- [x] active_shards_percent_as_number
### Installation
## System requirements
##### Notice
- Ubuntu 18.04
- Zabbix 4.0
Before manual installation you should check `Include` option in your `zabbix-agent` configuration, it should be uncomment and check that include path are the same with this installation rule - https://github.com/zarplata/zabbix-agent-extension-elasticsearch/blob/master/Makefile#L54 otherwise you should change it to your include path.
## Installation
After installation you should restart your `zabbix-agent` manually for inclusion new `UserParameter` from extension configuration.
### 1. Set configuration file
#### Manual build
#### Linux
```sh
# Building
git clone https://github.com/zarplata/zabbix-agent-extension-elasticsearch.git
cd zabbix-agent-extension-elasticsearch
make
Download the latest version of configuration file `userparameter_elasticsearch.conf`.<br>
Put the file here `/etc/zabbix/zabbix_agentd.d/userparameter_elasticsearch.conf`.
#Installing
make install
Below is an example for Ubuntu 18.04, all operations are performed under root.
# By default, binary installs into /usr/bin/ and zabbix config in /etc/zabbix/zabbix_agentd.conf.d/ but,
# you may manually copy binary to your executable path and zabbix config to specific include directory
```
### 2. Grant access to
#### Linux
#### Arch Linux package
```sh
# Building
git clone https://github.com/zarplata/zabbix-agent-extension-elasticsearch.git
git checkout pkgbuild
```bash
chmod 644 /etc/zabbix/zabbix_agentd.d/userparameter_elasticsearch.conf
chown root:zabbix /etc/zabbix/zabbix_agentd.d/userparameter_elasticsearch.conf
```
##### Building
./build.sh
Download golang:
#Installing
pacman -U *.tar.xz
```console
cd ~ && wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz && tar -xvzf go1.14.1.linux-amd64.tar.gz && rm go1.14.1.linux-amd64.tar.gz
```
### Dependencies
Added path:
zabbix-agent-extension-elasticsearch requires [zabbix-agent](http://www.zabbix.com/download) v2.4+ to run.
```console
export PATH=$PATH:/root/go/bin
```
### Zabbix configuration
In order to start getting metrics, it is enough to import template and attach it to monitored node.
Install git:
`WARNING:` You must define macro with name - `{$ZABBIX_SERVER_IP}` in global or local (template) scope with IP address of zabbix server.
```console
apt -y --no-install-recommends install git
```
On one node of cluster set MACRO `{$GROUPNAME}` = `REAL_ZABBIX_GROUP`. This group must include all nodes of the cluster.
Only this one node will be triggered cluster status (low level discovery added aggregate checks of cluster health).
Install dep:
### Customize key prefix
It may you need if key in template already used.
```console
cd /root/go/bin && wget https://raw.githubusercontent.com/golang/dep/master/install.sh && chmod +x install.sh && ./install.sh && cd ~
```
If you need change key `elasticsearch.*` -> `YOUR_PREFIX_PART.elasticsearch.*`, run script `custom_key_template.sh` whit `YOUR_PREFIX_PART` and import updated zabbix template `template_elasticsearch_service.xml`.
Build:
```sh
./custom_key_template.sh YOUR_PREFIX_PART
```console
git clone https://git.ckcorp.ru/ck/zabbix/elasticsearch && cd elasticsearch/src && apt -y --no-install-recommends install make && make
```
### Elasticsearch API authentication (X-Pack security)
### Restart Zabbix Agent
This extension support basic authentication which provided by X-Pack. For authentication in Elasticsearch you must set valid values in template macros - `${ES_USER}` and `${ES_PASSWORD}`
#### Linux
### Customize Elasticsearch address.
```console
systemctl restart zabbix-agent.service
```
You can customize you Elasticsearch listen address.
Just change`{$ES_ADDRESS}` macros in template.
Possible values are - `(http|https)://host:port`
### Configure the Zabbix Web Frontend
Be note if you choose `https` and have self-signed certificate you also should add path to you CA in marcos `{$CA_PATH}`
1. Import the template file into Zabbix web interface. Use `zabbix_template_elasticsearch.xml`.
2. Assign the template to a host that you want to monitor.
3. Added macro:
- {$ZABBIX_SERVER_IP} = your zabbix server ip
- On one node of cluster set MACRO `{$GROUPNAME}` = `REAL_ZABBIX_GROUP`. This group must include all nodes of the cluster.
Only this one node will be triggered cluster status (low level discovery added aggregate checks of cluster health).
- If you have an X-Pack or Opendistro, then you need to add `{$ES_USER}` and `{$ES_PASSWORD}`.
- If the elasticsearch address is not standard, add `{$ES_ADDRESS}` (Possible values are - `(http | https)://host:port`).
- If elasticsearch is accessible via https, then add the path to CA by adding `{$CA_PATH}`.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment