Skip to content
This repository was archived by the owner on Mar 7, 2018. It is now read-only.
This repository was archived by the owner on Mar 7, 2018. It is now read-only.

Dashboard Excel integration  #735

Open

Description

@thefixxxer75

Hi all,
I've tried to integrate some xls data with dashboard, using some old post and modifying "sample.rb".
When I start "smashing start", I get the following error

bundler: failed to load command: thin (/usr/local/bin/thin)
LoadError: cannot load such file -- roo
/var/lib/gems/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in require' /var/lib/gems/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in require_with_backports'
/home/kino/nagioszurich/jobs/sample.rb:1:in <top (required)>' /var/lib/gems/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in require'
/var/lib/gems/2.3.0/gems/backports-3.6.8/lib/backports/std_lib.rb:9:in require_with_backports' /var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing/app.rb:171:in block in require_glob'
/var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing/app.rb:170:in each' /var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing/app.rb:170:in require_glob'
/var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing/app.rb:181:in <top (required)>' /var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing.rb:3:in require'
/var/lib/gems/2.3.0/gems/smashing-1.0.0/lib/dashing.rb:3:in <top (required)>' config.ru:1:in require'
config.ru:1:in block in <main>' /var/lib/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in instance_eval'
/var/lib/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in initialize' config.ru:1:in new'
config.ru:1:in <main>' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in eval'
/var/lib/gems/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in load' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in load_rackup_config'
/var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in start' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in run_command'
/var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in run!' /var/lib/gems/2.3.0/gems/thin-1.6.4/bin/thin:6:in <top (required)>'
/usr/local/bin/thin:23:in load' /usr/local/bin/thin:23:in <top (required)>'

I've the spreadsheet.xls in the root dir and all the permissions are fine.
I've installed roo and roo-xls via gem...but seems not working yet.
Please, someone has already passed through that?
Thanks in advance for your support

Activity

  1. thefixxxer75 commented on Jan 31, 2017

    @thefixxxer75
    Author

    sample.rb

    #!/usr/bin/env ruby
    require 'roo'

    SCHEDULER.every '2s' do
    file_path = "/path/to/spreadsheet.xls"

    def fetch_spreadsheet_data(path)
    s = Roo::Excel.new(path)
    send_event('valuation', { current: s.cell('B',49) })

    end

    module Handler
    def file_modified
    fetch_spreadsheet_data(path)
    end
    end

    Gemfile

    source 'https://rubygems.org'

    gem 'smashing'
    gem 'nagiosharder', :git => 'https://github.com/railsmachine/nagiosharder.git'

    Remove this if you don't need a twitter widget.

    gem 'twitter', '>= 5.9.0'

  2. thefixxxer75 commented on Jan 31, 2017

    @thefixxxer75
    Author

    extension is xls, done with LibreOffice Calc

  3. thefixxxer75 commented on Jan 31, 2017

    @thefixxxer75
    Author

    thanks for your reply!!
    I've tried but here's results

    SyntaxError: /home/xxxxxx/xxxxxxxxx/jobs/sample.rb:8: syntax error, unexpected ( arg, expecting '}'
    send_event('valuation', { current: s.cell ('B',49) })
    ^
    /home/xxxxxx/xxxxxxxx/jobs/sample.rb:8: syntax error, unexpected ',', expecting ')'
    send_event('valuation', { current: s.cell ('B',49) })
    ^
    /home/xxxxxx/xxxxxxxx/jobs/sample.rb:16: syntax error, unexpected end-of-input, expecting keyword_end

    /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in eval' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/rack/adapter/loader.rb:33:in load'
    /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:182:in load_rackup_config' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/controllers/controller.rb:72:in start'
    /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:200:in run_command' /var/lib/gems/2.3.0/gems/thin-1.6.4/lib/thin/runner.rb:156:in run!'
    /var/lib/gems/2.3.0/gems/thin-1.6.4/bin/thin:6:in <top (required)>' /usr/local/bin/thin:23:in load'
    /usr/local/bin/thin:23:in `<top (required)>'

    any idea about it? Syntax seems fine or am I wrong?
    thx in advance

  4. thefixxxer75 commented on Feb 1, 2017

    @thefixxxer75
    Author

    same error here...I don't know where the problem is.
    I'm pointing to the right path of the xls file but seems that this sample.rb has something wrong. It's quite weird...

  5. thefixxxer75 commented on Feb 2, 2017

    @thefixxxer75
    Author

    thanks sooooooooooooo much for your time. Now error is changed
    Smashing start but this log

    scheduler caught exception:

    undefined local variable or method path' for main:Object Did you mean? patch /home/xxxxx/xxxxxxxxx/jobs/sample.rb:7:in block in <top (required)>'
    /var/lib/gems/2.3.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:230:in trigger_block' /var/lib/gems/2.3.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/jobs.rb:204:in block in trigger'
    /var/lib/gems/2.3.0/gems/rufus-scheduler-2.0.24/lib/rufus/sc/scheduler.rb:430:in `block in trigger_job'

    Maybe refer to this one?

    file_path = "#{Dir.pwd}/THIS_IS_THE_PATH_LOCATION_TO_THE_XLS_FILE/YOUR_FILENAME.xls"

  6. thefixxxer75 commented on Feb 3, 2017

    @thefixxxer75
    Author

    my excel file is in /home/username/dashing/myfile.xls.
    Is it correct?

  7. thefixxxer75 commented on Feb 3, 2017

    @thefixxxer75
    Author

    Thanks mate! I'm quite confident with folder structure. My only "concern" is that I've understand - reading a post - the the spreadsheet should be present in the dashboard/smashin "root" dir (so /home/xxxxx/smashing/). My fault :) I'll try and send u a feedback. Thanks so much

  8. thefixxxer75 commented on Feb 3, 2017

    @thefixxxer75
    Author

    error persist. File moved as suggested.

    undefined local variable or method path' for main:Object Did you mean? patch /home/xxxxx/xxxxxxxxx/jobs/sample.rb:7:inblock in <top (required)>'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions