This file contains hidden or 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 python2 | |
# A script to generate a report of Elasticsearch index usage | |
# (from _cat/indices?v&bytes=b) by prefix for a set of known | |
# date suffixes. | |
# | |
# E.g. | |
# $ curl -X GET http://localhost:9200/_cat/indices?v\&bytes=b -o indices.lis | |
# $ ./sum-es-indices.py indices.lis | |
# |
This file contains hidden or 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 | |
ES_URL='https://localhost:9200' | |
curl_get='curl -s -X GET --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
date | |
$curl_get $ES_URL/_cluster/pending_tasks?pretty |
This file contains hidden or 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 | |
let num=0 | |
for pod in $(oc get pod -n logging -l component=fluentd -o name); do | |
rss=$(oc exec -n logging $(basename $pod) -- ps auxww | grep fluentd | tail -n 1 | awk '{ print $6 }') | |
if [ "$rss" -gt 384000 ]; then | |
let num=num+1 | |
echo "$pod $rss" | |
fi | |
done | |
echo $num |
This file contains hidden or 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 | |
function finish { | |
rm -rf $TMPDIR | |
} | |
trap finish EXIT | |
TMPDIR=$(mktemp -d) | |
mkdir $TMPDIR/output | |
let num=0 | |
let slow=0 |
This file contains hidden or 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
$ cat ../jctoolbox/openshift/origin-15.inventory | |
[OSEv3:children] | |
masters | |
nodes | |
[OSEv3:vars] | |
ansible_become=true | |
ansible_ssh_user=vagrant | |
ansible_ssh_private_key_file=/home/jeff.cantrill/.ssh/id_rsa | |
ansible_user=root |
This file contains hidden or 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 | |
# Use via: curl -X GET http://localhost:9200/<index>/_search/?fields=@timestamp,level,hostname,kubernetes.host,kubernetes.pod_name,kubernetes.container_name,message&q=message:<string> | |
import sys, os, json | |
if len(sys.argv) == 1 or sys.argv[1] == '-': | |
json_doc = json.load(sys.stdin) | |
else: | |
json_doc = json.load(open(sys.argv[1])) |
NewerOlder