Sensu Client for OpenBSD OS - openbsd

we are migrating or monitoring from nagios to sensu and part of this is moving our openbsd servers to sensu. i know there is no native client for this but i have been wondering if anyone has tried and succeeded at this.
couldn't find anything much helpful so far so any help will appreciated.
all i found so far was this link
but i couldn't figure out how he did this.
i also tried creating a new box and installing the sensu client via gem install sensu, the install finished with no errors but the client did not run and i got this:
-bash-4.3# sensu-client18
/usr/local/lib/ruby/gems/1.8/gems/ffi-1.9.10/lib/ffi_c.so: Cannot load specified object - /usr/local/lib/ruby/gems/1.8/gems/ffi-1.9.10/lib/ffi_c.so (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/cust
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/gems/1.8/gems/sensu
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/gems/1.8/gems/sensu
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/gems/1.8/gems/sensu
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/site_ruby/1.8/rubyg
from /usr/local/lib/ruby/gems/1.8/gems/sensu
from /usr/local/bin/sensu-client18:23:in `lo
from /usr/local/bin/sensu-client18:23
install process:
*** LOCAL GEMS ***
-bash-4.3# gem18 install sensu
Fetching: multi_json-1.11.2.gem (100%)
Fetching: uuidtools-2.1.5.gem (100%)
Fetching: eventmachine-1.0.8.gem (100%)
Building native extensions. This could take a while>Fetching: sensu-logger-1.1.0.gem (100%)
Fetching: sensu-settings-3.3.0.gem (100%)
Fetching: sensu-extension-1.3.0.gem (100%)
Fetching: sensu-extensions-1.4.0.gem (100%)
Fetching: amq-protocol-1.9.2.gem (100%)
Fetching: amqp-1.5.0.gem (100%)
Fetching: em-redis-unified-1.0.1.gem (100%)
Fetching: sensu-transport-3.3.0.gem (100%)
Fetching: em-worker-0.0.2.gem (100%)
Fetching: ffi-1.9.10.gem (100%)
Building native extensions. This could take a while>Fetching: childprocess-0.5.8.gem (100%)
Fetching: sensu-spawn-1.6.0.gem (100%)
Fetching: rack-1.6.4.gem (100%)
Fetching: tilt-2.0.2.gem (100%)
Fetching: rack-protection-1.5.3.gem (100%)
Fetching: sinatra-1.4.6.gem (100%)
Fetching: async_sinatra-1.2.0.gem (100%)
Fetching: daemons-1.2.3.gem (100%)
Fetching: thin-1.6.3.gem (100%)
Building native extensions. This could take a while>Fetching: sensu-
0.22.0.gem (100%)
Successfully installed multi_json-1.11.2
Successfully installed uuidtools-2.1.5
Successfully installed eventmachine-1.0.8
Successfully installed sensu-logger-1.1.0
Successfully installed sensu-settings-3.3.0
Successfully installed sensu-extension-1.3.0
Successfully installed sensu-extensions-1.4.0
Successfully installed amq-protocol-1.9.2
Successfully installed amqp-1.5.0
Successfully installed em-redis-unified-1.0.1
Successfully installed sensu-transport-3.3.0
Successfully installed em-worker-0.0.2
Successfully installed ffi-1.9.10
Successfully installed childprocess-0.5.8
Successfully installed sensu-spawn-1.6.0
Successfully installed rack-1.6.4
Successfully installed tilt-2.0.2
Successfully installed rack-protection-1.5.3
Successfully installed sinatra-1.4.6
Successfully installed async_sinatra-1.2.0
Successfully installed daemons-1.2.3
Successfully installed thin-1.6.3
Successfully installed sensu-0.22.0
23 gems installed
any thoughts guys?
EDIT: i should mention, i am very new to ruby so i might be missing something very dumb here

I tried in and adJ OpenBSD 6.0 and it seems to work fine.
$ doas pkg_add ruby
$ doas gem install sensu
$ sensu-client -V
0.26.5
I even could start the server and the client using redis as transport.

Related

Issue installing Snap on macOS Sierra

I'm having trouble installing the Haskell framework Snap on macOS Sierra. Whenever I install it, I get the following message:
Resolving dependencies...
Configuring securemem-0.1.9...
Configuring skein-1.0.9.4...
Configuring configurator-0.3.0.0...
Configuring cryptonite-0.24...
Building configurator-0.3.0.0...
Building securemem-0.1.9...
Building skein-1.0.9.4...
Failed to install configurator-0.3.0.0
Build log ( /Users/nicholas/.cabal/logs/ghc-8.2.1/configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho.log ):
cabal: Entering directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring configurator-0.3.0.0...
Preprocessing library for configurator-0.3.0.0..
Building library for configurator-0.3.0.0..
<command line>: cannot satisfy -package-id attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk:
attoparsec-0.13.2.0-5dp4kBDsiGY4dQpLKbD5rk is unusable due to shadowed dependencies:
scientific-0.3.5.1-L0qYzdp0wpz8rO8gircNSR text-1.2.2.2-EGUst8sqNAZCw1xLPcmcMH
(use -v for more information)
cabal: Leaving directory '/tmp/cabal-tmp-66175/configurator-0.3.0.0'
Configuring transformers-base-0.4.4...
Building cryptonite-0.24...
Building transformers-base-0.4.4...
Installed securemem-0.1.9
Installed transformers-base-0.4.4
Installed skein-1.0.9.4
Installed cryptonite-0.24
Updating documentation index
/Users/nicholas/Library/Haskell/share/doc/x86_64-osx-ghc-8.2.1/index.html
cabal: Error: some packages failed to install:
configurator-0.3.0.0-6dySPcNCURWFswtMXJvzho failed during the building phase.
The exception was:
ExitFailure 1
snap-1.0.0.2-5CZKyA9EY4oLgkpHYCVfnv depends on snap-1.0.0.2 which failed to
install.
I'm using the Haskell Platform installed using homebrew (brew cask install haskell-platform), and cabal version 2.0.0.2. I have tried using sudo and deleting my ~/.ghc file
There was an issue with full 8.2.1 binary platform builds that's just been resolved: https://mail.haskell.org/pipermail/haskell-cafe/2017-October/127979.html
This was likely an instance of that.
(see also: GHC cannot find libraries on fresh install of Haskell-Platform)
This looks like a bug in Cabal 2 (or potentially GHC 8.2). See https://github.com/haskell/cabal/issues/4728. I'd recommend sticking to GHC 8.0.2 for the moment with either cabal 1.24 or Stack. I'm the case of Stack, the version won't matter, since it will use the Cabal version shipped with GHC.

jruby/cucumber: Bundle install doesn't install any gem

I'm on Windows 10 x64 and I've installed JRuby 1.7.8 (I tried the files for x64 and 32bits with the same problem) and JRE 7.
I was trying to have my Cucumber Test Framework running on a different machine. I downloaded my current branch (which is working fine in other computers, with all the settings: env.rb, Gemfile, etc) and then I installed successfully these 2 gems:
gem install bundler
gem install cucumber
The Gemfile I have contains loads of gems, similar to:
source 'https://rubygems.org'
gem "httpclient"
gem "watir-webdriver"
but when I execute:
bundle install
I just get this line and nothing gets installed, it finishes almost immediately. No Gemfile.lock is created, etc.
D:\project>bundle install
io/console not supported; tty will not be manipulated
D:\project>
Any idea what could be wrong and what I could try please?
Not quite sure if the issue has anything to do with the line above (which I had never seen in the other machines that are working). If it's not related and you've got an idea about both problems, please let me know and I'll have a look as well...
I've been trying for a few more hours and still not success, adding further info in case someone can spot something pls. Even 'bundle -v' doesn't work on this machine?!
D:\project>gem list
io/console not supported; tty will not be manipulated
*** LOCAL GEMS ***
builder (3.2.2)
bundler (1.13.2)
cucumber (2.4.0)
cucumber-core (1.5.0)
cucumber-wire (0.0.1)
diff-lcs (1.2.5)
gherkin (4.0.0)
jruby-win32ole (0.8.5)
multi_json (1.12.1)
multi_test (0.1.2)
rake (10.1.0)
D:\project>bundle -v
io/console not supported; tty will not be manipulated
D:\project>
Cheers!!
You have the latest version of bundler 1.13.2 installed and I have seen it cause different types of issues depending on the jruby version and some other gems. Bundler 1.10.6 works everytime for my Jruby 1.7.x.
Try these:
gem uninstall bundler
and
gem install bundler -v 1.10.6
Although I am not particularly familiar with jruby, it appears to be a bug, which is resolved in JRuby 1.7.24.
I would verify that the other computers this is working on are still on that version of jruby (assuming they are windows boxes).

Build Gem Native Extension

Passing on knowledge I just learned in the hopes of reducing the
headache others may experience with native gem extensions like I've
had.
TL;DR - Had an issue with bundle install. Read mkmf.log as mentioned in the error. The log had another error that I googled. Installed
necessary library. Afterwards, bundle install was successful.
Trying to install gems using bundler and getting errors about building gem native extensions:
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Installing daemons 1.2.3
Installing eventmachine 1.0.8 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/eventmachine-1.0.8/ext
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160309-8483-1so3k75.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
<...>
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/eventmachine-1.0.8/mkmf.log
extconf failed, exit code 1
<...>
Installing mysql2 0.4.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /usr/local/rvm/gems/ruby-2.3.0/gems/mysql2-0.4.3/ext/mysql2
/usr/local/rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160309-8483-1oxfnj5.rb extconf.rb
checking for ruby/thread.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
<...>
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/mysql2-0.4.3/mkmf.log
extconf failed, exit code 1
<...>
Installing rack 1.6.4
Installing tilt 2.0.1
Using bundler 1.11.2
An error occurred while installing eventmachine (1.0.8), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.8'` succeeds before bundling.
Passing on knowledge I just learned in the hopes of reducing the
headache others may experience with native gem extensions like I've
had.
TL;DR - Had an issue with bundle install. Read mkmf.log as mentioned in the error. The log had another error that I googled. Installed
necessary library. Afterwards, bundle install was successful.
I see that the errors point me to mkmf.log and where it's located. I open it up and check the error. Among other things it mentions the following on lines 2 and 3.
/usr/bin/ld: cannot find -lgmp
collect2: error: ld returned 1 exit status
I know from the error while during bundle install that it could be missing a library. So I search for a package called gmp. I find 2 libraries, one called libgmp10 and the other libgmp10-dev.
$ apt-cache search -n gmp
libgmp-dev - Multiprecision arithmetic library developers tools
libgmp10 - Multiprecision arithmetic library
<...>
I search my installed packages to see if I need to get one.
$ dpkg --get-selections | grep gmp
libgmp10:amd64 install
Since libgmp10 is already there, I try installing libgmp-dev. Then I run retry installing my gems, and it works!
$ sudo apt-get install libgmp-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgmpxx4ldbl
Suggested packages:
libgmp10-doc libmpfr-dev
The following NEW packages will be installed:
libgmp-dev libgmpxx4ldbl
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 300 kB of archives.
After this operation, 1,675 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main libgmpxx4ldbl amd64 2:5.1.3+dfsg-1ubuntu1 [8,736 B]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty/main libgmp-dev amd64 2:5.1.3+dfsg-1ubuntu1 [292 kB]
Fetched 300 kB in 0s (411 kB/s)
Selecting previously unselected package libgmpxx4ldbl:amd64.
(Reading database ... 218685 files and directories currently installed.)
Preparing to unpack .../libgmpxx4ldbl_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ...
Unpacking libgmpxx4ldbl:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Selecting previously unselected package libgmp-dev:amd64.
Preparing to unpack .../libgmp-dev_2%3a5.1.3+dfsg-1ubuntu1_amd64.deb ...
Unpacking libgmp-dev:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Setting up libgmpxx4ldbl:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Setting up libgmp-dev:amd64 (2:5.1.3+dfsg-1ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using daemons 1.2.3
Installing eventmachine 1.0.8 with native extensions
Installing mysql2 0.4.3 with native extensions
Using rack 1.6.4
Using tilt 2.0.1
Using bundler 1.11.2
Installing rack-protection 1.5.3
Installing thin 1.6.4 with native extensions
Installing sinatra 1.4.6
Bundle complete! 3 Gemfile dependencies, 9 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Is everything reinstalled from scratch in cabal sandboxes?

Let's assume the following procedure:
cd /home/user/experiment
git clone https://github.com/ryantrinkle/reflex.git
cabal sandbox init
cabal install --dependencies-only
Question:
At this point what packages will the sandbox in /home/user/experiment contain ? Will it contain the whole dependency hierarchy tree of Reflex ?
In other words, if Reflex is the root package then will the whole dependency tree of Reflex be compiled from scratch independently of what is installed already in the global package repository of cabal ?
I suspect yes, but I am not sure.
When I execute the above command sequence then the following packages are installed :
[vagrant#localhost reflex]$ cabal install --only-dependencies
Resolving dependencies...
Notice: installing into a sandbox located at /home/vagrant/reflex
Downloading dependent-sum-0.2.1.0...
Configuring base-orphans-0.3.3...
Downloading primitive-0.5.4.0...
Configuring mtl-2.2.1...
Building base-orphans-0.3.3...
Building mtl-2.2.1...
Installed base-orphans-0.3.3
Configuring nats-1...
Building nats-1...
Installed nats-1
Configuring stm-2.4.4...
Configuring tagged-0.8.0.1...
Installed mtl-2.2.1
Building stm-2.4.4...
Building tagged-0.8.0.1...
Configuring text-1.2.1.1...
Installed stm-2.4.4
Downloading ref-tf-0.4...
Configuring transformers-compat-0.4.0.4...
Installed tagged-0.8.0.1
Building text-1.2.1.1...
Building transformers-compat-0.4.0.4...
Configuring dependent-sum-0.2.1.0...
Installed transformers-compat-0.4.0.4
Building dependent-sum-0.2.1.0...
Configuring primitive-0.5.4.0...
Installed dependent-sum-0.2.1.0
Downloading dependent-map-0.1.1.3...
Building primitive-0.5.4.0...
Installed primitive-0.5.4.0
Configuring ref-tf-0.4...
Building ref-tf-0.4...
Installed ref-tf-0.4
Configuring StateVar-1.1.0.0...
Building StateVar-1.1.0.0...
Configuring distributive-0.4.4...
Installed StateVar-1.1.0.0
Building distributive-0.4.4...
Configuring dependent-map-0.1.1.3...
Installed distributive-0.4.4
Building dependent-map-0.1.1.3...
Configuring vector-0.10.12.3...
Installed dependent-map-0.1.1.3
Building vector-0.10.12.3...
Installed text-1.2.1.1
Configuring hashable-1.2.3.2...
Building hashable-1.2.3.2...
Installed hashable-1.2.3.2
Configuring unordered-containers-0.2.5.1...
Building unordered-containers-0.2.5.1...
Installed unordered-containers-0.2.5.1
Configuring semigroups-0.16.2.2...
Building semigroups-0.16.2.2...
Installed semigroups-0.16.2.2
Configuring void-0.7...
Configuring bifunctors-5...
Installed vector-0.10.12.3
Building void-0.7...
Building bifunctors-5...
Installed void-0.7
Configuring contravariant-1.3.1.1...
Building contravariant-1.3.1.1...
Installed contravariant-1.3.1.1
Configuring comonad-4.2.6...
Installed bifunctors-5
Building comonad-4.2.6...
Installed comonad-4.2.6
Configuring profunctors-5.1.1...
Configuring semigroupoids-5.0.0.2...
Building profunctors-5.1.1...
Building semigroupoids-5.0.0.2...
Installed profunctors-5.1.1
Installed semigroupoids-5.0.0.2
Downloading these-0.4.1...
Configuring these-0.4.1...
Building these-0.4.1...
Installed these-0.4.1
This seems an awful lot.
Are these exactly the packages contained in the dependency tree of Reflex ?
I suspect yes, but I am not sure, hence this question.
Not quite. At the moment, anything in the global package database is also used by sandboxes. I believe future versions of cabal-install will restrict this to a few whitelisted core packages that ship with GHC (and that shouldn't/can't be replaced anyway).

Jruby: unable to install gems, failing with undefined class/module YAML::Syck::DefaultKey

The console output pretty much speaks for itself:
$ java -jar jruby-complete-1.6.4.jar -S gem install nokogiri --no-rdoc --no-ri
Fetching: nokogiri-1.5.0-java.gem (100%)
Successfully installed nokogiri-1.5.0-java
1 gem installed
11:17:04|dkowis#racktop jruby
$ java -jar jruby-complete-1.6.4.jar -S gem install cucumber --no-rdoc --no-ri
ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::Syck::DefaultKey
11:18:24|dkowis#racktop jruby
$ java -jar jruby-complete-1.6.4.jar -S gem install cuke4duke --version=0.4.4 --no-rdoc --no-ri
ERROR: While executing gem ... (ArgumentError)
undefined class/module YAML::Syck::DefaultKey
There's a couple gems I can install, but the ones I need, I cannot. Is it a problem with the gem itself? Is it a problem with rubygems? I'm not able to puzzle this one out.
This apparently is a known issue with Rubygems reported here on the JRuby Forum.
There is a pull request to fix this Rubygems error, but you could try build the gems you want locally and correct the dependency statements in the gemspec file yourself. I had ran into the same problem with the i18n-js gem.
Hope this helps.

Resources