Per Spilling's Blog

Software Craftsmanship, DDD, Software Architecture and Agile Methods

Installing Scout When RVM Is Used

In a recent Ruby on Rails project we needed an application monitoring solution as we where going to do the application management of this application ourselves. The application is deployed on a virtual Linux server at a hosting provider. After a google search of available solutions we decided to try Scout. Scout is a cloud-based application monitoring solution which has gotten good reviews (Comparison of Rails monitoring apps: FiveRuns vs NewRelic RPM vs Scout App), and it has a very reasonable price. This post a summary of the our initial experiences with installing and using Scout.

Installation when RVM is used

The installation process is simple (in principle):

However, it didn’t go quite so smooth because we are using RVM. The very first step is to register with Scout and create a server entry for the server we want to monitor. This will generate the license-key for our particular server. The next step of the installation produced the following:

The reason for this is that the sudo command will start up a subshell without the required environment variables. RVM does come with a solution for this though, the rvmsudo command. Using this will successfully install the scout gem.

The next step is to run the scout program to install the license key and test the connection with the Scout server.

Then I needed to add a statement to crontab so that the scout agent is started up at a regular interval. The suggested crontab example didn’t work however, so I started googling for a solution, and found the RVM and cron in production article on the Scout blog. After some trial and error (including quick response from Scout support) I ended up with the following crontab statement:

Now when I go to I have a basic monitoring setup for our server. This can be tailored by adding Scout plugins and configuring charts for the various parameters that we want to monitor.

Adding Scout plugins

The initial plugins that are installed “out of the box” are CPU, Memory, and Disk usage. I added plugins for RoR, Delayed job, and MongoDB. Installing these plugins was quite straightforward, but I had a little trouble getting the RoR plugin working right away, so I added it, and it’s dependent gems, to the Gemfile of our app:

And then finally I set up some charts.

Overall impression so far

Despite some minor installation issues I am very satisfied with Scout so far. Highly recommended!