0

The sensu checks fails to execute, the sensu client logs show the following error

checks dont work ("output":"/usr/bin/env: ruby: No such file or directory\n","status":127)
Saurav
  • 414
  • 6
  • 17

2 Answers2

2

You can also use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu. It works very well but only if you have ruby checks only. You cannot set embedded ruby setting for bash, python or other languages checks.

1

the community plugins for sensu, use #!/usr/bin/env ruby this looks for the ruby executable under /usr/bin/env.

If you dont have ruby installed, and the only place ruby is either chef client or sensu client as embedded, then here is what you can do to fix it.

Create a symbolic link for ruby, such that the plugins can now find ruby to execute the code

ln -s /opt/sensu/embedded/bin/ruby /usr/bin/ruby

also ensure that sensu user has execute permission on the plugin/script

This is also mentioned in the Sensu FAQ section.

Saurav
  • 414
  • 6
  • 17
  • 1
    KrzysztofSzarek's answer is the correct way to do this. Symlinking system Ruby to Sensu's Ruby is unclean. – Mike Ryan Jan 21 '15 at 12:52