Skip to content

Instantly share code, notes, and snippets.

Zope Public License (ZPL) Version 2.0
-----------------------------------------------
This software is Copyright (c) Zope Corporation (tm) and
Contributors. All rights reserved.
This license has been certified as open source. It has also
been designated as GPL compatible by the Free Software
Foundation (FSF).
Python License (Python-2.0)
[OSI Approved License]
Python License, Version 2 (Python-2.0)
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
from hashlib import sha512
import time
import random
import string
import sys
import os
import multiprocessing
chars = string.letters
for i in range(10):
--- /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:
@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 = {
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:
package main
import (
"fmt"
"os"
"strings"
"io/ioutil"
)
@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():
@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 / 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