Which InfluxDB Handler to pick

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Hey Tim,

There is an “official” Sensu Extension for InfluxDB. To load it, you use sensu-install to install the sensu-extensions-influxdb gem. The github page has documentation to use the extension: https://github.com/sensu-extensions/sensu-extensions-influxdb

Basically, this extension creates an internal handler for you to send the metrics to. Since it’s not a real handler, it runs in the native ruby environment for better performance, allowing for batch submission of metrics. In comparing this extension against the sensu-plugins-influxdb, the plugin created a lot more load on the system when used for a lot of metrics.

Hopefully that gives you some direction.

Cheers

···

On Wed, Jul 26, 2017 at 3:09 AM, Tim Hofmann seji64@gmail.com wrote:

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Steven Viola

Hi Steve,

thanks for your answer. Did you get this extesion running? Sensu is reporting that the handler “influxdb” is not found. It also not seems to load the extension.

Do i have also to put some files in the /etc/sensu/extension directory?

···

Am Mittwoch, 26. Juli 2017 16:44:42 UTC+2 schrieb Steve Viola:

Hey Tim,

There is an “official” Sensu Extension for InfluxDB. To load it, you use sensu-install to install the sensu-extensions-influxdb gem. The github page has documentation to use the extension: https://github.com/sensu-extensions/sensu-extensions-influxdb

Basically, this extension creates an internal handler for you to send the metrics to. Since it’s not a real handler, it runs in the native ruby environment for better performance, allowing for batch submission of metrics. In comparing this extension against the sensu-plugins-influxdb, the plugin created a lot more load on the system when used for a lot of metrics.

Hopefully that gives you some direction.

Cheers

Steven Viola

On Wed, Jul 26, 2017 at 3:09 AM, Tim Hofmann sej...@gmail.com wrote:

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Hey Tim,

Yes I am able to get the extension running. The README of the extension details a lot of the configuration options, along with the way to load extensions from a gem. Here’s additional sensu docs for loading extensions via a gem.

For example, this is how you’ll need to load the influxdb extension (this can be in any file in the /etc/sensu/conf.d/):

{
“extensions”: {
“influxdb”: {
“gem”: “sensu-extensions-influxdb”
}
}
}

You’ll then probably want to create a handler set so that you can add more controls for the handler if you want to. Copied from the README:

{
“handlers”: {
“metrics”: {
“type”: “set”,
“handlers”: [
“influxdb”
]
}
}
}

You’d then set the handler to metrics. When starting up the sensu server, you should see log messages like this:

···

On Wed, Jul 26, 2017 at 11:13 AM, Tim Hofmann seji64@gmail.com wrote:

Hi Steve,

thanks for your answer. Did you get this extesion running? Sensu is reporting that the handler “influxdb” is not found. It also not seems to load the extension.

Do i have also to put some files in the /etc/sensu/extension directory?

Am Mittwoch, 26. Juli 2017 16:44:42 UTC+2 schrieb Steve Viola:

Hey Tim,

There is an “official” Sensu Extension for InfluxDB. To load it, you use sensu-install to install the sensu-extensions-influxdb gem. The github page has documentation to use the extension: https://github.com/sensu-extensions/sensu-extensions-influxdb

Basically, this extension creates an internal handler for you to send the metrics to. Since it’s not a real handler, it runs in the native ruby environment for better performance, allowing for batch submission of metrics. In comparing this extension against the sensu-plugins-influxdb, the plugin created a lot more load on the system when used for a lot of metrics.

Hopefully that gives you some direction.

Cheers

Steven Viola

On Wed, Jul 26, 2017 at 3:09 AM, Tim Hofmann sej...@gmail.com wrote:

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Steven Viola

Hi Steve,

i am now a step further. i think i placed the config which loads the extension in the wrong directory.

but i am now stuck somewhere else. My Log (sensu server) output is the following:

{“timestamp”:“2017-07-27T08:32:53.074539+0200”,“level”:“warn”,“message”:“loading extension files from directory”,“directory”:“/etc/sensu/extensions”}

{“timestamp”:“2017-07-27T08:32:53.074592+0200”,“level”:“warn”,“message”:“loading extension gem”,“gem”:“sensu-extensions-influxdb”,“version”:null}

{“timestamp”:“2017-07-27T08:32:53.074618+0200”,“level”:“warn”,“message”:“requiring extension gem”,“require”:“sensu/extensions/influxdb”}

{“timestamp”:“2017-07-27T08:32:53.074638+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“filter”,“name”:“occurrences”,“description”:“filter events using event occurrences”}

{“timestamp”:“2017-07-27T08:32:53.074658+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“filter”,“name”:“check_dependencies”,“description”:“filter events when an event exists for a check dependency”}

{“timestamp”:“2017-07-27T08:32:53.074678+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“only_check_output”,“description”:“returns check output”}

{“timestamp”:“2017-07-27T08:32:53.074695+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“ruby_hash”,“description”:“returns ruby hash event data”}

{“timestamp”:“2017-07-27T08:32:53.074722+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“json”,“description”:“returns JSON formatted event data”}

{“timestamp”:“2017-07-27T08:32:53.074743+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“debug”,“description”:“returns raw event data”}

{“timestamp”:“2017-07-27T08:32:53.074760+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“influxdb-extension”,“description”:“Transforms and sends metrics to InfluxDB”}

{“timestamp”:“2017-07-27T08:32:53.074804+0200”,“level”:“info”,“message”:“configuring sensu spawn”,“settings”:{“limit”:12}}

/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extensions-influxdb-2.1.0/lib/sensu/extensions/influxdb.rb:34:in create_config': undefined method ArgumentError’ for #Sensu::Extension::InfluxDB:0x000000020dcf08 (NoMethodError)

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extensions-influxdb-2.1.0/lib/sensu/extensions/influxdb.rb:83:in `post_init’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extension-1.5.1/lib/sensu/extension.rb:19:in `block in initialize’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:977:in `block in run_deferred_callbacks’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:974:in `times’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:974:in `run_deferred_callbacks’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run_machine’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.0/lib/sensu/server/process.rb:33:in `run’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.0/exe/sensu-server:10:in `<top (required)>’

from /opt/sensu/bin/sensu-server:22:in `load’

from /opt/sensu/bin/sensu-server:22:in `’

``

Installed Gem’s:

[root@SIT-MONP03 ~]# /opt/sensu/embedded/bin/gem list

*** LOCAL GEMS ***

addressable (2.5.1)

amq-protocol (2.0.1)

amqp (1.6.0)

bigdecimal (default: 1.3.0)

cause (0.1)

childprocess (0.5.8)

cookiejar (0.3.3)

dentaku (2.0.9)

did_you_mean (1.1.0)

em-http-request (1.1.5)

em-http-server (0.1.8)

em-socksify (0.3.1)

em-worker (0.0.2)

english (0.6.3)

eventmachine (1.2.2)

ffi (1.9.18)

http_parser.rb (0.6.0)

io-console (default: 0.4.6)

json (default: 2.0.2, 1.8.6)

jsonpath (0.5.8)

language (0.6.0)

linux-kstat (0.1.3 universal-linux)

minitest (5.10.1)

mixlib-cli (1.7.0)

multi_json (1.12.1)

net-telnet (0.1.1)

oj (2.18.1)

openssl (default: 2.0.3)

parse-cron (0.1.4)

power_assert (0.4.1)

psych (default: 2.2.2)

public_suffix (2.0.5)

rake (12.0.0)

rake-compiler (1.0.4)

rb-readline (0.5.3)

rdoc (default: 5.0.0)

rubygems-update (2.6.10)

sensu (1.0.0)

sensu-extension (1.5.1)

sensu-extensions (1.9.0)

sensu-extensions-check-dependencies (1.0.1)

sensu-extensions-debug (1.0.0)

sensu-extensions-influxdb (2.1.0)

sensu-extensions-json (1.0.0)

sensu-extensions-occurrences (1.2.0)

sensu-extensions-only-check-output (1.0.0)

sensu-extensions-ruby-hash (1.0.0)

sensu-json (2.1.0)

sensu-logger (1.2.1)

sensu-plugin (2.0.1, 1.4.5)

sensu-plugins-cpu-checks (1.1.2)

sensu-plugins-disk-checks (2.2.0)

sensu-plugins-influxdb (1.2.0)

sensu-plugins-load-checks (3.0.0)

sensu-plugins-memory-checks (2.1.0)

sensu-plugins-process-checks (2.3.0)

sensu-plugins-vmstats (1.0.0)

sensu-redis (2.2.0)

sensu-settings (10.2.0)

sensu-spawn (2.2.1)

sensu-transport (7.0.2)

sys-filesystem (1.1.7)

sys-proctable (0.9.8 universal-linux)

test-unit (3.2.3)

xmlrpc (0.2.1)

``

I’am running Sensu 1.0 on CentOS 7

···

Am Mittwoch, 26. Juli 2017 17:27:19 UTC+2 schrieb Steve Viola:

Hey Tim,

Yes I am able to get the extension running. The README of the extension details a lot of the configuration options, along with the way to load extensions from a gem. Here’s additional sensu docs for loading extensions via a gem.

For example, this is how you’ll need to load the influxdb extension (this can be in any file in the /etc/sensu/conf.d/):

{
“extensions”: {
“influxdb”: {
“gem”: “sensu-extensions-influxdb”
}
}
}

You’ll then probably want to create a handler set so that you can add more controls for the handler if you want to. Copied from the README:

{
“handlers”: {
“metrics”: {
“type”: “set”,
“handlers”: [
“influxdb”
]
}
}
}

You’d then set the handler to metrics. When starting up the sensu server, you should see log messages like this:

{“timestamp”:“2017-07-26T15:21:53.333431+0000”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“influxdb”,“description”:“Outputs metrics to InfluxDB”}

Steven Viola

On Wed, Jul 26, 2017 at 11:13 AM, Tim Hofmann sej...@gmail.com wrote:

Hi Steve,

thanks for your answer. Did you get this extesion running? Sensu is reporting that the handler “influxdb” is not found. It also not seems to load the extension.

Do i have also to put some files in the /etc/sensu/extension directory?

Am Mittwoch, 26. Juli 2017 16:44:42 UTC+2 schrieb Steve Viola:

Hey Tim,

There is an “official” Sensu Extension for InfluxDB. To load it, you use sensu-install to install the sensu-extensions-influxdb gem. The github page has documentation to use the extension: https://github.com/sensu-extensions/sensu-extensions-influxdb

Basically, this extension creates an internal handler for you to send the metrics to. Since it’s not a real handler, it runs in the native ruby environment for better performance, allowing for batch submission of metrics. In comparing this extension against the sensu-plugins-influxdb, the plugin created a lot more load on the system when used for a lot of metrics.

Hopefully that gives you some direction.

Cheers

Steven Viola

On Wed, Jul 26, 2017 at 3:09 AM, Tim Hofmann sej...@gmail.com wrote:

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Tim,

I was mistaken when I sent you the “official” ruby gem, since it seems that the extension in ruby-gems is for a different project. There’s an active discussion happening on github regarding this: https://github.com/sensu-extensions/sensu-extensions-influxdb/issues/4#issuecomment-318299156

It looks like you’ll need to build your own gem if you want to use the sensu-extensions version. As an alternative, you could checkout the README for https://github.com/jhrv/sensu-influxdb-extension, which seems to be the version of the extension you already installed.

Sorry for the confusion. I’ve not used the jhrv version of the extension, but can try and help you out if you run into issues.

···

On Thu, Jul 27, 2017 at 2:37 AM, Tim Hofmann seji64@gmail.com wrote:

Hi Steve,

i am now a step further. i think i placed the config which loads the extension in the wrong directory.

but i am now stuck somewhere else. My Log (sensu server) output is the following:

{“timestamp”:“2017-07-27T08:32:53.074539+0200”,“level”:“warn”,“message”:“loading extension files from directory”,“directory”:“/etc/sensu/extensions”}

{“timestamp”:“2017-07-27T08:32:53.074592+0200”,“level”:“warn”,“message”:“loading extension gem”,“gem”:“sensu-extensions-influxdb”,“version”:null}

{“timestamp”:“2017-07-27T08:32:53.074618+0200”,“level”:“warn”,“message”:“requiring extension gem”,“require”:“sensu/extensions/influxdb”}

{“timestamp”:“2017-07-27T08:32:53.074638+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“filter”,“name”:“occurrences”,“description”:“filter events using event occurrences”}

{“timestamp”:“2017-07-27T08:32:53.074658+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“filter”,“name”:“check_dependencies”,“description”:“filter events when an event exists for a check dependency”}

{“timestamp”:“2017-07-27T08:32:53.074678+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“only_check_output”,“description”:“returns check output”}

{“timestamp”:“2017-07-27T08:32:53.074695+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“ruby_hash”,“description”:“returns ruby hash event data”}

{“timestamp”:“2017-07-27T08:32:53.074722+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“mutator”,“name”:“json”,“description”:“returns JSON formatted event data”}

{“timestamp”:“2017-07-27T08:32:53.074743+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“debug”,“description”:“returns raw event data”}

{“timestamp”:“2017-07-27T08:32:53.074760+0200”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“influxdb-extension”,“description”:“Transforms and sends metrics to InfluxDB”}

{“timestamp”:“2017-07-27T08:32:53.074804+0200”,“level”:“info”,“message”:“configuring sensu spawn”,“settings”:{“limit”:12}}

/opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extensions-influxdb-2.1.0/lib/sensu/extensions/influxdb.rb:34:in create_config': undefined method ArgumentError’ for #Sensu::Extension::InfluxDB:0x000000020dcf08 (NoMethodError)

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extensions-influxdb-2.1.0/lib/sensu/extensions/influxdb.rb:83:in `post_init’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-extension-1.5.1/lib/sensu/extension.rb:19:in `block in initialize’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:977:in `block in run_deferred_callbacks’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:974:in `times’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:974:in `run_deferred_callbacks’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run_machine’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/eventmachine-1.2.2/lib/eventmachine.rb:194:in `run’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.0/lib/sensu/server/process.rb:33:in `run’

from /opt/sensu/embedded/lib/ruby/gems/2.4.0/gems/sensu-1.0.0/exe/sensu-server:10:in `<top (required)>’

from /opt/sensu/bin/sensu-server:22:in `load’

from /opt/sensu/bin/sensu-server:22:in `’

``

Installed Gem’s:

[root@SIT-MONP03 ~]# /opt/sensu/embedded/bin/gem list

*** LOCAL GEMS ***

addressable (2.5.1)

amq-protocol (2.0.1)

amqp (1.6.0)

bigdecimal (default: 1.3.0)

cause (0.1)

childprocess (0.5.8)

cookiejar (0.3.3)

dentaku (2.0.9)

did_you_mean (1.1.0)

em-http-request (1.1.5)

em-http-server (0.1.8)

em-socksify (0.3.1)

em-worker (0.0.2)

english (0.6.3)

eventmachine (1.2.2)

ffi (1.9.18)

http_parser.rb (0.6.0)

io-console (default: 0.4.6)

json (default: 2.0.2, 1.8.6)

jsonpath (0.5.8)

language (0.6.0)

linux-kstat (0.1.3 universal-linux)

minitest (5.10.1)

mixlib-cli (1.7.0)

multi_json (1.12.1)

net-telnet (0.1.1)

oj (2.18.1)

openssl (default: 2.0.3)

parse-cron (0.1.4)

power_assert (0.4.1)

psych (default: 2.2.2)

public_suffix (2.0.5)

rake (12.0.0)

rake-compiler (1.0.4)

rb-readline (0.5.3)

rdoc (default: 5.0.0)

rubygems-update (2.6.10)

sensu (1.0.0)

sensu-extension (1.5.1)

sensu-extensions (1.9.0)

sensu-extensions-check-dependencies (1.0.1)

sensu-extensions-debug (1.0.0)

sensu-extensions-influxdb (2.1.0)

sensu-extensions-json (1.0.0)

sensu-extensions-occurrences (1.2.0)

sensu-extensions-only-check-output (1.0.0)

sensu-extensions-ruby-hash (1.0.0)

sensu-json (2.1.0)

sensu-logger (1.2.1)

sensu-plugin (2.0.1, 1.4.5)

sensu-plugins-cpu-checks (1.1.2)

sensu-plugins-disk-checks (2.2.0)

sensu-plugins-influxdb (1.2.0)

sensu-plugins-load-checks (3.0.0)

sensu-plugins-memory-checks (2.1.0)

sensu-plugins-process-checks (2.3.0)

sensu-plugins-vmstats (1.0.0)

sensu-redis (2.2.0)

sensu-settings (10.2.0)

sensu-spawn (2.2.1)

sensu-transport (7.0.2)

sys-filesystem (1.1.7)

sys-proctable (0.9.8 universal-linux)

test-unit (3.2.3)

xmlrpc (0.2.1)

``

I’am running Sensu 1.0 on CentOS 7

Am Mittwoch, 26. Juli 2017 17:27:19 UTC+2 schrieb Steve Viola:

Hey Tim,

Yes I am able to get the extension running. The README of the extension details a lot of the configuration options, along with the way to load extensions from a gem. Here’s additional sensu docs for loading extensions via a gem.

For example, this is how you’ll need to load the influxdb extension (this can be in any file in the /etc/sensu/conf.d/):

{
“extensions”: {
“influxdb”: {
“gem”: “sensu-extensions-influxdb”
}
}
}

You’ll then probably want to create a handler set so that you can add more controls for the handler if you want to. Copied from the README:

{
“handlers”: {
“metrics”: {
“type”: “set”,
“handlers”: [
“influxdb”
]
}
}
}

You’d then set the handler to metrics. When starting up the sensu server, you should see log messages like this:

{“timestamp”:“2017-07-26T15:21:53.333431+0000”,“level”:“warn”,“message”:“loaded extension”,“type”:“handler”,“name”:“influxdb”,“description”:“Outputs metrics to InfluxDB”}

Steven Viola

On Wed, Jul 26, 2017 at 11:13 AM, Tim Hofmann sej...@gmail.com wrote:

Hi Steve,

thanks for your answer. Did you get this extesion running? Sensu is reporting that the handler “influxdb” is not found. It also not seems to load the extension.

Do i have also to put some files in the /etc/sensu/extension directory?

Am Mittwoch, 26. Juli 2017 16:44:42 UTC+2 schrieb Steve Viola:

Hey Tim,

There is an “official” Sensu Extension for InfluxDB. To load it, you use sensu-install to install the sensu-extensions-influxdb gem. The github page has documentation to use the extension: https://github.com/sensu-extensions/sensu-extensions-influxdb

Basically, this extension creates an internal handler for you to send the metrics to. Since it’s not a real handler, it runs in the native ruby environment for better performance, allowing for batch submission of metrics. In comparing this extension against the sensu-plugins-influxdb, the plugin created a lot more load on the system when used for a lot of metrics.

Hopefully that gives you some direction.

Cheers

Steven Viola

On Wed, Jul 26, 2017 at 3:09 AM, Tim Hofmann sej...@gmail.com wrote:

Hi,

i have got a short question. Ich want to send my sensu Metrics to a InfluxDB (with Grafana as fronted). I googeld a lot an there a so much InfluxDB Handlers for Sensu. But all of them seems to be a bit outdated.

Is there any “offical” Sensu Extension/Plugin for that or could you recommened one?

Thanks in advance.

Steven Viola