Ad Widget

Collapse

A hardware ZABBIX Agent made with Arduino Mega

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • levkov
    Junior Member
    • Jun 2010
    • 12

    #1

    A hardware ZABBIX Agent made with Arduino Mega

    Hi all,

    I created a stand alone, hardware ZABBIX Agent (running Zabbix Agent-like firmware directly on micro-controller) using Arduino Mega 2560 Board + Ethernet Shield (Wiznet W5100). This device equipped with DHT22 temperature-humidity sensor.

    Current (ZSA1-E model) Features:

    1. Measures temperature and humidity using calibrated digital sensor
    2. Direct monitoring with Zabbix Server (behave like Zabbix agent in passive mode)
    3. Can support PoE 802.3 (need special Ethernet Shield with PoE support)
    4. Cheap: 50~60$ for all parts price (based on Alibaba and Sparkfun prices, shipping included)
    5. Can be easy assembled (minimal soldering and enclosure modification)
    6. Web based network setting setup (save network settings in EEPROM)

    It's firmware and design will be free and open source. (I will post it on Github after code cleanup+documentation). Also Wi-Fi version (with the same form factor) and support for additional sensors (dust, motion, light, Co2..etc) will be implemented in near future.

    Pictures and Screenshots:






    Last edited by levkov; 02-11-2012, 22:52.
  • dimi
    Junior Member
    Zabbix Certified Trainer

    • Nov 2004
    • 13

    #2
    Hi levkov
    very nice work! You have implemented the Zabbix protocol inside Arduino? Is it possible to configure as Zabbix Active Agent (better for NAT enviroment)?
    Thanks so much

    Comment

    • levkov
      Junior Member
      • Jun 2010
      • 12

      #3
      Yes Zabbix recognize Arduino as Zabbix Agent host.
      I am going to implement active checks in near future (although it's not trivial).

      Meanwhile I am posting source code of first version of Arduino based Hardware Zabbix Agent with DHT22 temperature-humidity sensor:

      Embedded Zabbix Agent Sensor. Contribute to levkov/sensor.im development by creating an account on GitHub.


      Item Names:
      agent.ping - Zabbix Agent ping
      agent.version - return agent version
      humidity.read - % of air humidity
      temperature.read - air temperature (Celsius)

      Soon I will post assembly instructions with pictures.
      Last edited by levkov; 12-11-2012, 13:30.

      Comment

      • levkov
        Junior Member
        • Jun 2010
        • 12

        #4
        Electronic Diagram:
        Embedded Zabbix Agent Sensor. Contribute to levkov/sensor.im development by creating an account on GitHub.

        Comment

        • alfsolli
          Junior Member
          Zabbix Certified Trainer
          Zabbix Certified Specialist
          • Aug 2010
          • 19

          #5
          Way cool!

          I've been thinkering with the Zabbix agent protocol on atmega 328, but it's been dead for a while as my charming wife and insane kids takes up alot of time.

          But question; Is there a reason you used a Mega 2560 ? Will this run on an AVR with less memory, like the 32KB 328 ?

          Is it stable?

          Awesome work

          Comment

          • Colttt
            Senior Member
            Zabbix Certified Specialist
            • Mar 2009
            • 878

            #6
            Very nice work!!

            how many sensors can i use for this system?! "only" 2 ?

            maybe you can use something like this:
            sensor.1
            sensor.2
            sensor.3
            and so on..
            Debian-User

            Sorry for my bad english

            Comment

            • levkov
              Junior Member
              • Jun 2010
              • 12

              #7
              alfsolli:
              Thank you. I choose Mega because form factor ( In enclosure it's hard to access IO pins on the top of Ethernet shield. I will explain it when I will post assembly instructions). It will run on AVR with less memory, current compiled firmware is around 20K size, so 32K is enough.
              Yes, it's very stable. No OS, no services, no drivers...It's just running directly on hardware chip

              Shad0w:
              In the future version of firmware it will be possible to change item names using web config page.

              It's possible to connect many sensors to the board. 54 digital pins on the Mega can be used as an input or output,16 analog inputs, 4 UARTs (hardware serial ports)

              Comment

              • alfsolli
                Junior Member
                Zabbix Certified Trainer
                Zabbix Certified Specialist
                • Aug 2010
                • 19

                #8
                What Zabbix version are you running?

                I just tested this on a Arduino Ethernet with PoE, and it works just fine.

                agent.ping however, returned a value ("ZBXD1") which was not a suitible reply for the templated Zabbix agent ping. I rewrite it to simply server.println("1"); and it worked as expected.

                if(cmd.equals("agent.ping")) {
                server.println("ZBXD1"); <- skip "ZBXD"

                Just wondering, what version are you running? I'm at 2.0.3.

                Comment

                • levkov
                  Junior Member
                  • Jun 2010
                  • 12

                  #9
                  As I found in in documentation, agent.ping answer have to be "ZBXD\1" so "ZBXD1" is incorrect, but it worked with my test Zabbix VM.

                  I use 2.0.3 at work and 1.8.x in test Zabbix VM.

                  Soon I will change it to return "1" and update source code. Thank you for your fix.

                  Comment

                  • levkov
                    Junior Member
                    • Jun 2010
                    • 12

                    #10
                    Assembly pictures

                    Here are assembly pictures. As you can see, enclosure size make it almost impossible to use pins on the top of Ethernet shield. This is the main reason why Arduino Mega was chosen for this project - because additional, accessible pins to connect sensors.





                    Comment

                    • levkov
                      Junior Member
                      • Jun 2010
                      • 12

                      #11
                      Source code fixed to return "1" on agent.ping request.

                      Embedded Zabbix Agent Sensor. Contribute to levkov/sensor.im development by creating an account on GitHub.

                      Comment

                      • alfsolli
                        Junior Member
                        Zabbix Certified Trainer
                        Zabbix Certified Specialist
                        • Aug 2010
                        • 19

                        #12
                        Hi

                        levkov, don't know if you've dropped by here yet, but I sent you a pm.

                        Comment

                        • levkov
                          Junior Member
                          • Jun 2010
                          • 12

                          #13
                          alfsolli,
                          I sent you reply using P.M. but I don't see it in sent messages. Please inform me if you didn't received it.

                          Comment

                          • levkov
                            Junior Member
                            • Jun 2010
                            • 12

                            #14
                            New enclosure and camera

                            I have found new enclosure for my Zabbix (Arduino Based) Sensor Agent project. It it looks more solid


                            Also I had success to connect camera to the agent. It's used to detect movement. It can be used in day and night (built in "night vision"). So now it possible to monitor movement using Zabbix.






                            Relevant source code for movement detection we be published in near future on Github. I will inform about it here.

                            Comment

                            • qix
                              Senior Member
                              Zabbix Certified SpecialistZabbix Certified Professional
                              • Oct 2006
                              • 423

                              #15
                              Awesome! I had been planning to do this myself for a while now.

                              I'll test your code as soon as I get a chance :-)
                              (my arduino's are at my local hackerspace currently and I don't think I'll go there for about 2 to 3 weeks.)

                              I'll let you know if it works!
                              With kind regards,

                              Raymond

                              Comment

                              Working...