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 | |
# shell script to convert a nagios .cfg file to yaml compatible with my nagios formula. | |
FILENAME=$1 | |
DESTINATION=$2 | |
GENERATED_FILENAME=$3 | |
OBJECTTYPES=$(cat ${FILENAME} | awk '{ if ($1 == "define") { print $2 }}' | sed 's/{//' | sort -u) | |
awkit() { |
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 | |
count=0 | |
while : ; do | |
minions=$(salt-run manage.down) | |
let count=count+1 | |
if [ -n "${minions}" ]; then | |
echo -e "The following minions are down:\e[0;31m "${minions}"\e[0m. Waiting for them to recover." | |
else | |
echo -e "\e[0;32mAll minions are running!\e[0m" |
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 | |
# Source this file in your .bash_profile e.g.: | |
# | |
# source ~/gitcheckouts/vpn_heplers/.vpn_helpers.sh | |
# | |
# Note: This script works best with NOPASSWD: ALL configured in your sudoers file: | |
# /etc/sudoers: | |
# %admin ALL=(ALL) NOPASSWD: ALL | |
# |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
This script will list all hosts in an ec2 region and prompt you to connect | |
to them. | |
It expects the file .boto to exist in your home directory with contents | |
as follows: |
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
#!/usr/bin/env python | |
import sys | |
import yaml | |
from pprint import pprint | |
filename = sys.argv[1] | |
with open(filename, 'r') as yaml_file: | |
try: |
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 | |
REGION=us-east-2 | |
set -e | |
function get_host() { | |
local HOSTLIST="${@}" | |
local HOSTARRAY=( $(awk 'BEGIN { OFS="|" } { print $1,$2 }' <<<"${HOSTLIST}") ) | |
cat -n <<<"${HOSTLIST}" | column -t | |
read -p "Please enter selection >" HOSTENTRY | |
IFS="|" read -r HOST IP <<<"${HOSTARRAY[$((${HOSTENTRY}-1))]}" |