metrics-zabbix

metrics-zabbix. Report dropwizard/metrics data to zabbix.

License

License

Categories

Categories

Metrics Application Testing & Monitoring Monitoring
GroupId

GroupId

io.github.hengyunabc
ArtifactId

ArtifactId

metrics-zabbix
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

metrics-zabbix
metrics-zabbix. Report dropwizard/metrics data to zabbix.
Project URL

Project URL

https://github.com/hengyunabc/metrics-zabbix
Source Code Management

Source Code Management

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

Download metrics-zabbix

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
io.github.hengyunabc : zabbix-sender jar 0.0.4
io.dropwizard.metrics : metrics-core jar 3.1.2
org.slf4j : slf4j-api jar 1.7.5

runtime (1)

Group / Artifact Type Version
ch.qos.logback : logback-classic jar 1.0.13

test (5)

Group / Artifact Type Version
io.dropwizard.metrics : metrics-jvm jar 3.1.2
commons-io : commons-io jar 2.4
junit : junit jar 4.12
org.mockito : mockito-core jar 2.7.2
org.assertj : assertj-core jar 3.6.1

Project Modules

There are no modules declared in this project.

metrics-zabbix

Dropwizard Metrics reporter for zabbix. Support zabbix 3.0.

https://github.com/dropwizard/metrics

something

  • This just use zabbix sender to sender data to zabbix. You have to config item and graph in zabbix server by youself. It will not create item auto.

  • If you want to create item in zabbix auto, try to use zabbix Low-level discovery.

https://www.zabbix.com/documentation/2.0/manual/discovery/low_level_discovery

You can use macro in your metric key, such as {#FSNAME}.

##example

import io.github.hengyunabc.metrics.ZabbixReporter;
import io.github.hengyunabc.zabbix.sender.ZabbixSender;

import java.io.IOException;
import java.util.concurrent.TimeUnit;

import com.codahale.metrics.ConsoleReporter;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
import com.codahale.metrics.jvm.MemoryUsageGaugeSet;

public class GetStarted {
	static final MetricRegistry metrics = new MetricRegistry();

	public static void main(String args[]) throws IOException,
			InterruptedException {
		ConsoleReporter reporter = ConsoleReporter.forRegistry(metrics)
				.convertRatesTo(TimeUnit.SECONDS)
				.convertDurationsTo(TimeUnit.MILLISECONDS).build();
		metrics.register("jvm.mem", new MemoryUsageGaugeSet());
		metrics.register("jvm.gc", new GarbageCollectorMetricSet());
		reporter.start(5, TimeUnit.SECONDS);

		String hostName = "192.168.66.29";
		ZabbixSender zabbixSender = new ZabbixSender("192.168.90.102", 10051);
		ZabbixReporter zabbixReporter = ZabbixReporter.forRegistry(metrics)
				.hostName(hostName).prefix("test.").build(zabbixSender);

		zabbixReporter.start(1, TimeUnit.SECONDS);

		TimeUnit.SECONDS.sleep(500);
	}
}

Maven dependency

<dependency>
    <groupId>io.github.hengyunabc</groupId>
    <artifactId>metrics-zabbix</artifactId>
    <version>0.0.5</version>
</dependency>

Others

https://github.com/hengyunabc/zabbix-api

https://github.com/hengyunabc/zabbix-sender

https://github.com/hengyunabc/metrics-kafka

https://github.com/hengyunabc/kafka-zabbix

##License

Apache License V2

Versions

Version
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1