To make life easier, you could look into SNMP traps. These are messages that are commonly sent via devices such as printers/network hubs to tell any listeners their state. You do not need any ports...