This file contains 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
type: CheckConfig | |
api_version: core/v2 | |
metadata: | |
name: read_secret | |
spec: | |
command: env|grep -i influx | |
env_vars: | |
- INFLUXDB_PASSWORD=strongpasshere | |
- INFLUXDB_USER=sensu-read | |
handlers: [] |
This file contains 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
type: CheckConfig | |
api_version: core/v2 | |
metadata: | |
name: read_secret | |
spec: | |
command: env|grep -i influx | |
env_vars: null | |
handlers: [] | |
publish: false | |
secrets: |
This file contains 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
diff --git a/agent/agent.go b/agent/agent.go | |
index 3b8cb897..3e00ed65 100644 | |
--- a/agent/agent.go | |
+++ b/agent/agent.go | |
@@ -35,12 +35,15 @@ import ( | |
"github.com/sensu/sensu-go/util/retry" | |
utilstrings "github.com/sensu/sensu-go/util/strings" | |
"github.com/sirupsen/logrus" | |
+ "github.com/anatolijd/vaultservice/vaultservice" | |
) |
This file contains 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 commands | |
import time | |
import sys | |
from socket import socket | |
import argparse | |
import os | |
import pymongo | |
from pymongo import Connection | |
import yaml |
This file contains 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 | |
# Configure the instance to run as a Port Address Translator (PAT) to provide | |
# Internet connectivity to private instances. | |
# | |
set -x | |
echo "Determining the MAC address on eth0" | |
ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'` | |
if [ $? -ne 0 ] ; then |
This file contains 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
require 'fog' | |
bucket = 'bucket-name' | |
credentials = { | |
:provider => 'AWS', | |
:aws_access_key_id => 'access_key_id', | |
:aws_secret_access_key => 'secret_key', | |
} | |
fog = Fog::Storage.new(credentials) |
This file contains 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
--- | |
# This has been tested with ansible 1.3 with these commands: | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=false" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts isFirstRun=true" | |
# ansible-playbook -i hosts ansible_conditionals_examples.yaml --extra-vars="hosts=myhosts" | |
# NB: The type of the variable is crucial! | |
- name: Ansible Conditionals Examples | |
hosts: $hosts | |
vars_files: |
This file contains 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
# python hash_ring_selector2.py | |
DESTINATIONS : ['10.4.0.1:2104:a', '10.4.0.1:2204:b', | |
'10.4.0.2:2104:a', '10.4.0.2:2204:b'] | |
CARBONLINK_HOSTS: ['10.4.0.1:7102:a', '10.4.0.1:7202:b'] | |
result metric carbon-relay webapp | |
[ OK ] some.metric ('10.4.0.1', 'b') ('10.4.0.1', 'b') | |
[ OK ] mymetric ('10.4.0.1', 'a') ('10.4.0.1', 'a') |
This file contains 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
# python hash_ring_selector_test.py | |
======================================================================================================================== | |
DESTINATIONS = ['192.168.97.121:2104:a', '192.168.97.121:2204:b', '192.168.97.132:2104:a', '192.168.97.132:2204:b'] | |
CARBONLINK_HOSTS = ['192.168.97.121:7102:a', '192.168.97.121:7202:b', '192.168.97.132:7102:a', '192.168.97.132:7202:b'] | |
result metric carbon-relay webapp | |
[ OK ] test.anatoliy ('192.168.97.121', 'b') ('192.168.97.121', 'b') | |
[ OK ] test.random ('192.168.97.121', 'b') ('192.168.97.121', 'b') | |
[ OK ] test.roma ('192.168.97.121', 'a') ('192.168.97.121', 'a') |