Make a bash script.
LOGIC:
Use netstat -natp (filter it through awk/sed to get the ports, then grep it) Then use a simple test to see if the result was empty. Run curl if it was.
Put this in a cron job. Simple stuff, really.
EDIT:
netstat is a utility which will show you all of the connections on your computer. netstat -natp shows a list of the programs which have tcp sockets on your computer.
sed and awk are used for text formatting. You can use them to list a specific column.
grep searches input to find a specified string.
bash allows for basic logic, and can be used to see if a string is empty.
cron is a linux process which schedules commands to be run at certain times.
EDIT #2:
You COULD poll /proc/net/tcp, but since netstat does that and formats it nicely, why bother?
3
solved Get all connected IP´s on the Linux machine [closed]