View Full Version : Some help writing a Zabbix agent?
Because of my particular need in Zabbix to have a few hundred custom items published to Zabbix, neither zabbix_trapperd or UserParameters are doing the job properly. Zabbix_trapperd comes close, but is difficult to maintain when using hundreds of items.
My environment (a Sonic MQ/ESB domain) can be viewed as a seperate host from any physical host, because it runs on several and components tend to move around once in a while, so the items would have to change servers every now and then.
Because of this, I have a separate host configured, just for the Sonic items and send to this host with zabbix_sender and/or my own implementation thereof (in Java, to run inside Sonic). I would like to write a genuine Zabbix agent, just for Sonic. This agent would not monitor stuff like free disk space or used memory, that is reserved for the agent monitoring the physical machine.
My problem is that I can't find any documentation on how to write an agent. I understand it isn't a very common thing to do, but there might be some protocol documentation available.
Does anyone know where to find documentation about the zabbix<->agent protocol, other than the zabbix sourcecode?
bbrendon
06-07-2007, 06:39
There is some php code floating around. That might help. If you're truly trying to write an agent, the src is probably your best bet.
We are introducing a special two-day training course, ZABBIX Internals, in July. You might be interested! Server-agent comms, database structure, details of ZABBIX architecture, and more topics will be covered.
Sounds interesting indeed, where can I find more information about this training?
More information about two new training programs, "ZABBIX Internals" and "ZABBIX Distributed Monitoring", will be innounced in second half of July. The information will be available on our WEB site. I will try to post a link here as well.
cstackpole
18-07-2007, 18:17
"two new training programs, "ZABBIX Internals" and "ZABBIX Distributed Monitoring", will be innounced in second half of July"
Hello Alexei,
I looked around the website and didn't see mention of these events. Have they been announced yet? Where on the web page (webpage/forum) would they go?
Thanks!
No, the information wasn't announced. We're releasing it within next week.
Details of new training programs were announced today.
I am unable to attend the trainings, I'm afraid. I have begun documenting the protocols myself instead. I have written a working agent for 1.1.4 and 1.4.1 (both active and passive checks supported) by looking at the code and analyzing the network traffic.
I had already written up my findings about the zabbix_sender protocol and have created a wiki page to hold the protocol descriptions: http://www.zabbix.com/wiki/doku.php?id=zabbixprotocol .
In the coming week(s), I'll write up the documentation about the agent protocols and post them to that page. Unfortunately, my employer will not take kindly to me releasing the source code to my agent, so that's not going to happen. Documentation however, is possible.
dratliff
30-07-2007, 15:10
Very Nice Gerco!
Have you checked out the timestamp tag? It is listed in the code. I have tried to make it work and I cannot get it to force a timestamp. I don't want to use a timestamp provided by zabbix because my data is sometimes behind real-time. It is basically generated data values with a timestamp of when the initial event took place.
I updated the page with a description of the agent protocols (passive checks only, still working on active checks), please read and comment.
http://www.zabbix.com/wiki/doku.php?id=zabbixagentprotocol
Very Nice Gerco!
Have you checked out the timestamp tag? It is listed in the code. I have tried to make it work and I cannot get it to force a timestamp.
I've looked over the code and it seems that the timestamp is only used with items of type "log", more specifically, only with items having a key that starts with "log[" or "eventlog[", hardcoded in 1.4.1.
If you want to force a timestamp on other types of items, you'll have to (have someone) write a patch to do so.
dratliff
07-08-2007, 13:59
Ya, a patch would do it. I don't have time to try to make changes. I have requested it in 1.6 features. I think it is something that everyone would want if they start to creating their own custom senders.