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
# Installation: | |
# - `gem install dogstatsd-ruby` | |
# - Drop `dogstatsd.rb` into the logstatsh outputs folder | |
# | |
# encoding: utf-8 | |
require "logstash/outputs/base" | |
require "logstash/namespace" | |
# statsd is a network daemon for aggregating statistics, such as counters and timers, |
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
from checks import AgentCheck | |
from util import Platform | |
import time | |
class ProcessCheck(AgentCheck): | |
PROCESS_GAUGE = ( | |
'system.processes.threads', | |
'system.processes.cpu.pct', | |
'system.processes.mem.rss', |
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
Open PowerShell or cmd.exe | |
C:\ ... > cd C:\Program Files (x86)\Datadog\Datadog Agent\files | |
C:\ ... > ./shell.exe | |
Datadog Agent v4.1.0 - Python Shell | |
>>> import wmi; w = wmi.WMI() | |
>>> disk = w.Win32_LogicalDisk() | |
>>> print [{'Name': d.Name, 'Type': d.DriveType, 'Size': d.Size, 'Free': d.FreeSpace} for d in disk] |
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
import time | |
from checks import AgentCheck | |
CHECK_INTERVAL = 60 # in seconds | |
class MyCheck(AgentCheck): | |
def __init__(self, name, init_config, agentConfig, instances=None): | |
AgentCheck.__init__(self, name, init_config, agentConfig, instances) | |
self.last_check_ts = None |
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
NAME = 'PyYAML' | |
VERSION = '3.09' | |
DESCRIPTION = "YAML parser and emitter for Python" | |
LONG_DESCRIPTION = """\ | |
YAML is a data serialization format designed for human readability | |
and interaction with scripting languages. PyYAML is a YAML parser | |
and emitter for Python. | |
PyYAML features a complete YAML 1.1 parser, Unicode support, pickle |
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
import base64 | |
import socket | |
import subprocess | |
import sys | |
import time | |
import urlparse | |
import urllib2 | |
from util import json, headers | |
from checks import AgentCheck |
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
import re | |
import types | |
import time | |
from checks import AgentCheck | |
from util import get_hostname | |
# When running with pymongo < 2.0 | |
# Not the full spec for mongo URIs -- just extract username and password | |
# http://www.mongodb.org/display/DOCS/connections6 |
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
#!/bin/bash | |
# | |
# Script to run before trying to re-package this box. | |
# Usage: sudo ~/prepackage.sh | |
echo 'Stopping all supervisor tasks' | |
sudo supervisorctl stop all | |
echo 'Removing custom dotfiles' | |
for dotfile in 'gitconfig pypirc'; do |
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
7a8,9 | |
> import multiprocessing | |
> multiprocessing.freeze_support() |
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
# boot_service.py | |
import sys | |
import os | |
import servicemanager | |
import win32service | |
import win32serviceutil | |
import winerror | |
# Add multiprocessing support to py2exe services | |
import multiprocessing |