Skip to content

Error running check-smart-status.rb - undefined method `name' for #<Disk:0x0000000253d8b8> #89

Description

@vadim6

I'm using v2.5.1 of check-smart-status.rb, when running it with the example json it's failing in line 219.

sudo ./check-smart-status.rb -j ~/smart.json Check failed to run: undefined method name' for #Disk:0x0000000253d8b8, ["/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-disk-checks-2.5.1/bin/check-smart-status.rb:219:in block in run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-disk-checks-2.5.1/bin/check-smart-status.rb:206:in each'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugins-disk-checks-2.5.1/bin/check-smart-status.rb:206:in run'", "/opt/sensu/embedded/lib/ruby/gems/2.3.0/gems/sensu-plugin-1.3.0/lib/sensu-plugin/cli.rb:57:in block in class:CLI'"]`

I've found that changing #{dev.name} to #{dev.device_path} does the trick in line 219:
criticals << "Overall health check failed on #{dev.name}"

Not sure if it's only something on my system or not though...

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions