Custom Plugin Changes

March 01 Bullet_white By Andre Bullet_white Comments Comments

We’ve made some changes to Scout’s custom plugins. The “creating a plugin” documentation is updated, but here are the highlights:

To create a custom plugin, place a .rb file on your server

Place my_plugin.rb in Scout’s data directory on your server. By default, the .scout/ directory is in the home directory of whatever user is running Scout.

To get you started, here is the simplest possible plugin:


class SimplePlugin < Scout::Plugin
  def build_report
    report(:the_answer=>42)
  end
end

When does the new plugin run?

The plugin will run the next time the Scout agent runs. If you’re actively developing your plugin, use test mode (scout test myplugin.rb) so you can see changes to your plugin immediately.

How to install your custom plugin on multiple servers

When you want to install your custom plugin on multiple servers, there are two options:

  • Option #1: you can just copy my_plugin.rb to your other servers. Simple, low overhead, and flexible.
  • Option #2: send us the code. We’ll sign it with our private key and place it your own private plugin directory. From then on, you can click-to-install it just like any other plugin, but it will only be available to you.

The second option is great if you’re bringing lots of servers online, or you’re using our cloud monitoring. When a new cloud instance checks in, it can start using one of these plugins immediately, without you having to copy the plugin file to the new server.

What about existing custom plugins?

If you’ve been with Scout for a while, you may already have some custom plugins. These plugins will continue to work exactly has they did – you don’t need to do anything.

Questions / Feedback?

Just drop us an email! We’re happy to clarify, or help you get started writing a custom plugin of your own. Also check out the creating a plugin documentation for more details.

Get notified of new posts.

Once a month, we'll deliver a finely-curated selection of optimization tips to your inbox.

Comments

comments powered by Disqus