Skip to content

Zabbix Agent for monitoring temperature and humidity based on Arduino

Notifications You must be signed in to change notification settings

disasstor/Server-Room-Monitoring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this?

Server Room Monitoring - a device for monitoring temperature and humidity of servers, server rooms and just for rooms where environmental control is needed.

The differences between this system and Zabbuino in open source for the Arduino IDE. Anyone can customize the device to suit their needs.
You can remove the display if display control is not needed, or change it to any other display by rewriting the code a bit.
You can add or remove any sensor, for example, you can control the content of carbon dioxide or dust particles in the air, everything that you can implement on Arduino.


How its work?

Server Room Monitoring works as a passive zabbix agent. The Zabbix server polls the agent on a schedule, the agent generates data and sends it to the Zabbix server.


Electronic circuit:


Components that I used:

ARDUINO UNO R3 - BASE
ETHERNET SHIELD W5100 - EXTEND SHIELD FOR ARDUINO
SHT31 - TEMPERATURE AND HUMIDITY SENSOR
DS18B20 - TEMPERATURE SENSOR
LCD 1602 I2C - DISPLAY
RESISTOR 4.7K - PULL-UP RESISTOR
D6MG DIN RAIL MOUNTING ENCLOSURE - BOX FOR ARDUINO
RJ45 CAT5 DUAL PORT SURFACE MOUNT BOX - BOX FOR SENSORS
RJ45 CAT5 SINGLE PORT SURFACE MOUNT BOX - BOX FOR CONNECTING SENSORS TO ARDUINO

Libraries that I used:


System Settings:

Setting LCD 1602 or similar (2004 etc)
LCD_ADDRESS - put your address of display
LCD_H - put your number of horizontal screen characters
LCD_V - put your number of vertical screen characters
#define LCD_ADDRESS 0x3F          // i2c address of display
#define LCD_H 16                  // number of horizontal screen characters
#define LCD_V 2                   // number of vertical screen characters

SHT3X settings:
SHT31_ADDRESS - put your address of SHT31
#define SHT31_ADDRESS 0x44        // i2c address of SHT3X

You'll need a Scanner I2C to find the display and sht31 addresses


OneWire settings:
ONE_WIRE_BUS - put your arduino number of pin where OneWire is connected
#define ONE_WIRE_BUS 2            // Pin Onewire (DT18B20) bus

Intervals settings:
MEASUREMENTDELTA - sensor polling interval
LCDINTERVAL - display refresh interval
#define MEASUREMENTDELTA 10000    // Sensor polling interval
#define LCDINTERVAL 5000          // Display refresh interval

DeviceAddress - put your address of ds18b20
// OneWire sensor address array(you need to change the address to yours)
DeviceAddress addrsensdt[] = {
  { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },	  // Must be emty (0x00)
  { 0x28, 0x66, 0x66, 0x83, 0x18, 0x20, 0x01, 0x43 },	  // Address of the first sensor
  { 0x28, 0xC0, 0x69, 0x8C, 0x18, 0x20, 0x01, 0x58 },	  // Address of the second sensor
  { 0x28, 0x2C, 0xBA, 0xC3, 0x18, 0x20, 0x01, 0x66 },	  // Address of the third sensor
  { 0x28, 0x09, 0x0F, 0xA9, 0x18, 0x20, 0x01, 0x2D },	  // Address of the fourth sensor
  { 0x28, 0x7E, 0x30, 0x83, 0x18, 0x20, 0x01, 0xB0 },	  // Address of the fifth sensor
};

You'll need Scanner OneWire to find ds18b20 addresses


Zabbix Agent Settings:

ItemKey - put your key
String ItemKey = "GetData"      //Item key of zabbix host

Read more about item key here


Network Settings:

Сonfigure the network settings to be correct for your local network
Important! Change MAC address! MAC address must be unique on your local network.
byte mac[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };  // Important! Change MAC address!
                                                      // MAC address must be unique on your local network.
IPAddress ip(192, 168, 0, 100);                       // Change IP address if you need.
IPAddress gateway(192, 168, 0, 1);                    // Change GW if you need.
IPAddress subnet(255, 255, 255, 0);                   // Change MASK if you need.
EthernetServer server(10050);                         // Change port if you need.

Zabbix Server Settings:


This is an example setup.

  1. Create host with parameters:
  • Name: Server Room Monitoring
  • Interface:
    • Type: Agent
    • IP: IP address Server Room Monitoring

  1. Create item with parameters:
  • Name: "Data"
  • Type: "Zabbix agent"
  • Key: "GetData"
  • Type of information: "text"
  • Update interval: 10m
Ok, now you can turn on the device and get data from Server Room Monitoring. The data of all sensor will come in a text format with a "," delimiter.

Example data string: 23,24,25,26,24,25,46.
The first parameter is the temperature with SHT31.
The second - the first DS18B20 and so on.
The last parameter is humidity from the SHT31 sensor.
Dependent item and regular expressions are used to separate the parameters and pass each parameter to an individual item.


  1. Create dependents items with parameters:
  • Item#1:

    • Name: 'Air humidity in server room'
    • Type: 'DEPENDENT'
    • Key: 'humidity'
    • Delay: '0'
    • Units: '%'
    • Description: 'Data from sensor SHT3X'
  • Preprocessing:

    • Type: REGEX
    • Parameters: '(\d+),(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)' '\7'

  • Item#2:

    • Name: 'Air temperature in server room'
    • Type: 'DEPENDENT'
    • Key: 'temperature.0'
    • Delay: '0'
    • Units: 'C'
    • Description: 'Data from sensor SHT3X'
  • Preprocessing:

    • Type: REGEX
    • Parameters: '(\d+),(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)' '\1'

  • Item#3:

    • Name: 'Air temperature in server room'
    • Type: 'DEPENDENT'
    • Key: 'temperature.1'
    • Delay: '0'
    • Units: 'C'
    • Description: 'Data from sensor DS18B20'
  • Preprocessing:

    • Type: REGEX
    • Parameters: '(\d+),(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)' '\2'
And so on

You can see my template to understand it.


Install components to sensor boxes

First step:

We need to make wiring and install the sensor in the box, you need to make 5 pieces, these will be blanks.

RJ45 wiring RJ45 install DS18B20

Second step:

Install SHT31 in first box

RJ45 wiring

Third step:

Install pull-up resistor in last box

RJ45 wiring

The result you should have is:

Pinout RJ45 Mounting Boxes

Device photo

About

Zabbix Agent for monitoring temperature and humidity based on Arduino

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages