zabbix-sender

zabbix-sender for java

License

License

GroupId

GroupId

io.github.hengyunabc
ArtifactId

ArtifactId

zabbix-sender
Last Version

Last Version

0.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

zabbix-sender
zabbix-sender for java
Project URL

Project URL

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

Source Code Management

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

Download zabbix-sender

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
com.alibaba : fastjson jar 1.2.8
org.apache.httpcomponents : httpclient jar 4.5.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 (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

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.

##Example

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 "testItem", 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("172.17.42.1");
		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

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

Others

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

License

Apache License V2

Versions

Version
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1