Skip to content

Instantly share code, notes, and snippets.

@remh
remh / tomcat.yaml
Last active December 30, 2015 12:39
instances:
- host: localhost
port: 7008
name: tomcat_instance
init_config:
conf:
#######################################
- include:
domain: java.lang
instances:
- host: localhost
port: PORT
conf:
- include:
domain: foo
@remh
remh / gist:1426ccb24ec36162ba2b
Last active August 29, 2015 14:03
Datadog Agent 5.0.0

What is Datadog Agent 5.0.0 ?

Datadog Agent 5.0.0 is the next major version of the Datadog Agent. Its main improvement being that it will be self-contained. All dependencies required by the Agent to run will be part of the package.

Warning

This version of the Datadog-Agent is still in beta. It's planned to be released soon and is being used by us and a few of our users without any major issue but please keep in mind that it's a BETA version.

What issues will it solve ?

  • Conflicts with dependencies (Tornado, Supervisor, Check dependencies: MysqlDB, Postgres....)
  • On Centos 5, there is no forwarder which can create some issues (such as no proxy support for Dogstatsd). This will be solved
  • Full support of Fedora Core
@remh
remh / list_everything.py
Last active August 29, 2015 14:03
List everything command on windows
from config import get_logging_config, get_config, _windows_confd_path
from jmxfetch import JMXFetch
JMXFetch.init(_windows_confd_path(), get_config(), get_logging_config(), 15,"list_everything", None, reporter="console")
@remh
remh / per_cpu.py
Created September 18, 2014 14:41
per_cpu.py
import psutil
from checks import AgentCheck
class CPUTimes(AgentCheck):
def check(self, instance):
cpu_times = psutil.cpu_times(percpu=True)
for i, cpu in enumerate(cpu_times):
for key, value in cpu._asdict().iteritems():
package main
import (
"fmt"
"os"
"strings"
"io/ioutil"
)
from checks.network_checks import NetworkCheck, Status
import subprocess
class PowerShell(NetworkCheck):
SOURCE_TYPE_NAME = "powershell"
SERVICE_CHECK_NAME = "powershell.ran_sucessfully"
def _load_conf(self, instance):
interpreter = instance.get('interpreter')
if interpreter is None:
@remh
remh / windows_service.py
Last active August 29, 2015 14:10
Windows Service checks
""" Collect status information for Windows services
"""
# project
from checks import AgentCheck
# 3rd party
import wmi
class WindowsService(AgentCheck):
STATE_TO_VALUE = {
--- /opt/datadog-agent/agent/dogstatsd.py 2013-11-25 21:25:21.000000000 +0000
+++ /opt/datadog-agent/agent/dogstatsd_debug.py 2013-12-09 23:26:36.000000000 +0000
@@ -254,6 +254,7 @@
ready = select_select(sock, [], [], timeout)
if ready[0]:
message = socket_recv(buffer_size)
+ log.info(message)
aggregator_submit(message)
if should_forward:
from hashlib import sha512
import time
import random
import string
import sys
import os
import multiprocessing
chars = string.letters
for i in range(10):