{"repo":"Dynamics-BE/snap7-to-prometheus","free":true,"listed":false,"github":"https://github.com/Dynamics-BE/snap7-to-prometheus","clone":"git clone https://github.com/Dynamics-BE/snap7-to-prometheus.git","description":"Getting data out of Siemens PLCs using the Snap7 library and presenting them as metrics that can be read by Prometheus","language":"C#","stars":15,"topics":["industrial-automation","home-automation","building-automation","monitoring","plc","grafana","prometheus","siemens-s7"],"license":"MIT","category":"analytics","readme_excerpt":"snap7-to-prometheus Getting PLC tags out of Siemens PLCs and presenting them as a plaintext metrics file that can be read by prometheus. For Siemens S7-1200/1500, see the notes Build and run Either use docker to build and run the application (best for deployment on a server) Use Visual Studio debugging (easiest for testing) Build an exe using Visual Studio Using docker copy example.docker-compose.yml to docker-compose.yml and adjust for your purposes copy ./snap7-to-prometheus/config.yml to ./config.yml fill in your tags execute sudo docker-compose up --build Configure prometheus to use the metrics file that is available on http:// :5489/metrics Config file The config file ./snap7-to-prometheus/config.yml has the connection details of the PLC and a list of tags that will be exposed in the metrics file. This config file is automatically reloaded when changes are detected. Automatic config file reload does not work with docker, restart the container after changing config. Labels Tags can have labels. This is used in the prometheus metric file as {labelname1=\"labelvalue1\", labelname2=\"labelvalue2\"} . Labels can have a static value by specifying the Value or a reference to a tagname which has the value. Tag with a label that has a static value and another label with a dynamic value: Types - Bool (Bit, OffsetBit must be supplied (default 0)) - Int8 (Byte) - Int16 (Int) - Int32 (DInt) - Int64 (LInt) - Float (Real) - Double (LReal) - String ( StringLength must be supplied, this is t","default_branch":null,"files":null,"tree":[],"storefront":"/r/Dynamics-BE","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Dynamics-BE/snap7-to-prometheus/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}