How-To: Monitor VPS Status From Heroku

I built and released this tool to monitor the status of your SolusVM client API-enabled VPS. It’s really easy to host it on Heroku, which is great since we don’t want to host the monitoring site on the VPS we want to monitor. You’ll need a Heroku account if you don’t already have one, the free account will do just fine.

Before we begin, you should probably install the Heroku Toolbelt. You’d also benefit from reading through some of the Heroku Dev Center articles. This one about deploying to Heroku with git is probably the most relevant for what we’re doing here.

You’ll need a terminal/command line for deploying to Heroku with git. A really great resource for new git users is Git Immersion, just click the green “Start Git Immersion” arrow to get started with git. Anyway, the 5 steps that follow assume you’ve created a Heroku account and have git installed and working.

  1. Fork tlongren/vps-status on GitHub and make a local clone.
  2. Install the Heroku Toolbelt and login to Heroku with the command “heroku login“. Enter you username and password to login with the Heroku Toolbelt.
  3. Create a new app on Heroku either through the web interface, or with the command “heroku create“. If you do it with the command line the app name will be shown to you, see here.
  4. Open a terminal and go into the folder that you cloned your fork into and run the command “heroku git:remote -a heroku-app-name“. That will add a remote named “heroku” to your local clone.
  5. Now, while still in your local clone folder, run “git push heroku master” to push your app to Heroku. If your app is named “heroku-app-name”, you can access your app at http://heroku-app-name.herokuapp.com.

That’s all there is to it. It might not seem simple at first glance, but it really is. To make changes, just edit the files in your local clone and commit those changes with git. Then run “git push heroku master” again to push the new code to Heroku.

Make sure you don’t send your changes back to GitHub, unless you’ve got private repositories. If you do a push to GitHub, your API key and hash will be accessible by the public, which isn’t something you want. Instead, you could either make a private repository at BitBucket or create a private repo using Dropbox like I do. The DropBox option is only reliable if you’re the only one editing the code, and if you’re only making changes from one machine at a time.

Let me know if you have any issues or think I’ve missed something.

VPS Status Page with SolusVM and FlipHost

I found out that FlipHost offers access to server stats through an API developed by SolusVM. It offers all the stuff you’d want to know about your VPS. Disk usage, RAM usage, bandwidth usage, but I don’t think it does any cpu load reporting, unfortunately.

I put together a simple site to quickly tell if all my stuff at FlipHost was online. I could have gone the pinging the VPS IP route, but since there was an API available, I might as well use it. And pinging a host wouldn’t give all these details.

If you have a VPS from FlipHost, you can generate your API key and API hash from your SolusVM Control Panel, in the “api” tab. If you don’t use FlipHost, but your host does use SolusVM, this should work for you too. The API client URL for FlipHost is: https://solus.fliphost.net/api/client. The SolusVM client API suggests the client URL is run on port 5656, but FlipHost has directed port 80 and 443 there instead.

The site is available on Github, so you can easily make your own status page. I’ll be adding more to it, as there’s only really one action being taken currently. As a demo, I’ve put it up at http://status.longren.org/, which is hosted on Heroku. It also looks nice on mobile devices. Have a look at the screenshots in the gallery at the end of this post.

You should be able to deploy this on Heroku just like any other app. Just fork it on Github, make a local clone of your forked repo, edit config.php, setup your Heroku git remote, and push to Heroku. You’ll want to install the Heroku Toolbelt app. The Heroku Dev Center is a great resource if you’re new to Heroku.

For a more detailed explanation on setting this up on Heroku, you’ll want to read How-To: Monitor VPS Status from Heroku.
Continue reading “VPS Status Page with SolusVM and FlipHost”

Moving To FlipHost

This site now sits on a server at FlipHost. I got a Storage250 server from them and added some RAM, and here we are. It’s really a pretty nice setup.

Pretty much everything I’ve setup I’ve done according to guides from Linode. Most of the guides in the Linode Library should apply at least somewhat to FlipHost.

This site was previously on Dreamhost, but there’s been a LOT of downtime there recently, a whole lot. Yah, I just linked to 6 posts from dreamhoststatus.com that were posted from May 12 through May 17. Crazy.

FlipHost wooed me on twitter and so far I’m really, really glad that they did.

I’ve already canceled the one VPS that I had at Dreamhost. May keep the shared account around for some other sites, but may end up moving absolutely everything to FlipHost. I haven’t really decided yet.