How do I set up a server status script on a VPS or Dedicated server?

Overview

If you have a VPS or Dedicated server, you might be interested in finding the status of that server without having to wait at a terminal window. Instead, you can run a script that emails you this information about the status of your server.

If the above command does not work, try modifying '/user/bin/ruby' with '/user/bin/ruby1.8'.

You can change the subject to anything you like.

You can also change the email to any address you’d like the cron email sent to.

If you want to CC the email to more email addresses, you can use the -c flag and pass it a comma separated list of email addresses.

Running it once per hour is probably not a bad idea, but you can run it as frequently or infrequently as you like.

Conclusion

If you set everything up properly, then you should start getting emails that look roughly like this:

Keep in mind that this script is likely to update as time progresses if things change with server configurations. So, if this stops working on your server, be sure to check back to see if the script has updated. This was tested with the new SSD VPS on Ubuntu 12.04 LTS and so far there are no problems.