Installing Ruby globally vs RVM local


#1

I’m setting up Sensu on a bunch of different host which serve Rails apps. Ruby is installed as the deploy user via RVM so ruby is not available globally. I’m Centos 6.5 and I would like to use Ruby 2.2.2 globally and not affect the RVM install/binary which may break our app if there’s a conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write me own, but I’m confused on how to get Ruby 2.2.2 (or at least a version 2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!


#2

It sounds like you *dont* want to use the provided ruby in the omnibus
package? (/opt/sensu/embedded/bin/ruby)

Getting your own different ruby installed for sensu's use doesn't mean
it has to be global.
What if you used your existing rvm knowledge to get the ruby you need
installed as the sensu user in its home dir? (like, /opt/sensu/rvm/)

···

On Sat, Jul 18, 2015 at 6:17 AM, James Jelinek <jelinek@gmail.com> wrote:

I'm setting up Sensu on a bunch of different host which serve Rails apps.
Ruby is installed as the deploy user via RVM so ruby is not available
globally. I'm Centos 6.5 and I would like to use Ruby 2.2.2 globally and
not affect the RVM install/binary which may break our app if there's a
conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write
me own, but I'm confused on how to get Ruby 2.2.2 (or at least a version
2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!


#3

I’ll be totally honest with you here, I didn’t realize that there was a built in ruby in omnibus. I installed Sensu from the RPM for CentOS. I’ll have to take a look on my system to see if that even exists. If not, is there an RPM where I can install the omnibus package? To be fair, the SensuApp docs are not as detailed as one would hope being new to the Sensu framework.

I’m totally ok with using the omnibus Ruby to accomplish my goals and that would be good as it wouldn’t muddy the water with our RVM ruby installation.

Thanks Kyle!
-James

···

On Jul 18, 2015, at 11:04 AM, Kyle Anderson <kyle@xkyle.com> wrote:

It sounds like you *dont* want to use the provided ruby in the omnibus
package? (/opt/sensu/embedded/bin/ruby)

Getting your own different ruby installed for sensu's use doesn't mean
it has to be global.
What if you used your existing rvm knowledge to get the ruby you need
installed as the sensu user in its home dir? (like, /opt/sensu/rvm/)

On Sat, Jul 18, 2015 at 6:17 AM, James Jelinek <jelinek@gmail.com> wrote:

I'm setting up Sensu on a bunch of different host which serve Rails apps.
Ruby is installed as the deploy user via RVM so ruby is not available
globally. I'm Centos 6.5 and I would like to use Ruby 2.2.2 globally and
not affect the RVM install/binary which may break our app if there's a
conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write
me own, but I'm confused on how to get Ruby 2.2.2 (or at least a version
2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!


#4

Here is a link to the docs on installing Sensu for Centos:
https://sensuapp.org/docs/latest/install-sensu#centosrhel

The recommended method is via the system packages. All of the Sensu
packages are omnibus-style. You probably already have it!

I don't know where the FAQ went in the latest docs revision, but
configuring Sensu to use the omnibus (embedded) ruby for
handlers/checks is a faq:
https://sensuapp.org/docs/0.16/faq#how-can-I-use-the-sensu-embedded-ruby-for-checks-and-handlers

···

On Sat, Jul 18, 2015 at 12:37 PM, James Jelinek <jelinek@gmail.com> wrote:

I’ll be totally honest with you here, I didn’t realize that there was a built in ruby in omnibus. I installed Sensu from the RPM for CentOS. I’ll have to take a look on my system to see if that even exists. If not, is there an RPM where I can install the omnibus package? To be fair, the SensuApp docs are not as detailed as one would hope being new to the Sensu framework.

I’m totally ok with using the omnibus Ruby to accomplish my goals and that would be good as it wouldn’t muddy the water with our RVM ruby installation.

Thanks Kyle!
-James

On Jul 18, 2015, at 11:04 AM, Kyle Anderson <kyle@xkyle.com> wrote:

It sounds like you *dont* want to use the provided ruby in the omnibus
package? (/opt/sensu/embedded/bin/ruby)

Getting your own different ruby installed for sensu's use doesn't mean
it has to be global.
What if you used your existing rvm knowledge to get the ruby you need
installed as the sensu user in its home dir? (like, /opt/sensu/rvm/)

On Sat, Jul 18, 2015 at 6:17 AM, James Jelinek <jelinek@gmail.com> wrote:

I'm setting up Sensu on a bunch of different host which serve Rails apps.
Ruby is installed as the deploy user via RVM so ruby is not available
globally. I'm Centos 6.5 and I would like to use Ruby 2.2.2 globally and
not affect the RVM install/binary which may break our app if there's a
conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write
me own, but I'm confused on how to get Ruby 2.2.2 (or at least a version
2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!


#5

Hey Kyle,

Thanks! I already have Sensu-core and Sensu client installed on my master and sensu-client on my nodes. I appreciate the link to the FAQ on the embedded ruby, this really helps as I want to write most of my check scripts in Ruby instead of Bash. :slight_smile:

So far I got 3 clients up and one master and I did figure out an issue I posted previously with rabbitmq not authenticating and refusing plain login. Apparently the password I selected which was a cryptic mess couldn’t be parsed by MQ so as a test I changed the rabbitmq sensu user password to “password” and boom all of the connected to MQ and showed up in Uchiwa. :slight_smile: We should get Sensu to include something about RabbitMQ passwords in the docs as this took me like 3 hours to troubleshoot. :slight_smile:

-James

···

On Jul 19, 2015, at 11:03 AM, Kyle Anderson <kyle@xkyle.com> wrote:

Here is a link to the docs on installing Sensu for Centos:
https://sensuapp.org/docs/latest/install-sensu#centosrhel

The recommended method is via the system packages. All of the Sensu
packages are omnibus-style. You probably already have it!

I don't know where the FAQ went in the latest docs revision, but
configuring Sensu to use the omnibus (embedded) ruby for
handlers/checks is a faq:
https://sensuapp.org/docs/0.16/faq#how-can-I-use-the-sensu-embedded-ruby-for-checks-and-handlers

On Sat, Jul 18, 2015 at 12:37 PM, James Jelinek <jelinek@gmail.com> wrote:

I’ll be totally honest with you here, I didn’t realize that there was a built in ruby in omnibus. I installed Sensu from the RPM for CentOS. I’ll have to take a look on my system to see if that even exists. If not, is there an RPM where I can install the omnibus package? To be fair, the SensuApp docs are not as detailed as one would hope being new to the Sensu framework.

I’m totally ok with using the omnibus Ruby to accomplish my goals and that would be good as it wouldn’t muddy the water with our RVM ruby installation.

Thanks Kyle!
-James

On Jul 18, 2015, at 11:04 AM, Kyle Anderson <kyle@xkyle.com> wrote:

It sounds like you *dont* want to use the provided ruby in the omnibus
package? (/opt/sensu/embedded/bin/ruby)

Getting your own different ruby installed for sensu's use doesn't mean
it has to be global.
What if you used your existing rvm knowledge to get the ruby you need
installed as the sensu user in its home dir? (like, /opt/sensu/rvm/)

On Sat, Jul 18, 2015 at 6:17 AM, James Jelinek <jelinek@gmail.com> wrote:

I'm setting up Sensu on a bunch of different host which serve Rails apps.
Ruby is installed as the deploy user via RVM so ruby is not available
globally. I'm Centos 6.5 and I would like to use Ruby 2.2.2 globally and
not affect the RVM install/binary which may break our app if there's a
conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write
me own, but I'm confused on how to get Ruby 2.2.2 (or at least a version
2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!


#6

I remember, and agree that is an annoying gotcha.
I'm not sure really what to think about that. Per this doc:
https://www.rabbitmq.com/uri-spec.html

It sounds like you can't have "@" or ":", But your provided password
didn't have those.

The docs are open source. If you can't figure out a good place to
record this, just do a PR.
Myabe here: https://github.com/sensu/sensu-docs/blob/master/source/docs/0.20/install-rabbitmq.md#create-user

···

On Sun, Jul 19, 2015 at 9:17 AM, James Jelinek <jelinek@gmail.com> wrote:

Hey Kyle,

Thanks! I already have Sensu-core and Sensu client installed on my master and sensu-client on my nodes. I appreciate the link to the FAQ on the embedded ruby, this really helps as I want to write most of my check scripts in Ruby instead of Bash. :slight_smile:

So far I got 3 clients up and one master and I did figure out an issue I posted previously with rabbitmq not authenticating and refusing plain login. Apparently the password I selected which was a cryptic mess couldn’t be parsed by MQ so as a test I changed the rabbitmq sensu user password to “password” and boom all of the connected to MQ and showed up in Uchiwa. :slight_smile: We should get Sensu to include something about RabbitMQ passwords in the docs as this took me like 3 hours to troubleshoot. :slight_smile:

-James

On Jul 19, 2015, at 11:03 AM, Kyle Anderson <kyle@xkyle.com> wrote:

Here is a link to the docs on installing Sensu for Centos:
https://sensuapp.org/docs/latest/install-sensu#centosrhel

The recommended method is via the system packages. All of the Sensu
packages are omnibus-style. You probably already have it!

I don't know where the FAQ went in the latest docs revision, but
configuring Sensu to use the omnibus (embedded) ruby for
handlers/checks is a faq:
https://sensuapp.org/docs/0.16/faq#how-can-I-use-the-sensu-embedded-ruby-for-checks-and-handlers

On Sat, Jul 18, 2015 at 12:37 PM, James Jelinek <jelinek@gmail.com> wrote:

I’ll be totally honest with you here, I didn’t realize that there was a built in ruby in omnibus. I installed Sensu from the RPM for CentOS. I’ll have to take a look on my system to see if that even exists. If not, is there an RPM where I can install the omnibus package? To be fair, the SensuApp docs are not as detailed as one would hope being new to the Sensu framework.

I’m totally ok with using the omnibus Ruby to accomplish my goals and that would be good as it wouldn’t muddy the water with our RVM ruby installation.

Thanks Kyle!
-James

On Jul 18, 2015, at 11:04 AM, Kyle Anderson <kyle@xkyle.com> wrote:

It sounds like you *dont* want to use the provided ruby in the omnibus
package? (/opt/sensu/embedded/bin/ruby)

Getting your own different ruby installed for sensu's use doesn't mean
it has to be global.
What if you used your existing rvm knowledge to get the ruby you need
installed as the sensu user in its home dir? (like, /opt/sensu/rvm/)

On Sat, Jul 18, 2015 at 6:17 AM, James Jelinek <jelinek@gmail.com> wrote:

I'm setting up Sensu on a bunch of different host which serve Rails apps.
Ruby is installed as the deploy user via RVM so ruby is not available
globally. I'm Centos 6.5 and I would like to use Ruby 2.2.2 globally and
not affect the RVM install/binary which may break our app if there's a
conflict.

I want to use a lot of the sensu checks that are in Ruby and of course write
me own, but I'm confused on how to get Ruby 2.2.2 (or at least a version
2.1.1) installed globally so the sensu user can execute ruby scripts.

Thanks in advance guys!