Well I beat on this for an hour, so here goes...
It needs work, but it's a start?
Code:
#!/bin/bash
if [[ $(curl -Is http://ipa.ddr.ess:80 | \grep -E '^Server' | cut -c9-14) = Apache ]] ; then
exit
else $(ssh -i /path/to/keyless/key root@host "service httpd restart")
fi
#EOF
Assumes Apache as the server.
Assumes you have key-based ssh setup.
Code:
service httpd restart
This "may" be another command, so substitute whatever command restarts the service(s) on the target.
That ought to get you going.
Have fun.
For several services, you could replicate the script or use a Monitoring program such as Zabbix.