Been a while since OI have posted. Have hit a bit of snag in relation to pinging a node on my network.
Originally was using the 'ping' node but couldn't workout how to ping an IP address with a non-standard port. So I have implemented tcp-ping and everything is great, except I am unsure how to use the output of tcp-ping to trigger an email.
Here's the output I receive from tcp-ping...
Previoulsy when using the 'ping' node if the ping failed it would send a 'failed' status in the msg.payload which would then trigger an email. But as you can see tcp-ping sends a number of parameters, but all I want to know is when the ping fails.
From the data you show, what would you define as success and what as failure? It might be simpler if you told it to only do one ping request rather than three
Of course, you cannot do a standard ICMP ping to a port since ping only hits the lowest level of the network stack - effectively the network card itself. That is why occasionally, you can get a return from a ping when the rest of the device isn't working correctly.
Yes, that is what has been happening. The system had stopped working, but was still responding to the ping node. So that is why I wanted to ping a specific port.
Seems the msg.payload.success == 0 is working, so perhaps I go with that. Thank you for the advice.
The ping node is able to auto trigger every 60 seconds, but I am not sure if tcp-ping does the same? Or do I need to add an inject node to trigger the tcp-ping every 60 seconds?
Oops, sorry about that I didn’t look closely enough at the first debug to see it was in msg.payload. Glad it is working but now you have to determine why one ping worked and the other did not.