The Collector is a Ruby script client which persists Wordpress plugin, Drupal module and core versions to a Vista master server. To collect the Wordpress/Drupal data, the app uses WP-CLI and Drush, so be sure to install that first on your servers.
- Ruby >= 2.2.8
- Bundle
- WP-CLI >= master
- Drush
- Vista Drush
To install you simply need to clone it and install the dependencies with bundle
# On your server with all website directories
git clone https://github.com/hoppinger/vista-collector.git
cd vista-collector/
Install the gems with bundler
bundle install
Proceed to set up the settings file in the config folder
cd config/
cp example-settings.rb settings.rb
If you enable predefined lists, then copy the example-directories.json
cd config/
cp example-directories.json directories.json
It has to be called settings.rb
because that's what the collector.rb
clients will be looking for.
Because this will be called by a cron job in production we have the following ENV variables build in* WP_CLI* DRUSH
The cron is currently managed by puppet in the hoppinger_vista module. The ENV's can be set with heira if the module is included. The location of the vista server can also be set.
hoppinger_vista_collector::drush_location: '/usr/local/bin/drush'
hoppinger_vista_collector::wp_location: `/user/local/bin/wp`
hoppinger_vista_collector::vista_server: 'vista.test.hoppinger.com'
For debugging purpose the cron logs it's output to cron.log
and cron_error.log
We have a puppet manifest that will install the collector under the deployer user. Sadly not all of our servers have rbenv with bundle installed.
In this case you should install rbenv. Also install Ruby Build. Then install ruby 2.2.3
rbenv install 2.2.3
If this fails it's probapply because of libreadline. In that case you can run.
apt-get install -y libreadline-dev
While you are at it you should also set 2.2.3 as default (only if there isn't a default set already)
rbenv global 2.2.3
Then install bundler
rbenv exec gem install bundler
And rehash
rbenv rehash`
Although this project is set up to be autonomous using cron jobs, you can run the Collector manually using this command
cd -vista-collector/
bundle exec rake collect_all
And it will push the data to the master server.