Zabbix + Wirenboard: production monitoring

Introduction

In this article, I will talk about how we use Zabbix and Wirenboard to monitor production equipment, how we were able to get data from lines and sources of basic resources. The article describes the concept and main points of organizing monitoring by means of free software, but it will not discuss serious systems of the SCADA class. My task was to quickly deploy monitoring without capital investment and start receiving data as soon as possible from what is already there.

A task

We have conveyor lines with raw materials and finished products, we have ovens, autoclaves and other pieces that are useful in production. All this consumes various resources (gas, water, electricity) and requires control (working or idle). We need monitoring that will allow us to identify bottlenecks in production and draw conclusions about the efficiency of using resources and equipment.

Integration difficulties

Unfortunately, all production equipment is controlled by its own local controllers, not everyone has a network interface, everyone has their own protocols, access to the OS is closed, analog sensors are used - few people want to share information with the outside world.

Changing everything is long, expensive and difficult, and you need to get the data right now, the conclusion: you need to be embedded.

Controller

Wirenboard . linux, , web . , Modbus RTU. MQTT. MQTT - , .

Zabbix-mqtt-Wirenboard

Zabbix c MQTT, , , .

- Zabbix , MQTT mosquitto_sub. : Β«UserParameter=mqtt.value[*],mosquitto_sub -t '$1' -C 1Β», Zabbix , item key mqtt.value[ ].  

, – MQTT . , , Zabbix . Β«retainΒ», , Zabbix , , . – , . , .

Zabbix 4.2 zbx_mqtt. Zabbix , , JSON . «» . Preprocessing: – .  

– -. :

  • / .  

, WB-MCM8 c modbus 32, , MQTT Wirenboard.

/devices/wb-mcm8_32/controls/Input 1 counter
/devices/wb-mcm8_32/controls/Input 2 counter
…
/devices/wb-mcm8_32/controls/Input 8 counter

Zabbix MasterItem_WB-MCM8_32 External check. .

Example Master item for MQTT metrics
Master item MQTT

key : mqtt["-t=/devices/wb-mcm8_32/#","--mqtt-host={HOST.CONN}"] :

  • mqtt[] –

  • -t=/devices/wb-mcm8_32/# - wb-mcm832

  • --mqtt-host={HOST.CONN} - Wirenboard. {HOST.CONN}

, Zabbix JSON, :

{…"/devices/wb-mcm8_32/controls/Input 7 counter": "3129705", "/devices/wb-mcm8_32/controls/Input 3 counter": "1885652", "/devices/wb-mcm8_32/controls/Input 1 counter/meta/type": "value", "/devices/wb-mcm8_32/controls/Input 5/meta/order": "13", "/devices/wb-mcm8_32/controls/Input 8/meta/order": "16"…}

dependent item, .

key , mqtt . Preprocessing.

  • JSONPath -

  • Check for error in JSON - wb-mcm8 : , , Zabbix .

  • Simple change - , () – Simple change.

, , . , , .

WB-MAP3H. , , . ( ) ( , – ). (, , ), ( ).

WB-MAP3H
WB-MAP3H

, . , , – .

Delta Modbus TCP RTU

Delta, Modbus TCP. Modbus Zabbix libzbxmodbus. , TCP, com RTU Modbus. , .

Zabbix Master item, 17 Modbus TCP, , .

modbus_read[{$MODBUS_ADDRESS},1,4110,3,17*s]
master item for polling the Delta controller
master item Delta
  • $MODBUS_ADDRESS – Zabbix, ip , Β«tcp://192.168.0.2Β»

  • 1 – Modbus. Β«1Β», RTU ,

  •  4110 – ,

  • 3 – Modbus. 3 –

  • 17*s – , 17 , int16 (s=int16, f=float, b=bit )

5 Zabbix – Test, JSON 17 ( 4110 4126).

{"4110":967,"4111":960,"4112":395,"4113":0,"4114":0,"4115":0,"4116":665,"4117":803,"4118":2500,"4119":2500,"4120":447,"4121":999,"4122":1224,"4123":2154,"4124":1493,"4125":1254,"4126":418}

, Preprocessing steps JSONPath = $.4110 4110 . , : In range 0 1500, – . Discard unchanged , .

Setting up a metric from a controller register

Siemens

Siemens S7 profinet / profibus, Snap7. zbx_s7_get , .

Sample data request

s7_get.py :

s7_get.py[{HOST.CONN},{$S7.RACK},{$S7.SLOT},{$S7.DB},6,bool,--json]
  • {HOST.CONN} – , ip ( host interface)

  • {$S7.RACK} – , rack id

  • {$S7.SLOT} – ,

  • {$S7.DB} – , id

  • 6 - offset

  • Bool – , true / false. int float.

  • --json – . json, master item .

JSON, ( ).

{"6": ["True", "False", "False", "True", "False", "True", "True", "False"]}

Linx 5900

Linx 5900 ( , ). , , - .

Zabbix moxa NPORT 5150. tcp rs232 serial /dev/ttyr01 linux , Zabbix . Linx Remote Communications Interface (RSI). , ( ).

: 1b 02 08 1b 03  
: 1b 06 00 00 08 da bc b9 01 1b 03

: 
1b 06 -  
00 00  
08 –    8 ( ) 
da bc b9 011b 03 

  UINT32 - Little Endian (DCBA) 
01 B9 BC 8F       28949647 
01 B9 BC DA       28949722 
01 B9 BD 25       28949797

, , .

Zabbix serial.get. Item key :

serial.get[/dev/ttyr01,5,1b02081b03,uint32]

Zabbix , .

:

  • ( )

  • OEE

  • ( )

  • ( )

, , – , . Grafana , .

:

  • , . lorawan

  • CAS

P.S.  

This article was written before Zabbix 5.2 was released. The new version is focused on working with iot and it already has the ability to receive data from MQTT and Modbus without additional modules, for which many thanks to the Zabbix developers. Special thanks to @wabbit for the modules on git https://github.com/v-zhuravlev, they gave the main impetus to the development of monitoring.




All Articles