📜 ⬆️ ⬇️

Environmental monitoring in the server room (Bolid + Zabbix)

Probably the easiest way for an IT professional to solve the problem of monitoring the environment in a server room would be to use specialized controllers with issuing data via SNMP (for example, NetBotz or NetPing). But for those who are not afraid of difficulties and want to get an inexpensive solution at the industrial level (with the serial production of equipment) - there is an interesting option with the Modbus protocol.



Below I will describe the monitoring system based on Russian-made components - BVD, and we will “merge” the data in Zabbix 4.0. NVP "Bolid" is widely known in the circles of fire and security automatics and the decision in question will carry this "imprint". Their devices, to put it mildly, do not differ in the design and thoughtfulness of the cases, but ... the price more than compensates for all these shortcomings. It is worth noting very good documentation and more or less normal free technical support.

Protocols and interfaces


Before turning to the "hardware" very briefly consider the protocols and interfaces used:

Modbus : industrial protocol, built on the principle of "Master" (Master) - "Slave" (Slave). In the Modbus network, there can be only one master who interrogates the slaves and “tells” what to do. It can use RS-485 (Modbus RTU) or Ethernet (Modbus TCP) interface as a transmission medium. Theoretically, the maximum number of devices - 247.

Orion : the proprietary protocol of the company NVP “Bolid”, built on the principle of “Master” (Master) - “Slave” (Slave). Apparently, the modified RS-485 interface is used as the data transmission medium, due to which the maximum line length can reach 3 km (!). The maximum number of devices - 127.

DPLS (two-wire communication line): the proprietary protocol of the company NVP "Bolid", built on the principle of "Master" (Master) - "Slave" (Slave). Copper pair cable is used as data transmission medium (“twisted pair” is recommended). The maximum number of devices - 127 + 1. The topology is a bus (or ring) with branches, the maximum length of the line can reach 1.5 km (depends on the type of cable, the cross section of the cables and the number of connected devices).

RS-485 : physical layer interface, uses “twisted pair” for data transfer (one “2-wire” or two pairs “4-wire”, the second is less common). The stated maximum line length is 1.2 km. Topology - tire.

As you can see, rather long-distance communication lines are used. In all protocols, device addressing is set by "handles" (pre-configuration).

Sensors


The system assumes the connection of “special” (proprietary) address sensors (more strictly speaking, “detectors”, i.e. devices with a built-in sensor), but you can also connect “regular” untargeted ones using address expanders (from 1 to 8 inputs). The use of addressable detectors offers two advantages: almost all addressable devices are powered via a signal line (i.e., there is no need to connect a separate 12V power line) and there is no need to place an address expander anywhere. Sensors are connected to the DPLS .
The range of "terminal" equipment is quite wide, but I will give what may be required when solving our problem:


Appearance of sensors



A complete list of equipment, see the official website of the manufacturer .

Controller


The "line" of controllers, so to speak, consists of three models:


Appearance of controllers


It is best to use the S2000-KDL-Modbus, but you can also use the S2000-KDL / C2000-KDL-2I with the S2000-PP protocol converter installed next to it, which has a “panel mounting” design.

The controller performs the role of "Master" in the DPLS line (only one DPLS line can be connected to one controller), and in the Orion RS-485 line it already acts as the "Slave" and cannot take data from it "directly". For data acquisition in the RS-485 Orion lines, the so-called S2000M or S2000-PP console (including in the built version) is used, which already have standardized data transmission interfaces.

In the above controllers can also highlight the following characteristics:


For system resiliency, you can use the following measures (which are optional):


IMPORTANT: new firmware is constantly being released on the controllers, which eliminate errors and add functionality, and firmware S2000-KDL and S2000-KDL-2I are incompatible.

Modbus connection


As described earlier, you can use either the S2000-Modbus controller or the S2000-PP converter. Both schemes provide for the issuance of signals via the Modbus RTU 2-wire protocol using RS-485 as a slave device (our master is Zabbix or some SCADA system). To connect to the server, you can use two methods:


There are two possible schemes for sending events to the Modbus protocol:


Examples of system diagrams






Power and installation


The power supply requires a 12V DC power supply, preferably stabilized and mounted on a DIN rail. Its power (usually indicated either in mA or A) can be roughly matched at the rate of 1 controller - 500 mA. I would recommend using a redundant power source (with built-in battery, RIP) only when using the S2000M remote control. And be sure to connect the power supply to the same uninterruptible power supply (UPS) as the monitoring system server.

You can of course mount all this on the wall, but we leave it for the installers of security and fire alarms, and use the 3U DIN-rail for mounting in a 19 "cabinet (for example, TsMO PS-3U or Cabeus with the same part number, the front panel will have to be thrown out In the case of using the S2000-M remote control, you can use a 19 "4U plug (preferably perforated), which will serve as a mounting plate and to which you will already fix the DIN rail for the terminals and the controller. Minus of the decision - the equipment supports the assembly 19 "plane.

Assembling and assembling a system from components should not raise questions, but pay attention to the following:


For those who do not want to solder, but likes to crimp the "chips", you can use the option described below (probably, it’s better to use RJ11, so as not to accidentally switch the DPLS line to the server).

It will take:


On one pair we start DPLS, on the other, for example, 12V DC. Connecting sensors through splitters.

Explanatory image


Stand assembly


For the "practical" part a stand was assembled consisting of:




Refinement of the thin client and the appearance of the stand
Thin client was a bit "finished":

  • A 2GB DOM module with Windows XP embedded installed was replaced with 2.5 HDD ATA 60GB from an old laptop (I had to buy a cable, SATA-HDD for some reason did not pick up - the SATA port included in the BIOS);
  • increased the size of DDR2 SO-DIMM RAM from 1GB to 2GB;
  • Linux Mint 19.1 “Tessa” Xfce Edition is installed and remote desktop is configured using TightVNC;
  • “Modified” cooling system - reduced the radiator to fit the HDD almost “flush” with the case, removed the top cover and a 120 mm fan connected through a resistor to the top. Immediately lost all the "brakes", it was quite responsible to work.




Setting up the car equipment


All configuration is done in the Windows environment, respectively, before starting work, you need to install the driver on the RS-485 / USB adapter, as well as two “super” programs from BHP, which are supplied free of charge: Orion-prog and Uprog . Next, the devices are separately connected to the RS-485 / USB adapter to the AB RS-485 “Orion” ports (direct layout is used, and not like on COM ports).

IMPORTANT: for all subsequent steps at S2000-PP jumper XP1 on the board should be removed.

Step 1. Insert the RS-485 / USB adapter into the USB connector and look at the device manager which COM port number is assigned to the adapter. Drivers for the adapter must be installed without exclamation marks in the "Device Manager".

Step 2. On behalf of the administrator, launch Orion-prog, select the required COM port and search for and view the firmware version of the device. Go to the manufacturer's official website and check for a more recent firmware and, if necessary (most likely required) - perform an update (at the time of writing this article: for S2000-PP - 1.32, S2000-KDL - 2.22).

Instrument firmware in pictures


* In fact, firmware 1.32 was set “crookedly” - the Uprog configuration was not read from the device. Therefore, "rolled back" back to 1.31.

Step 3. Setting the address at the instruments (first with S2000-PP, for example, 2 and then with S2000-KDL - 3). To do this, run the Uprog - all devices have the default address 127, so you need to configure the devices at the beginning one by one. For more detailed videos from the manufacturer, see YouTube .

Step 4. After setting the address on the S2000-KDL, it is necessary to set the addresses of the sensors in the two-wire communication line (DPLS). They also have the default address 127 (and the circle with the sensor in the Uprog is not highlighted). We read the device configuration (Ctrl + F3) and in series connect the sensors to the DPLS outputs, setting addresses. When pointing to the sensor in the context menu “Request AU Type”, you can specify the type of sensor or “Request A / D ADC” - find out if the sensor works (for example, for a magnetic-contact detector ADC when closing: 100, and when opening: 50). In fact, I have the following address configuration: 1 - reed switch S2000-SMK, 2 - temperature C2000-BT, 3 - humidity C2000-BT, 4 - leakage C2000-DZ, 5 - address extender S2000-AP1 isp. 02 (with the Foton-10M volume detector connected to it).

Assigning addresses to sensors in pictures


Next, go to the "Inputs" tab and do the following:


Setup of entrances to S2000-KDL in pictures


After all the “manipulations” with the S2000-KDL, we perform the “Configuration recording in the device”.

Step 5. Configure S2000-PP.
On the tab "Device" settings are shown in the picture (this is the most "running" and on most devices they go by default). Similar settings should be at the COM-port of the RS-485 / USB adapter and any other device connected to the Modbus network. For the S2000-PP device in the Modbus network, I chose address 11 (the address in the Orion system is 2!).



Then go to the tab "Devices" and begin to fill in the "Zone Table":




After setting up the S2000-PP, we perform the “Record of the configuration in the device”.

Step 6. We connect S2000-PP and S2000-KDL to the network via RS-485 Orion, connect the sensors to the S2000-KDL (can be a bunch of two terminals), and connect the RS-485 / USB adapter to the Modbus C2000-PP output. The XP1 jumper is installed in the closed position (important: after installing the jumper, the device must be reset by resetting the supply voltage). All - the system is "ready for battle."

We check the "operability" in the free console program Modpoll Modbus Master Simulator (hereinafter - "Modpoll"), for example, at the address of the firmware "S2000-PP" or by returning information from the S2000-KDL to the address "40000" - this is the first sensor:



Firmware devices "for review" can be downloaded here .

Zabbix configuration


Warning: Zabbix was configured for the first time, like Linux Mint (since there is no Zabbix for Windows) :)

After installing Zabbix, you need to install the autoconf , automake , libtool , pkg-config packages and then the extension module - libzbxmodbus . About him on HabrĂŠ there is a separate article (I will constantly refer to it) and it has recently been updated, just to work with Zabbix 4.0. The article also has more detailed information on the Modbus protocol. The module itself and more or less detailed instructions are on GitHub .

Small differences in installation from that specified on GitHub:

... ./configure --prefix=/etc/zabbix --enable-zabbix-3.2 ... sudo make install 

Studying the work of the libzbxmodbus module, it became clear that using the S2000M remote control circuit would not work, because in this case, receiving data from the thermohygrometers looks like this: writing the number of the necessary zone to the register 46179 and then taking the data from the register 46328 - very nontrivial (in “large” SCADA systems, this is possible, for example, in MasterSCADA).

Register in the configuration file etc / zabbix / zabbix_server.conf links to the extension and connect the "hardware" to the "server" with Zabbix. I didn’t have to install drivers for the RS-485 / USB adapter, but I didn’t understand how to use which USB number I used, it’s good that the connection to / dev / ttyUSB0 worked (you can see if the device is detected in the system using the lsusb command).

As with Windows, we check using the Modpoll utility (I ran linux i386) that the hardware is connected and information is available from them:



Since the article describes the configuration process using the example of Zabbix 2.2 - there is a slightly different interface there, I’ll provide explanations and pictures of the settings.

Step 1. Create a network node and a group into which our nodes will belong (for example, a node - “Environmental Monitoring” and a group - “Engineering Infrastructure”):
Setup> Network nodes> Create network node> Enter our names> Add



Step 2. Create data items. The article recommends creating templates, but since our system does not contain duplicate elements, I will therefore skip this step. For example, if we had several air conditioners connected via Modbus, then we could use the functionality of the system.

Settings> Nodes> In the line containing the name of our node “Environmental Monitoring” click on “Data Elements”> in the appeared window click “Create Data Item”.

We start to "hammer" our sensors:



Small nuances:


Setting data conversion in pictures




It is a little about in what type the data is provided at interrogation of zones.
Suppose we got the answer in decimal format 9148 (D). Let us translate into hexadecimal format (HEX): we get 23BC - according to the instructions for the S2000-PP device, these are two events with codes 23 (HEX) / 35 (D) and BC (HEX) / 188 (D). Next, we go look at Table 5. "List of events (states of the loop) of the Orion system". In it we find, 35 "Restoration of a technological input" and 188 "Restoration of communication with an entrance". There is no need to translate D-HEX-D, the first event is the integer part of dividing the obtained value by 256, and the remainder is the second event ( 9148 = 35 * 256 + 188 ). When polling technological inputs, we will take away only the first event (priority), which “must” take states 35 and 36 (“Restoration of the technological input” and “Violation of the technological input”). We will discard the fractional part (the second event) using the setting of the Data Element “Information Type: Numeric (positive integer)”.

Step 3. Fill in port macros and device numbers:
Setup> Network Nodes> “Environmental Monitoring”> select “Macros”



Step 4. Displaying readings to the control panel:
Start screen> All panels, select "Create panel"> in the appeared window set "Panel name" and the user to whom this panel will be available> Click "Create new widget"> Type "Data view", Update interval "10 seconds", Groups nodes Engineering Infrastructure> Add> Adjust Panel Size and click “Save Changes”:



Conclusion


The resulting system, through the use of "long-range" protocols, can be an excellent solution, both for monitoring the server and a pair of cross, office zones (in terms of monitoring the provision of a temperate-humidity regime) or even a small data center. Someone may say “fu-fu-fu, the car is still that nasty thing, you need to use XXX (to substitute something from the industrial automation)” is also an option, but in my opinion it will be much redundant and also more expensive . And a small nuance: as you can see, the system on the car is quite simple (although there is some strange logic), but to “finish” the decision on the prom. controllers - sometimes he is still a “headache”.

PS This article is an adaptation of two articles on my blog:
Low cost monitoring for server room (part 1 - introductory)
Low cost monitoring for server room (part 2 is practical)

Source: https://habr.com/ru/post/438788/