Giter Site home page Giter Site logo

metrics-zabbix's Introduction

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.1.1</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

metrics-zabbix's People

Contributors

cslauritsen avatar dobrovolskiy avatar hengyunabc avatar twillouer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

metrics-zabbix's Issues

Licence

Not an issue per se, but wondered if you were going to add a licence to this so it is available for use?

Thanks

请教个问题。

请问为啥没有通过Zabbix Api写的 metrics reporter呢?
我现在遇到个问题,公司的Zabbix不给开low-level discory ,所以只能过json api来调用。
请问下,有没什么例子可以参考。
谢谢

Does you library works with zabbix 3.0?

A command
zabbix_sender -z zabbixHost -p 10051 -s "dev002-All-Series" -k test.ping.count -o 09
Prints
info from server: "processed: 1; failed: 0; total: 1; seconds spent: 0.017689"

But with your sender I got
processed: 0; failed: 1; total: 1;

Does you library support interaction with zabbix 3.0?

Is it possible to add a "suffix"

Hi,

We experiment LLD and we need to add some things after the metrics name.

like

metrics.name[user,processname]

for the template

jvm.mem.pools.Metaspace.init[{#USER},{#PROCESS}]

The simple way is to add a suffix after the metrics name

ZabbixReporter zabbixReporter = ZabbixReporter.forRegistry(metrics) .hostName(hostName).prefix("test.").suffix("|user,procesname]").build(zabbixSender);
Does it make sense ?

Thanks for your work by the way !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.