Here is a useful script to check server status of several daemons and some URL's. It prints the results tabbed and colored properly.

require "colorize"
require "net/http"
require "yaml"

data = YAML.load(File.read("server-status.yml"))

puts "Daemon Status".colorize(:gray)

data['pids'].each do |service, pidfile|
printf "%-60s", service.capitalize.colorize(:white)
begin
pid = File.read(pidfile).to_i
Process.kill 0, pid
print "[".colorize(:gray) + "up".colorize(:green) + "]".colorize(:gray) + "\n"
rescue
print "[".colorize(:gray) + "down".colorize(:red) + "]".colorize(:gray) + "\n"
end
end

puts "\nDomain status".colorize(:gray)

data['urls'].each do |url|
color = :red
status = "fail"
begin
r = Net::HTTP.get_response(URI.parse(url))
status = r.inspect.split(" ")[1]
color = :green if status.to_i == 200
color = :yellow if status.to_i == 301
rescue
nil
end
printf "%-60s", url.colorize(:white)
print "[".colorize(:gray) + status.colorize(color) + "]".colorize(:gray) + "\n"
end
</pre>

---
pids:
rsyslog: /run/rsyslogd.pid
sshd: /run/sshd.pid
cron: /run/crond.pid
mdam: /var/run/mdadm/monitor.pid
postfix: /var/spool/postfix/pid/master.pid
courier-authdaemon: /var/run/courier/authdaemon/pid
courier-imapd: /var/run/courier/imapd.pid
memcached: /run/memcached.pid
redis: /run/redis/redis-server.pid
proftpd: /run/proftpd.pid
sbnc: /var/run/sbnc/sbnc.pid
apache: /run/apache2.pid
nginx: /run/nginx.pid
mysql: /run/mysqld/mysqld.pid
ispcp_daemon: /run/ispcp_daemon.pid
monit: /run/monit.pid
ntpd: /run/ntpd.pid
named: /run/named/named.pid
urls:
- http://www.example.org

</pre>