[Network Binding] OH2 Network device with running service

Hello, I Want to monitor some servers that are freezing from time to time. I want to use tcp connection check on a specific port. I have set up thing using:

network:servicedevice:test_serv [hostname="", port=88, refreshInterval=30000]

Everything is working as expected. The only problem is if i stop the service on port 88 but the server is running the thing doesn’t change to OFF. The behavior i am looking for is the ting to change to OFF if it can not make successful connection to the 88.

For anyone having the same problem. you have to block the outgoing RST,ACK flagged TCP packets for this to work properly. If the port responds with Connection refused the Network binding will report thath the thing is online.

1 Like