Skip to content

Instantly share code, notes, and snippets.

@halcyonardency
Created June 4, 2014 18:12
Show Gist options
  • Save halcyonardency/02e75ecd139976336ccf to your computer and use it in GitHub Desktop.
Save halcyonardency/02e75ecd139976336ccf to your computer and use it in GitHub Desktop.
You got your Flapjack in my Sensu! You got your Sensu in my Flapjack! How to install Flapjack into Sensu's omnibus ruby path under CentOS 6.
#!/bin/sh
### This seemed to install Flapjack under CentOS6, using the embedded Ruby that comes with Sensu
### This does not install init scripts or anything else important
### Very likely this is a horrible thing I've done and should be repeated by no one, ever
# install gcc because we are going to build some things, and libtcmalloc for redis 2.8
yum -q -y install gcc gcc-c++ gperftools-libs
export OLD_GEM_PATH=${GEM_PATH}
export OLD_PATH=${PATH}
export GEM_PATH=/opt/sensu/embedded/lib/ruby/gems/2.0.0:${GEM_PATH}
export PATH=/opt/sensu/embedded/bin/:/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/flapjack-0.9.0/bin/:$PATH
# Install via gem
/opt/sensu/embedded/bin/gem install flapjack
# Install default config
cp /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/flapjack-0.9.0/etc/flapjack_config.yaml.example /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/flapjack-0.9.0/etc/flapjack_config.yaml
# go edit /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/flapjack-0.9.0/etc/flapjack_config.yaml
# Install redis 2.8 for CentOS here, for testing
rpm -i http://mirrors.mediatemple.net/remi/enterprise/6/remi/x86_64/redis-2.8.9-1.el6.remi.x86_64.rpm
# start flapper -- or don't. whatever.
flapper start
# start flapjack, you crazy person you
/opt/sensu/embedded/bin/flapjack -c /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/flapjack-0.9.0/etc/flapjack_config.yaml -n development
### return env vars back to prior state.. or.. not
#export GEM_PATH=${OLD_GEM_PATH}
#export PATH=${OLD_PATH}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment