Sensu installs its own ruby that you can use for the plugins. Look for EMBEDDED_RUBY in the docs. If you put EMBEDDED_RUBY=true in the environment, it will use its ruby instance to run the plugins.
You can find the embedded ruby at /opt/sensu/embedded/bin (by default) along with a rubygems manager there. I sometimes use the installed embedded ruby and gem to install gems required by other plugins.
One alternative is to change the hashbang line to use /opt/sensu/embedded/bin/ruby instead of the system ruby. Not a preference, but it works.
It should be noted that if you require the mysql gem, you will need it installed by the embedded rubygems that sensu provides (if you are using the EMBEDDED_RUBY).
If you are not using the embedded rubygems, you will need the mysql gem installed on the system ruby.
To pass options into sensu plugins, you add command line params in the “command” definition for the check.
Sensu installs its own ruby that you can use for the plugins. Look for EMBEDDED_RUBY in the docs. If you put EMBEDDED_RUBY=true in the environment, it will use its ruby instance to run the plugins.
You can find the embedded ruby at /opt/sensu/embedded/bin (by default) along with a rubygems manager there. I sometimes use the installed embedded ruby and gem to install gems required by other plugins.
One alternative is to change the hashbang line to use /opt/sensu/embedded/bin/ruby instead of the system ruby. Not a preference, but it works.