Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
###############FUNCTIONS############
function prepare {
#optimize the index
echo -n "Optimizing index $INDEX_NAME..."
curl -XPOST "$ADDRESS/$INDEX_NAME/_optimize" 2>/dev/null| grep 'failed":0' >/dev/null
if [ $? -eq 0 ]; then
echo "done"
@gordonm
gordonm / check_salt
Created November 29, 2012 18:04 — forked from bastichelaar/check_salt
Nagios script to check whether a salt minion is online (with timeout)
#!/usr/bin/env python
import salt.cli.caller
import salt.config
import argparse
import sys
import signal
class TimeoutException(Exception):
pass
@gordonm
gordonm / check_salt.py
Created June 8, 2012 20:09 — forked from SEJeff/check_salt.py
nagios check to make sure the salt minion is available and responding to commands from @bastichelaar
#!/usr/bin/env python
import salt.cli.caller
import salt.config
import argparse
import sys
parser = argparse.ArgumentParser(description='Check if minions are online.')
parser.add_argument('hostname', help='The name of the minion to be checked')
args = parser.parse_args()
@gordonm
gordonm / init.sls
Created June 8, 2012 16:31
elasticsearch
openjdk-6-jre:
pkg:
- installed
/tmp/elasticsearch.tar.gz:
file:
- managed
- source: https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.2.tar.gz
/tmp/servicewrapper.tar.gz:
[ david@samwise ] $ cat salt.sls
/etc/salt/minion:
file:
- managed
- owner: root
- group: root
- mode: 444
- source: salt://salt/files/salt-minion.config
- template: jinja
- context:
[ david@samwise ] $ cat salt.sls
/etc/salt/minion:
file:
- managed
- owner: root
- group: root
- mode: 444
- source: salt://salt/files/salt-minion.config
- template: jinja
- context: {