metrics-zabbix

Metrics zabbix adapter for reporting and monitor metrics with zabbix

Лицензия

Лицензия

Категории

Категории

Metrics Тестирование приложения и мониторинг Monitoring
Группа

Группа

com.janramm
Идентификатор

Идентификатор

metrics-zabbix
Последняя версия

Последняя версия

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

metrics-zabbix
Metrics zabbix adapter for reporting and monitor metrics with zabbix
Ссылка на сайт

Ссылка на сайт

https://github.com/janramm87/metrics-zabbix
Система контроля версий

Система контроля версий

https://github.com/janramm87/metrics-zabbix

Скачать metrics-zabbix

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.janramm/metrics-zabbix/ -->
<dependency>
    <groupId>com.janramm</groupId>
    <artifactId>metrics-zabbix</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.janramm/metrics-zabbix/
implementation 'com.janramm:metrics-zabbix:0.0.1'
// https://jarcasting.com/artifacts/com.janramm/metrics-zabbix/
implementation ("com.janramm:metrics-zabbix:0.0.1")
'com.janramm:metrics-zabbix:jar:0.0.1'
<dependency org="com.janramm" name="metrics-zabbix" rev="0.0.1">
  <artifact name="metrics-zabbix" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.janramm', module='metrics-zabbix', version='0.0.1')
)
libraryDependencies += "com.janramm" % "metrics-zabbix" % "0.0.1"
[com.janramm/metrics-zabbix "0.0.1"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.quigley : zabbixj jar 1.0.1
com.codahale.metrics : metrics-core jar 3.0.1
org.slf4j : slf4j-api jar 1.7.2
org.slf4j : slf4j-log4j12 jar 1.7.2

Модули Проекта

Данный проект не имеет модулей.

metrics-zabbix

This project is a small addon for metrics in order to report measures to Zabbix.

Import with Maven:

...
<dependency>
  <groupId>com.janramm</groupId>
  <artifactId>metrics-zabbix</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>
...

Example:

Our source contains a counter called test and our host (zabbix name) is macbook-jramm

In order to monitor that counter we have to integrate some source code and have to configure zabbix.

Source code:

ZabbixAgent agent = new ZabbixAgent();
agent.setEnableActive(true);
agent.setEnablePassive(false);
agent.setHostName("macbook-jramm");
agent.setServerAddress(InetAddress.getByName("zabbix.janramm.com"));
agent.setServerPort(10051);
final MetricRegistry metrics = new MetricRegistry();

ZabbixMetricsAgent zabbixMetricsAgent = new ZabbixMetricsAgent(metrics, agent);
zabbixMetricsAgent.start();

Counter counter = metrics.counter("test");
agent.start();

counter.inc();

Thread.sleep(1000);
counter.inc();

Thread.sleep(35000);

zabbixMetricsAgent.stop();
agent.stop();

Zabbix configuration:

  • create a host called macbook-jramm
  • create an item with the following configuration:
    • test.test (metricname.metric-key)
    • Zabbix agent (active)

MetricKeys

The supported metric-keys depends on the metric type

Counter

any metric-key specified will return the current count

Gauge

any metric-key specified will return the current count

Histogram

supported metric-keys:

MAX,
MIN,
MEDIAN,
MEAN,
STDDEV, 
P75TH,
P95TH,
P98TH,
P99TH,
P999TH,
COUNT
Meter

supported metric-keys:

MEAN_RATE,
ONE_MINUTE_RATE,
FIVE_MINUTE_RATE,
FIFTEEN_MINUTE_RATE,
COUNT
Timer

supported metric-keys:

MEAN_RATE,
ONE_MINUTE_RATE,
FIVE_MINUTE_RATE,
FIFTEEN_MINUTE_RATE,
COUNT
MAX,
MIN,
MEDIAN,
MEAN,
STDDEV,
P75TH,
P95TH,
P98TH,
P99TH,
P999TH

Версии библиотеки

Версия
0.0.1