Ad Widget

Collapse

Some help writing a Zabbix agent?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gerco
    Junior Member
    • Nov 2006
    • 22

    #1

    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
    Senior Member
    • Sep 2005
    • 870

    #2
    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.
    Unofficial Zabbix Expert
    Blog, Corporate Site

    Comment

    • Alexei
      Founder, CEO
      Zabbix Certified Trainer
      Zabbix Certified SpecialistZabbix Certified Professional
      • Sep 2004
      • 5654

      #3
      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.
      Alexei Vladishev
      Creator of Zabbix, Product manager
      New York | Tokyo | Riga
      My Twitter

      Comment

      • Gerco
        Junior Member
        • Nov 2006
        • 22

        #4
        Sounds interesting indeed, where can I find more information about this training?

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          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.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          • cstackpole
            Senior Member
            Zabbix Certified Specialist
            • Oct 2006
            • 225

            #6
            "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!

            Comment

            • Alexei
              Founder, CEO
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2004
              • 5654

              #7
              No, the information wasn't announced. We're releasing it within next week.
              Alexei Vladishev
              Creator of Zabbix, Product manager
              New York | Tokyo | Riga
              My Twitter

              Comment

              • Alexei
                Founder, CEO
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Sep 2004
                • 5654

                #8
                Details of new training programs were announced today.
                Alexei Vladishev
                Creator of Zabbix, Product manager
                New York | Tokyo | Riga
                My Twitter

                Comment

                • Gerco
                  Junior Member
                  • Nov 2006
                  • 22

                  #9
                  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.

                  Comment

                  • dratliff
                    Member
                    • May 2007
                    • 40

                    #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.

                    Comment

                    • Gerco
                      Junior Member
                      • Nov 2006
                      • 22

                      #11
                      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?...xagentprotocol
                      Last edited by Gerco; 03-08-2007, 14:25.

                      Comment

                      • Gerco
                        Junior Member
                        • Nov 2006
                        • 22

                        #12
                        Originally posted by dratliff
                        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.

                        Comment

                        • dratliff
                          Member
                          • May 2007
                          • 40

                          #13
                          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.

                          Comment

                          Working...