error reading event in Sensu

Hi All,

I need to send alert based on threshold values and so created handler(sensu-plugins-mailer) which handler_mailer.json and mailer.json,

But I am getting below error when executing the check.

{“timestamp”:“2016-03-18T11:08:05.453387+0000”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“severities”:[“warning”,“critical”],“command”:"/opt/sensu/embedded/bin/handler-mailer.rb",“name”:“mailer”},“output”:[“error reading event: 776: unexpected token at ‘CheckGraphiteData WARNING: internal.1.disk-usage.root.used has passed warning threshold (18345.0)\n’\n”]}

Below my handler_mailer.json:

{

“handlers”: {

“mailer”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“severities”: [“warning”,“critical”],

“command”: “/opt/sensu/embedded/bin/handler-mailer.rb”

}

}

}

and mailer.json:

{

“mailer”: {

“admin_gui”: “http://XX.XX.XX.XX:3000/#/events”,

“mail_to”: "123@example.com",

“mail_from”: "abc@example.com",

“smtp_server”: “XXXXXX”,

“smtp_port”: “587”,

“smtp_domain”: “example.com”,

“smtp_tls_note_starttls_offer” = “yes”,

“smtp_use_tls” = “yes”,

“smtp_sasl_auth_enable” = “yes”,

“smtp_username”: “XXXXXX”,

“smtp_password”: “XXXXXXX”

}

}

Check json :

{

“checks”: {

“sensuclientgraphite”: {

“type”: “metric”,

“handlers”: [“mailer”],

“command”: “/usr/bin/env /etc/sensu/plugins/check-graphite-data.rb -s XX.XX.XX.XX:8080 -t ‘highestCurrent(internal._dev3.*.1.disk-usage.root.used,1)’ -w 18 -c 400000 -a 120”,

“interval”: 10,

“output”: “testingg”,

“status”: 1,

“history”: 1,

“refresh”: 10,

“subscribers”: [

“sensuclient-graphite”

]

}

}

}

Please suggest me ,As I am totally blocked.

Thanks in advance

Hi All,
Please help me.

···

On Friday, March 18, 2016 at 4:49:32 PM UTC+5:30, kumar kittu wrote:

Hi All,

I need to send alert based on threshold values and so created handler(sensu-plugins-mailer) which handler_mailer.json and mailer.json,

But I am getting below error when executing the check.

{“timestamp”:“2016-03-18T11:08:05.453387+0000”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“severities”:[“warning”,“critical”],“command”:“/opt/sensu/embedded/bin/handler-mailer.rb”,“name”:“mailer”},“output”:[“error reading event: 776: unexpected token at ‘CheckGraphiteData WARNING: internal.1.disk-usage.root.used has passed warning threshold (18345.0)\n’\n”]}

Below my handler_mailer.json:

{

“handlers”: {

“mailer”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“severities”: [“warning”,“critical”],

“command”: “/opt/sensu/embedded/bin/handler-mailer.rb”

}

}

}

and mailer.json:

{

“mailer”: {

“admin_gui”: “http://XX.XX.XX.XX:3000/#/events”,

“mail_to”: “123@example.com”,

“mail_from”: “abc@example.com”,

“smtp_server”: “XXXXXX”,

“smtp_port”: “587”,

“smtp_domain”: “example.com”,

“smtp_tls_note_starttls_offer” = “yes”,

“smtp_use_tls” = “yes”,

“smtp_sasl_auth_enable” = “yes”,

“smtp_username”: “XXXXXX”,

“smtp_password”: “XXXXXXX”

}

}

Check json :

{

“checks”: {

“sensuclientgraphite”: {

“type”: “metric”,

“handlers”: [“mailer”],

“command”: “/usr/bin/env /etc/sensu/plugins/check-graphite-data.rb -s XX.XX.XX.XX:8080 -t ‘highestCurrent(internal._dev3.*.1.disk-usage.root.used,1)’ -w 18 -c 400000 -a 120”,

“interval”: 10,

“output”: “testingg”,

“status”: 1,

“history”: 1,

“refresh”: 10,

“subscribers”: [

“sensuclient-graphite”

]

}

}

}

Please suggest me ,As I am totally blocked.

Thanks in advance

Hi All,

Please suggest where i am getting wrong.

···

On Friday, March 18, 2016 at 4:49:32 PM UTC+5:30, kumar kittu wrote:

Hi All,

I need to send alert based on threshold values and so created handler(sensu-plugins-mailer) which handler_mailer.json and mailer.json,

But I am getting below error when executing the check.

{“timestamp”:“2016-03-18T11:08:05.453387+0000”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“severities”:[“warning”,“critical”],“command”:“/opt/sensu/embedded/bin/handler-mailer.rb”,“name”:“mailer”},“output”:[“error reading event: 776: unexpected token at ‘CheckGraphiteData WARNING: internal.1.disk-usage.root.used has passed warning threshold (18345.0)\n’\n”]}

Below my handler_mailer.json:

{

“handlers”: {

“mailer”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“severities”: [“warning”,“critical”],

“command”: “/opt/sensu/embedded/bin/handler-mailer.rb”

}

}

}

and mailer.json:

{

“mailer”: {

“admin_gui”: “http://XX.XX.XX.XX:3000/#/events”,

“mail_to”: “123@example.com”,

“mail_from”: “abc@example.com”,

“smtp_server”: “XXXXXX”,

“smtp_port”: “587”,

“smtp_domain”: “example.com”,

“smtp_tls_note_starttls_offer” = “yes”,

“smtp_use_tls” = “yes”,

“smtp_sasl_auth_enable” = “yes”,

“smtp_username”: “XXXXXX”,

“smtp_password”: “XXXXXXX”

}

}

Check json :

{

“checks”: {

“sensuclientgraphite”: {

“type”: “metric”,

“handlers”: [“mailer”],

“command”: “/usr/bin/env /etc/sensu/plugins/check-graphite-data.rb -s XX.XX.XX.XX:8080 -t ‘highestCurrent(internal._dev3.*.1.disk-usage.root.used,1)’ -w 18 -c 400000 -a 120”,

“interval”: 10,

“output”: “testingg”,

“status”: 1,

“history”: 1,

“refresh”: 10,

“subscribers”: [

“sensuclient-graphite”

]

}

}

}

Please suggest me ,As I am totally blocked.

Thanks in advance