Skip to content

Instantly share code, notes, and snippets.

View marianogg9's full-sized avatar

marianogg9

View GitHub Profile
@marianogg9
marianogg9 / gist:8714051
Created January 30, 2014 17:32
Response for curl request
{
LoadBalancerUsageRecords": [
{
"averageNumConnections": 14.0,
"averageNumConnectionsSsl": 0.0,
"endTime": "timestamp1",
"id": xx,
"incomingTransfer": 5086690,
"incomingTransferSsl": 0,
"numPolls": 12,
@marianogg9
marianogg9 / gist:8732467
Created January 31, 2014 13:55
/etc/collectd.conf
Hostname xx
FQDNLookup false
Interval 10
<Include "/etc/collectd.d">
Filter "*.conf"
</Include>
LoadPlugin syslog
LoadPlugin logfile
@marianogg9
marianogg9 / gist:8732488
Created January 31, 2014 13:57
/var/log/collectd/collectd.log
[2014-01-31 13:36:30] Replacing DS `connections' with another version.
[2014-01-31 13:36:30] Replacing DS `connections' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_connections' with another version.
[2014-01-31 13:36:30] Replacing DS `income' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_incoming' with another version.
[2014-01-31 13:36:30] Replacing DS `outgoing' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_outgoing' with another version.
[2014-01-31 13:36:30] Initialization complete, entering read-loop.
[2014-01-31 13:36:30] amqp plugin: Successfully opened connection to vhost "/sensu" on IP:port.
@marianogg9
marianogg9 / gist:8732518
Created January 31, 2014 13:59
response from curl request to Rackspace API
...
"loadBalancerUsageRecords": [
{
"averageNumConnections": xx,
"averageNumConnectionsSsl": xx,
"endTime": timestamp,
"id": xx,
"incomingTransfer": xx,
"incomingTransferSsl": xx,
"numPolls": xx,
@marianogg9
marianogg9 / gist:8732727
Created January 31, 2014 14:11
/var/log/collectd/collectd.log
[2014-01-31 13:36:30] The read function "curl_json-Load_Balancer-https://API_url" is already registered. Check for duplicate "LoadPlugin" lines in your configuration!
[2014-01-31 13:36:30] Replacing DS `connections' with another version.
[2014-01-31 13:36:30] Replacing DS `connections' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_connections' with another version.
[2014-01-31 13:36:30] Replacing DS `income' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_incoming' with another version.
[2014-01-31 13:36:30] Replacing DS `outgoing' with another version.
[2014-01-31 13:36:30] Replacing DS `ssl_outgoing' with another version.
[2014-01-31 13:36:30] Initialization complete, entering read-loop.
[2014-01-31 13:36:30] amqp plugin: Successfully opened connection to vhost "/sensu" on IP:port.
#!/usr/bin/env 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
#
@marianogg9
marianogg9 / twitter.rb
Created February 4, 2014 11:40
Snippet of twitter.rb
{..}
foo = Twitter::REST::Client.new do |config|
config.consumer_key = account[1]["consumer_key"]
config.consumer_secret = account[1]["consumer_secret"]
config.access_token = account[1]["access_token"]
config.access_token_secret = account[1]["access_token_secret"]
end
if @event['action'].eql?("resolve")
foo.update("RESOLVED - #{event_name}: #{@event['check']['notification']} Time: #{Time.now()}" )
foo.create_direct_message(@user, "test_text")
/path_to_gem/twitter/rest/response/raise_error.rb:21:in `on_complete': Recipient (user, screen name, or id) parameter is missing. (Twitter::Error::BadRequest)
[root@server plugins]# ./rabbitmq-amqp-alive.rb -w rabbitmq_host -p my_pass -P 5671 -u my_user -v my_vhost
W, [2014-02-04T19:10:19.827147 #4555] WARN -- #<Bunny::Session:11666480 my_user@rabbitmq_host:5671, vhost=my_vhost>: Using TLS but no client certificate is provided! If RabbitMQ is configured to verify peer
certificate, connection upgrade will fail!
CheckRabbitAMQP UNKNOWN: SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert handshake failure
..
"rabbitmq": {
"ssl": {
"private_key_file": "/etc/sensu/ssl/client_key.pem",
"cert_chain_file": "/etc/sensu/ssl/client_cert.pem"
},
"port": 5671,
"host": "rabbitmq.mgmt-int",
"user": "my_user",
"password": "my_pass",