nagios

Nagios (pronounced /ˈnɑːɡi.oʊs/) is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better.

[Refer to Wojciech's book, various articles.]
[Refer to moodss connection.]

IBM article with Tcl example
Plugin Development Guidelines