This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[root@ handlers]# cat example.json | ./twitter.rb | |
path/ruby/gems/2.0.0/gems/sensu-plugin-0.2.2/lib/sensu-handler.rb:88:in `+': no implicit conversion of nil into String (TypeError) | |
from path/ruby/gems/2.0.0/gems/sensu-plugin-0.2.2/lib/sensu-handler.rb:88:in `filter_silenced' | |
from path/ruby/gems/2.0.0/gems/sensu-plugin-0.2.2/lib/sensu-handler.rb:22:in `filter' | |
from path/ruby/gems/2.0.0/gems/sensu-plugin-0.2.2/lib/sensu-handler.rb:40:in `block in <class:Handler>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"checks": { | |
"check_ntp": { | |
"handlers": [ | |
"twitter", | |
"mailer-ses", | |
"mailer" | |
], | |
"command": "/etc/sensu/plugins/check_ntp_time -H 0.pool.ntp.org -w 30 -c 60", | |
"interval": 60, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"timestamp":"2014-01-21T17:04:46.500540+0000","level":"info","message":"GET /info","remote_address":"x.x.x.x","user_agent":null,"request_method":"GET","request_uri":"/info","request_body":""} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl http://localhost:4567 -d prueba.json | |
where localhost:4567 is my sensu-api address and prueba.json is: | |
{"timestamp":"2014-01-23T04:22:31.183892+0000","level":"info","message":"publishing check result","payload":{"client":"server01","check":{"name":"check_vmstat","issued":1390278111,"command":"/etc/sensu/plugins/check_ntp_time -H 0.amazon.pool.ntp.org -w 30 -c 60","handlers":["mailer-ses","mailer"],"interval":60,"occurrences":1,"refresh":1800,"flapping":true,"subscribers":["monitoring_server"],"executed":1390278145,"output":"NTP CRITICAL: No response from NTP server\n","status":2,"duration":5.702}}} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"twitter": { | |
"twitterhandle": { | |
"sensusub": "aws", | |
"consumer_key": "my_key", | |
"consumer_secret": "my_secret_key", | |
"oauth_token": "my_oauth_token", | |
"oauth_token_secret": "my_oauth_token_secret" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env /opt/sensu/embedded/bin/ruby | |
# | |
# Sensu Twitter Handler | |
# === | |
# | |
# This handler reports alerts to a configured twitter handler. | |
# Map a twitter handle to a sensusub value in the twitter.json to get going! | |
# sensusub == subscription in the client object, not check.. | |
# see twitter.json for required values | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"twitterhandle"=>{"sensusub"=>"aws", "consumer_key"=>"my_key", "consumer_secret"=>"my_secret_key", "oauth_token"=>"my_oauth_token", "oauth_token_secret"=>"my_oauth_secret"}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"client":{ | |
"name":"host01", | |
"address":"10.2.1.11", | |
"subscriptions":[ | |
"all", | |
"env_qa", | |
"frontend", | |
"proxy", | |
"apache" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"timestamp":"2014-01-28T18:51:23.550594+0000","level":"info","message":"GET /stash/silence/host01","remote_address":"IP","user_agent":"Ruby","request_method":"GET","request_uri":"/stash/silence/host01","request_body":""} | |
{"timestamp":"2014-01-28T18:51:23.557813+0000","level":"info","message":"GET /stash/silence/host01/frontend_http_check","remote_address":"IP","user_agent":"Ruby","request_method":"GET","request_uri":"/stash/silence/host01/frontend_http_check","request_body":""} | |
{"timestamp":"2014-01-28T18:51:23.565828+0000","level":"info","message":"GET /stash/silence/all/frontend_http_check","remote_address":"IP","user_agent":"Ruby","request_method":"GET","request_uri":"/stash/silence/all/frontend_http_check","request_body":""} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
LoadBalancerUsageRecords": [ | |
{ | |
"averageNumConnections": 14.0, | |
"averageNumConnectionsSsl": 0.0, | |
"endTime": "timestamp1", | |
"id": xx, | |
"incomingTransfer": 5086690, | |
"incomingTransferSsl": 0, | |
"numPolls": 12, |
OlderNewer