Skip to content

Instantly share code, notes, and snippets.

View vagelim's full-sized avatar

vagelim vagelim

View GitHub Profile
@vagelim
vagelim / jmx list_everything
Created March 4, 2016 18:40
output from jmx list_everything
vageli@kafka:~
=> sudo dd-agent jmx list_everything
2016-03-04 13:35:40,325 | WARNING | dd.collector | jmxfetch(jmxfetch.py:379) | {'host': 'localhost', 'port': 9999} doesn't have a 'conf' section. Only basic JVM metrics will be collected. See http://docs.datadoghq.com/integrations/java/ for more information
2016-03-04 13:35:40,326 | INFO | dd.collector | jmxfetch(jmxfetch.py:234) | Starting jmxfetch:
2016-03-04 13:35:40,327 | INFO | dd.collector | jmxfetch(jmxfetch.py:282) | Running java -Xms50m -Xmx200m -classpath /opt/datadog-agent/agent/checks/libs/jmxfetch-0.9.0-jar-with-dependencies.jar org.datadog.jmxfetch.App --check jmx.yaml kafka.yaml --check_period 15000 --conf_directory /etc/dd-agent/conf.d --log_level INFO --log_location /var/log/datadog/jmxfetch.log --reporter console --status_location /opt/datadog-agent/run/jmx_status.yaml list_everything
#####################################
Instance: localhost:9999
#####################################
@vagelim
vagelim / test_analysis.txt
Created March 17, 2016 16:29
Test analysis of #music
==SERVICES==
Spotify: 175
YouTube: 21
SoundCloud: 4
==========
====USERS====
raycolletti: 121
matt: 107
john: 66
scottanderson: 62
{"board_title": "Marshal - CouchDB Screenboard", "read_only": false, "board_bgtype": "board_graph", "created": "2016-06-15T15:59:19.408753+00:00", "original_title": "Marshal - CouchDB Screenboard", "modified": "2016-06-17T10:30:43.451780+00:00", "height": 80, "width": "100%", "template_variables": [], "templated": true, "widgets": [{"board_id": 92838, "autoscale": true, "title_size": 16, "title": true, "title_align": "left", "title_text": "HTTP Request Rate", "height": 13, "tile_def": {"viz": "timeseries", "requests": [{"q": "per_second(avg:couchdb.httpd.requests{*})", "aggregator": "avg", "conditional_formats": [{"palette": "white_on_yellow", "value": "1000", "comparator": ">"}, {"palette": "white_on_green", "value": null, "comparator": "<"}], "type": "area", "style": {"palette": "blue"}}], "autoscale": false, "custom_unit": null}, "width": 42, "timeframe": "4h", "y": 23, "x": 44, "legend_size": "0", "type": "query_value", "legend": false}, {"board_id": 92838, "title_size": 16, "title": true, "title_align":
{
"board_title": "Marshal - CouchDB Screenboard",
"read_only": false,
"board_bgtype": "board_graph",
"created": "2016-06-15T15:59:19.408753+00:00",
"original_title": "Marshal - CouchDB Screenboard",
"modified": "2016-06-17T18:42:10.978304+00:00",
"height": 80,
"width": "100%",
"template_variables": [],
@vagelim
vagelim / provider.tf
Created June 23, 2016 15:23
DigitalOcean Terraform Provider config
variable "do_token" {}
variable "pub_key" {}
variable "pvt_key" {}
variable "ssh_fingerprint" {}
variable "machine_name" {}
provider "digitalocean" {
token = "YOUR TOKEN HERE, FROM https://cloud.digitalocean.com/settings/api/tokens"
}
@vagelim
vagelim / kafka.tf
Created June 23, 2016 15:25
Terraform for Kafka on DigitalOcean
resource "digitalocean_droplet" "kafka" {
image = "ubuntu-14-04-x64"
name = "${var.machine_name}"
region = "nyc2"
size = "4gb"
private_networking = true
ssh_keys = [
"${var.ssh_fingerprint}"
]
@vagelim
vagelim / haproxy.py
Last active July 24, 2016 16:35
Allow the use of socket connect for HAProxy stats
# (C) Datadog, Inc. 2012-2016
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
# stdlib
from collections import defaultdict
import copy
import re
import time
# 3rd party
@vagelim
vagelim / haproxy.cfg.example
Created July 24, 2016 16:58
minimal example highlighting haproxy user and group
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 777 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
@vagelim
vagelim / events_to_statsd.py
Created August 9, 2016 12:43
Send Nova events to DogStatsD
# Environment Variables: $AMQP_USER, $AMQP_PASSWORD, $AMQP_HOST
import os
from datadog import statsd
from kombu import Connection, Exchange, Queue
nova_x = Exchange('nova', type='topic', durable=False)
info_q = Queue('notifications.info', exchange=nova_x, durable=False,
routing_key='notifications.info')
def process_msg(body, message):
@vagelim
vagelim / changes_nova.conf
Created August 9, 2016 13:01
add this to your nova.conf, restart Nova
[oslo_messaging_notifications]
driver = messaging
notification_topics = notifications
notify_on_state_change = vm_and_task_state
instance_usage_audit_period = hour
instance_usage_audit = True
default_notification_level = INFO
notify_api_faults = true