Skip to content

Instantly share code, notes, and snippets.

View ncracker's full-sized avatar

Boyan Syarov ncracker

View GitHub Profile
# Datadog Docker agent
# - live processes enabled
# - using a proxy (see proxy docs > https://docs.datadoghq.com/agent/proxy/?tab=agentv6)
DOCKER_CONTENT_TRUST=1 docker run -d --name dd-agent --restart=always \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-v /proc/:/host/proc/:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-v /etc/passwd:/etc/passwd:ro \
-e DD_API_KEY={YOUR_API_KEY_HERE} \
# Basic configuration
global
log 127.0.0.1 local0
maxconn 4096
stats socket /tmp/haproxy
# Some sane defaults
defaults
log global
option dontlognull
#!/bin/bash
yum update
yum install vim bind-utils -y
#install agent here
DD_API_KEY=<YOUR_API_KEY_HERE> bash -c "$(curl -L https://raw.githubusercontent.com/DataDog/datadog-agent/master/cmd/agent/install_script.sh)"
sudo -u dd-agent cp /etc/datadog-agent/system-probe.yaml.example /etc/datadog-agent/system-probe.yaml
cat <<EOF > /etc/datadog-agent/system-probe.yaml
##################################
## System Probe Configuration ##
##################################
#!/bin/sh
###############################################################################
# datadog-agent
#
# Inspired by Boxed Ice <[email protected]>
# Forked by Datadog, Inc. <[email protected]>
#
# Licensed under Simplified BSD License (see LICENSE)
#
###############################################################################
@ncracker
ncracker / centos7_ansible.sh
Last active April 8, 2019 18:04
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
@ncracker
ncracker / ping_test.py
Last active September 19, 2018 19:53 — forked from burnsie7/ping_test.py
PingCheck example
from checks import AgentCheck
import os
'''
This is for demostration purposes only and not recommended for production use.
Because of the nature of ping, it could result in a very long running check if there are excessive timeouts.
Long running checks could potentially result in other metrics and checks being skipped.
Example conf.yaml:
@ncracker
ncracker / firewalld
Created April 24, 2018 20:45
firewalld snippets
# CentOS 7 firewall open ports
# see active zone (profile)
firewall-cmd --get-active-zones
#open port 8080
firewall-cmd --zone=public --add-port=8080/tcp --permanent
# block calls to external ip
firewall-cmd --direct --add-rule ipv4 filter OUTPUT 0 -d 54.236.250.10/32 -p tcp -m tcp --dport=443 -j DROP