# question about returns ok critical

**URL:** <https://discourse.sensu.io/t/question-about-returns-ok-critical/883>\
**Category:** Sensu Classic (EOL)\
**Created:** [March 8, 2018, 6:44pm UTC](https://discourse.sensu.io/t/question-about-returns-ok-critical/883 "2018-03-08T18:44:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![geo\_dezix](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@geo\_dezix](https://discourse.sensu.io/u/geo_dezix)\
**Post date:** [March 8, 2018, 6:44pm UTC](https://discourse.sensu.io/t/question-about-returns-ok-critical/883/1 "2018-03-08T18:44:29Z")

</div>

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

See this [https://github.com/sensu-plugins/sensu-pluginvi](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!

> **···**
>

---

<div class="post-metadata">

**Author:** ![geo\_dezix](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@geo\_dezix](https://discourse.sensu.io/u/geo_dezix)\
**Post date:** [March 8, 2018, 9:32pm UTC](https://discourse.sensu.io/t/question-about-returns-ok-critical/883/2 "2018-03-08T21:32:08Z")

</div>

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](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!
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> >

---

<div class="post-metadata">

**Author:** ![Josh\_Pasqualetto](https://avatars.discourse-cdn.com/v4/letter/j/a5b964/32.png) [@Josh\_Pasqualetto](https://discourse.sensu.io/u/Josh_Pasqualetto)\
**Post date:** [March 8, 2018, 9:45pm UTC](https://discourse.sensu.io/t/question-about-returns-ok-critical/883/3 "2018-03-08T21:45:40Z")

</div>

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](mailto: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](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!
> 
> > >
> 
> > >
> 
> > >
> 
> > >
> 
> > >

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [November 22, 2018, 2:08am UTC](https://discourse.sensu.io/t/question-about-returns-ok-critical/883/4 "2018-11-22T02:08:02Z")

</div>


