How to push metrics to Zabbix with Java?

1,122 views
Skip to first unread message

王斐

unread,
Aug 26, 2013, 6:00:29 AM8/26/13
to metric...@googlegroups.com
I tried to write a Reporter to push JVM matrics to Zabbix trapper.
but I found that I can only send 2047byte data...
When I tried to send 2048byte,the Zabbix Server only give me a string "OK"

It makes me confused

Coda Hale

unread,
Aug 26, 2013, 9:25:42 AM8/26/13
to metric...@googlegroups.com
This sounds like a problem with Zabbix.


--
You received this message because you are subscribed to the Google Groups "metrics-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to metrics-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Coda Hale
http://codahale.com

Ryan Rupp

unread,
Sep 6, 2013, 1:13:54 PM9/6/13
to metric...@googlegroups.com
Guessing you used the Java sample code snippet that's posted in the Zabbix documentation (https://www.zabbix.org/wiki/Docs/protocols/zabbix_sender/1.8/java_example)? The bit shifting done there fails after 2048 bytes, I can't remember why exactly and unfortunately don't have the code change offhand but basically the protocol is expecting ZBXD1<length_of_data_as_unsigned_int_in_little_endian> - so I think to resolve this I took the data length and converted it to an unsigned int then swapped the byte order from big endian to little endian (Zabbix forums may have a more elegant way to do this in Java).
Reply all
Reply to author
Forward
0 new messages