DiskStats ON RAILS

Proof of concept for the file-based EvF


Ruby on Rails


Useful commands

  • Create a new project: rails new myapp
  • Start web server: cd myapp; rails s
  • Generate scaffolding for a resource: rails generate scaffold Datapoint key:string value:string dataset_id:integer
  • Migrate DB for resource: bundle exec rake db:migrate
  • Destroy scaffolding for a resource: rails destroy scaffold Datapoint

  • Open console: rails console








  • Install Ruby on Rails: more instructions at http://rubyonrails.org/download/
    • ruby
      • download & compile
        • ./configure
        • make
        • (make test)
        • make install
    • rubygems
      • download & compile or through package manager
    • rails
      • gem install rails

  • Move project archive to destination folder and run 'bundle install' from the folder
    • You should get the message: Your bundle is complete! Use 'bundle show ..... (etc)

  • To check if rails works ok, start the server. In the project folder, run ./scripts/rails s
    • Then go to localhost:3000 in your browser and verify you get the default Ruby on Rails page.

  • Configure DiskStatsOnRails:
    • app/assets : should contain the file testAuto.json
    • app/assets/monitoring/daemon.properties : adapt the parameters as required, output_path points to your testAuto.json file
    • config/config.yml : adapt as appropriate (you need jobcontrol running on the machine, and set the hostname, port and lid of jobcontrol)

  • That's it! Go to localhost:3000/diskstats

NOTE: for common installation issues check http://sachachua.com/blog/p/22184/

  • ruby requires some libraries that need to be installed (such as openssl or readline)

Example openSSL problem fix:

yum install openssl openssl-devel (libssl-dev if you are running ubuntu)

(go to ruby source directory)

cd ext/openssl

ruby extconf.rb


make install

-- AndreiSpataru - 01-Oct-2012

Topic attachments
I Attachment History Action Size Date Who Comment
PDFpdf aspataru_20092012.pdf r1 manage 231.2 K 2012-10-12 - 18:18 AndreiSpataru  
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2020-08-19 - TWikiAdminUser
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox/SandboxArchive All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback