mutating standard sensu check output for graphite

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.

Hi Arnaud,

You can do it using WizardVan:

Best Regards,

Ludo

···

On Wed, Aug 26, 2015 at 12:45 PM, arnaud@meetup.com wrote:

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.

Ludovic Francois

Cell: +1 747 220 1444
www.msolution.io

Hi Ludovic thanks for your answer.

I tried setting up wizardvan and here is my current configuration:

(DEV) sensuserver sensu # ls -al etc/sensu/extensions/handlers/relay.rb
-rwxr-xr-x 1 root root 5967 Aug 27 10:31 etc/sensu/extensions/handlers/relay.rb
(DEV) sensuserver sensu # cat etc/sensu/conf.d/config_relay.json
{
“relay”: {
“graphite”: {
“host”: “127.0.0.1”,
“port”: 2003,
“max_queue_size”: 10
}
}
}
(DEV) sensuserver sensu # cat etc/sensu/conf.d/checks/check_ram_nongraphite.json
{
“checks”: {
“checkram_nongraphite”: {
“type”: “metric”,
“command”: “/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 75”,
“interval”: 4,
“subscribers”: [“all”,“app”],
“handlers”: [“relay”, “flapjack”]
}
}
}
(DEV) sensuserver sensu #

Graphite is also set correctly on localhost and i set up the relay extension to buffer metrics up to 0.01 kilobyte then send them to carbon (“max_queue_size”: 10), yet i am not seeing anything in whisper/graphite so far. My sensu server logs are not showing any errors regarding the relay extension so far and it seems like the output is blank versus that of the flapjack extension for instance.

{“timestamp”:“2015-08-27T11:00:10.434522-0400”,“level”:“info”,“message”:“handler extension output”,“extension”:{“type”:“extension”,“name”:“flapjack”,“mutator”:“ruby_hash”},“output”:“sent an event to the flapjack redis queue”,“status”:0}
{“timestamp”:“2015-08-27T11:00:10.450597-0400”,“level”:“info”,“message”:“handler extension output”,“extension”:{“type”:“extension”,“name”:“relay”,“mutator”:“metrics”},“output”:“”,“status”:0}

Any ideas? How’s the logging for the relay extension supposed to be when everything is working correctly? Thanks.

Arnaud-

···

On Wednesday, August 26, 2015 at 4:06:26 PM UTC-4, Ludovic Francois wrote:

Hi Arnaud,

You can do it using WizardVan:

Best Regards,

Ludo

On Wed, Aug 26, 2015 at 12:45 PM, arn...@meetup.com wrote:

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.


Ludovic Francois

Cell: +1 747 220 1444
www.msolution.io

And the check is being run on the sensu-client as well based on these client logs.

{“timestamp”:“2015-08-27T11:39:45.590939-0400”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“arnaud”,“check”:{“name”:“checkram_nongraphite”,“issued”:1440689985,“command”:“/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 75”,“executed”:1440689985,“duration”:0.071,“output”:“CheckRAM CRITICAL: 40% free RAM left\n”,“status”:2}}}

i am not sure what i could be missing here…

···

On Thursday, August 27, 2015 at 11:11:16 AM UTC-4, arn...@meetup.com wrote:

Hi Arnaud,

You can do it using WizardVan:

Best Regards,

Ludo

On Wed, Aug 26, 2015 at 12:45 PM, arn...@meetup.com wrote:

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.


Ludovic Francois

Cell: +1 747 220 1444
www.msolution.io

Hi Ludovic thanks for your answer.

I tried setting up wizardvan and here is my current configuration:

(DEV) sensuserver sensu # ls -al etc/sensu/extensions/handlers/relay.rb
-rwxr-xr-x 1 root root 5967 Aug 27 10:31 etc/sensu/extensions/handlers/relay.rb
(DEV) sensuserver sensu # cat etc/sensu/conf.d/config_relay.json
{
“relay”: {
“graphite”: {
“host”: “127.0.0.1”,
“port”: 2003,
“max_queue_size”: 10
}
}
}
(DEV) sensuserver sensu # cat etc/sensu/conf.d/checks/check_ram_nongraphite.json
{
“checks”: {
“checkram_nongraphite”: {
“type”: “metric”,
“command”: “/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 75”,
“interval”: 4,
“subscribers”: [“all”,“app”],
“handlers”: [“relay”, “flapjack”]
}
}
}
(DEV) sensuserver sensu #

Graphite is also set correctly on localhost and i set up the relay extension to buffer metrics up to 0.01 kilobyte then send them to carbon (“max_queue_size”: 10), yet i am not seeing anything in whisper/graphite so far. My sensu server logs are not showing any errors regarding the relay extension so far and it seems like the output is blank versus that of the flapjack extension for instance.

{“timestamp”:“2015-08-27T11:00:10.434522-0400”,“level”:“info”,“message”:“handler extension output”,“extension”:{“type”:“extension”,“name”:“flapjack”,“mutator”:“ruby_hash”},“output”:“sent an event to the flapjack redis queue”,“status”:0}
{“timestamp”:“2015-08-27T11:00:10.450597-0400”,“level”:“info”,“message”:“handler extension output”,“extension”:{“type”:“extension”,“name”:“relay”,“mutator”:“metrics”},“output”:“”,“status”:0}

Any ideas? How’s the logging for the relay extension supposed to be when everything is working correctly? Thanks.

Arnaud-

On Wednesday, August 26, 2015 at 4:06:26 PM UTC-4, Ludovic Francois wrote:

Hi Arnaud,

You can do it using WizardVan:

Best Regards,

Ludo

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.


Ludovic Francois

Cell: +1 747 220 1444
www.msolution.io

And the check is being run on the sensu-client as well based on these client logs.

{“timestamp”:“2015-08-27T11:39:45.590939-0400”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“arnaud”,“check”:{“name”:“checkram_nongraphite”,“issued”:1440689985,“command”:“/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 75”,“executed”:1440689985,“duration”:0.071,“output”:“CheckRAM CRITICAL: 40% free RAM left\n”,“status”:2}}}

i am not sure what i could be missing here…

···

On Wed, Aug 26, 2015 at 12:45 PM, arn...@meetup.com wrote:

On Wednesday, August 26, 2015 at 4:06:26 PM UTC-4, Ludovic Francois wrote:

Anyone knows what i may be doing wrong here? thanks.

···

On Thursday, August 27, 2015 at 11:44:09 AM UTC-4, arn...@meetup.com wrote:

Hi Arnaud,

You can do it using WizardVan:

Best Regards,

Ludo

On Wed, Aug 26, 2015 at 12:45 PM, arn...@meetup.com wrote:

Anyone knows what i can do - or how to configure my handler- to pass this sort of output format from a check to a handler that sends it to graphite ?

/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 43
CheckRAM CRITICAL: 42% free RAM left

Is there a way i can configure a handler to transform that output into this other format then send it to graphite?
arnaud.memory_percent.freeWOBuffersCaches 42.5292181144148 1440618076

Thanks.


Ludovic Francois

Cell: +1 747 220 1444
www.msolution.io

And the check is being run on the sensu-client as well based on these client logs.

{“timestamp”:“2015-08-27T11:39:45.590939-0400”,“level”:“info”,“message”:“publishing check result”,“payload”:{“client”:“arnaud”,“check”:{“name”:“checkram_nongraphite”,“issued”:1440689985,“command”:“/usr/local/sensu/etc/sensu/plugins/system/check-ram.rb -c 75”,“executed”:1440689985,“duration”:0.071,“output”:“CheckRAM CRITICAL: 40% free RAM left\n”,“status”:2}}}

i am not sure what i could be missing here…

On Wednesday, August 26, 2015 at 4:06:26 PM UTC-4, Ludovic Francois wrote: