Giter VIP home page Giter VIP logo

zabbix-sender's Introduction

zabbix-sender

java zabbix-sender

First you should know zabbix sender:

https://www.zabbix.org/wiki/Docs/protocols/zabbix_sender/2.0

https://www.zabbix.org/wiki/Docs/protocols/zabbix_sender/1.8/java_example

If you don't have a zabbix server, recommend use docker to setup test environment.

https://hub.docker.com/u/zabbix/

Support zabbix server 2.4/3.0. Dependencies: javax.json, gson

##Example/Usage

Zabbix Sender do not create host/item, you have to create them by yourself, or try to use zabbix-api.

  1. Create/select a host in zabbix server.
  2. Create a item in zabbix server, which name is "test_item", type is "Zabbix trapper".
  3. Send data.
  4. If success, you can find data in web browser. Open "Monitoring"/"Latest data", then filter with Item name or Hosts.
		String host = "127.0.0.1";
		int port = 10051;
		ZabbixSender zabbixSender = new ZabbixSender(host, port);

		DataObject dataObject = new DataObject();
		dataObject.setHost("test_host");
		dataObject.setKey("test_item");
		dataObject.setValue("10");
		// TimeUnit is SECONDS.
		dataObject.setClock(System.currentTimeMillis()/1000);
		SenderResult result = zabbixSender.send(dataObject);

		System.out.println("result:" + result);
		if (result.success()) {
			System.out.println("send success.");
		} else {
			System.err.println("sned fail!");
		}

Maven dependency

Forked from

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

License

Apache License V2

zabbix-sender's People

Contributors

hengyunabc avatar twillouer avatar

Watchers

 avatar  avatar

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.