question about returns ok critical

I see code for ‘ok’ and ‘critical’ as returns functions

See this https://github.com/sensu-plugins/sensu-pluginvi

#!/usr/bin/env ruby

require ‘sensu-plugin/check/cli’

class MyCheck < Sensu::Plugin::Check::CLI

def run
ok “All is well”
end

end

test=MyCheck.new()
test.run()

and get these errors:

./test.rb

/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file – sensu-plugin/check/cli (LoadError)

    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'

    from ./test.rb:3:in `<main>'

See somewhere a gem install sensu-plugins which freezes when i run it.

Can someone point the way? Many thanks!

···

Tried cloning sensu-plugins and doing a gem install sensu-plugins this produced three gems in the /usr/local… from there was able to run the script seen above without errors. Does not need creation of an object like test, btw.

···

On Thursday, March 8, 2018 at 1:44:29 PM UTC-5, geo dezix wrote:

I see code for ‘ok’ and ‘critical’ as returns functions

See this https://github.com/sensu-plugins/sensu-pluginvi

#!/usr/bin/env ruby

require ‘sensu-plugin/check/cli’

class MyCheck < Sensu::Plugin::Check::CLI

def run
ok “All is well”
end

end

test=MyCheck.new()
test.run()

and get these errors:

./test.rb

/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file – sensu-plugin/check/cli (LoadError)

    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from ./test.rb:3:in `<main>'

See somewhere a gem install sensu-plugins which freezes when i run it.

Can someone point the way? Many thanks!

Instead of doing #!/usr/bin/env ruby also you could point it towards the system installed sensu binary.

···

On Thu, Mar 8, 2018 at 2:32 PM, geo dezix geodezix@gmail.com wrote:

Tried cloning sensu-plugins and doing a gem install sensu-plugins this produced three gems in the /usr/local… from there was able to run the script seen above without errors. Does not need creation of an object like test, btw.

On Thursday, March 8, 2018 at 1:44:29 PM UTC-5, geo dezix wrote:

I see code for ‘ok’ and ‘critical’ as returns functions

See this https://github.com/sensu-plugins/sensu-pluginvi

#!/usr/bin/env ruby

require ‘sensu-plugin/check/cli’

class MyCheck < Sensu::Plugin::Check::CLI

def run
ok “All is well”
end

end

test=MyCheck.new()
test.run()

and get these errors:

./test.rb

/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require’: cannot load such file – sensu-plugin/check/cli (LoadError)

    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from ./test.rb:3:in `<main>'

See somewhere a gem install sensu-plugins which freezes when i run it.

Can someone point the way? Many thanks!