error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n

I have a handler similar to the mailer notification handler. I also have check-http configured to use this handler:

{

“handlers”: {

“google_voice”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“command”: “/etc/sensu/handlers/google_voice.rb”,

“severities”: [

“critical”,

“ok”

]

}

}

}

{

“checks”: {

“apache-git.xxx.us-check”: {

“type”: “status”,

“command”: “check-http.rb -u https://git.xxx.us/git/xxx.git/info/refs --username xxx --password ****”,

“handlers”: [

“google_voice”

],

“standalone”: true,

“interval”: 30

}

}

}

I see this in the log with debug turned on:

{“timestamp”:“2014-01-06T22:32:45.496503-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:"/etc/sensu/handlers/google_voice.rb",“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n”}

here is a larger redacted portion of the log:

{“timestamp”:“2014-01-07T11:32:51.929871-0500”,“level”:“debug”,“message”:“received result”,“result”:{“client”:“git.xxxxx.us”,“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219}}}

{“timestamp”:“2014-01-07T11:32:51.930031-0500”,“level”:“debug”,“message”:“processing result”,“result”:{“client”:“git.xxxxx.us”,“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219}}}

{“timestamp”:“2014-01-07T11:32:51.931297-0500”,“level”:“info”,“message”:“handling event”,“event”:{“client”:{“name”:“git.xxxxx.us”,“address”:“10.2.2.231”,“subscriptions”:[“all”],“timestamp”:1389112369},“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219,“history”:[“2”]},“occurrences”:1,“action”:“create”},“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”}}

{“timestamp”:“2014-01-07T11:32:52.844672-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n”}

{“timestamp”:“2014-01-07T11:32:52.844868-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“'\n”}

···

On Tue, Jan 7, 2014 at 12:11 AM, Jay Flowers jay.flowers@gmail.com wrote:

I have a handler similar to the mailer notification handler. I also have check-http configured to use this handler:

{

“handlers”: {

“google_voice”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“command”: “/etc/sensu/handlers/google_voice.rb”,

“severities”: [

“critical”,

“ok”

]

}

}

}

{

“checks”: {

“apache-git.xxx.us-check”: {

“type”: “status”,

“command”: “check-http.rb -u https://git.xxx.us/git/xxx.git/info/refs --username xxx --password ****”,

“handlers”: [

“google_voice”

],

“standalone”: true,

“interval”: 30

}

}

}

I see this in the log with debug turned on:

{“timestamp”:“2014-01-06T22:32:45.496503-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n”}


Jay Flowers

http://jayflowers.com


Hey Jay,

If the Google voice handler expects JSON event data, you cannot use the “only_check_output” mutator with it, as that mutator only passes the check output to the handler, a string.

Sean.

···

On Tue, Jan 7, 2014 at 8:38 AM, Jay Flowers jay.flowers@gmail.com wrote:

here is a larger redacted portion of the log:

{“timestamp”:“2014-01-07T11:32:51.929871-0500”,“level”:“debug”,“message”:“received result”,“result”:{“client”:“git.xxxxx.us”,“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219}}}

{“timestamp”:“2014-01-07T11:32:51.930031-0500”,“level”:“debug”,“message”:“processing result”,“result”:{“client”:“git.xxxxx.us”,“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219}}}

{“timestamp”:“2014-01-07T11:32:51.931297-0500”,“level”:“info”,“message”:“handling event”,“event”:{“client”:{“name”:“git.xxxxx.us”,“address”:“10.2.2.231”,“subscriptions”:[“all”],“timestamp”:1389112369},“check”:{“type”:“status”,“command”:“check-http.rb -u https://manage.xxxxx.us/ --username xxxxx --password Agilexadmin99$”,“handlers”:[“google_voice”],“standalone”:true,“interval”:30,“name”:“apache-manage.xxxxx.us-check”,“issued”:1389112363,“executed”:1389112363,“output”:“CheckHTTP CRITICAL: 500\n”,“status”:2,“duration”:6.219,“history”:[“2”]},“occurrences”:1,“action”:“create”},“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”}}

{“timestamp”:“2014-01-07T11:32:52.844672-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n”}

{“timestamp”:“2014-01-07T11:32:52.844868-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“'\n”}

On Tue, Jan 7, 2014 at 12:11 AM, Jay Flowers jay.flowers@gmail.com wrote:

I have a handler similar to the mailer notification handler. I also have check-http configured to use this handler:

{

“handlers”: {

“google_voice”: {

“type”: “pipe”,

“mutator”: “only_check_output”,

“command”: “/etc/sensu/handlers/google_voice.rb”,

“severities”: [

“critical”,

“ok”

]

}

}

}

{

“checks”: {

“apache-git.xxx.us-check”: {

“type”: “status”,

“command”: “check-http.rb -u https://git.xxx.us/git/xxx.git/info/refs --username xxx --password ****”,

“handlers”: [

“google_voice”

],

“standalone”: true,

“interval”: 30

}

}

}

I see this in the log with debug turned on:

{“timestamp”:“2014-01-06T22:32:45.496503-0500”,“level”:“info”,“message”:“handler output”,“handler”:{“type”:“pipe”,“mutator”:“only_check_output”,“command”:“/etc/sensu/handlers/google_voice.rb”,“severities”:[“critical”,“ok”],“name”:“google_voice”},“output”:“error reading event: 757: unexpected token at 'CheckHTTP CRITICAL: 500\n”}


Jay Flowers

http://jayflowers.com