So you basically want a mini version of Nagios on your device?
I assume that's what you're trying to say, you want to monitor a port for it's availability (SSH, HTTP, etc.) and alert you if it goes offline. That's what we run Nagios on a generic Linux box for, mine emails me once a critical threshold is reached.... I'm not sure why you'd want your device to be doing all this work.