Skip to content

Instantly share code, notes, and snippets.

View jaycdave88's full-sized avatar

Jay C. Davé jaycdave88

View GitHub Profile
instances:
# location of tomcat
- host: 10.112.9.6
port: 9999
max_returned_metrics: 9500
# user: username
# password: password
# process_name_regex: .*process_name.* # Instead of specifying a host, and port. The agent can connect using the attach api.
# # This requires the JDK to be installed and the path to tools.jar to be set below.
# tools_jar_path: /usr/lib/jvm/java-7-openjdk-amd64/lib/tools.jar # To be set when process_name_regex is set
@jaycdave88
jaycdave88 / multi_org_hosts_count.py
Created February 20, 2019 21:06 — forked from burnsie7/multi_org_hosts_count.py
multi_org_hosts_count.py
import datetime
import time
import requests
import simplejson
from datadog import initialize, api
"""
This script gives a real time report on ec2 and Datadog agent host usage
from multiple organizations and reports them up to the 'main' parent account.
confd:
docker.yaml: |-
init_config:
instances:
- url: "unix://var/run/docker.sock"
collect_events: false
$pwd = convertto-securestring "Admin!" -asplaintext -force
$cred=new-object -typename System.Management.Automation.PSCredential -argumentlist ".\reutadmin",$pwd
$windows_vms = @("192.168.86.66")
$install_datadog = {
& msiexec /qn /i datadog-agent-6-latest.amd64.msi APIKEY="DATADOG_API_KEY" HOSTNAME="my_hostname" TAGS="mytag1,mytag2"
}
@jaycdave88
jaycdave88 / gist:dfbe1ee77174b5e21b7f453b11067345
Created March 19, 2019 22:38
One Windows VM Ansible Playbook
- hosts: windows
roles:
- { role: Datadog.datadog }
vars:
datadog_api_key: [DATADOG_API_KEY]
@jaycdave88
jaycdave88 / gist:70a85ed2bb185307dea9c467f1b45bba
Last active April 2, 2019 20:28
Windows Ansible script
- hosts: windows
roles:
- { role: Datadog.datadog }
vars:
datadog_api_key: [DATADOG_API_KEY]
@jaycdave88
jaycdave88 / centos7_ansible.sh
Created April 8, 2019 18:04 — forked from ncracker/centos7_ansible.sh
Setting up Ansible control machine - targets are going to be Windows hosts
#!/bin/bash
# Set up CentOS to act as an Ansible controller
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
# ensure CentOS all up-to-date
yum update -y
# epel is to be used for pip
yum install epel-release -y
$url = "https://notepad-plus-plus.org/repository/7.x/7.6.6/npp.7.6.6.Installer.exe"
$outpath = "C:/notepad++.exe"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $outpath)
$args = @("Comma","Separated","Arguments")
Start-Process -Filepath "C:/notepad++.exe" -ArgumentList $args
- hosts: windows
tasks:
- name: get dotnet tracer
win_get_url:
url: 'https://github.com/DataDog/dd-trace-dotnet/releases/download/v1.1.0/DatadogDotNetTracing-1.1.0-x64.msi'
dest: 'C:\datadog_dotnet_v1.1.0.msi'
- name: install datadog tracer msi file
win_msi:
@jaycdave88
jaycdave88 / win_docker.py
Last active May 20, 2019 22:29
Docker Windows Health - Agent Check
from checks import AgentCheck
from datetime import tzinfo, timedelta
import datetime
import requests
import json
import calendar
class UTC(tzinfo):
def utcoffset(self, dt):
return timedelta(0)