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) | |
#TODAY='2018.03.27' | |
TODAY=$(date "+%Y.%m.%d") |
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_put='curl -s -X PUT --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
date | |
$curl_put $ES_URL/_cluster/settings?pretty -d "{ \"transient\" : { \"cluster.routing.allocation.enable\" : \"$1\" } }" |
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
#!/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/_cat/shards?v\&bytes=b |
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_post='curl -s -X POST --cacert /etc/elasticsearch/secret/admin-ca --cert /etc/elasticsearch/secret/admin-cert --key /etc/elasticsearch/secret/admin-key' | |
date | |
$curl_post $ES_URL/_cluster/reroute?pretty=true -d "{ \"commands\" : [ { \"move\" : { \"index\" : \"$1\", \"shard\" : $2, \"from_node\" : \"$3\", \"to_node\" : \"$4\" } } ] }" |
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
FROM registry.fedoraproject.org/fedora | |
RUN dnf -y install python | |
COPY ./app.py /logsmasher | |
RUN chmod +x /logsmasher | |
#CMD ["/logsmasher"] |
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 | |
import sys | |
import os | |
import time | |
import datetime | |
from systemd import journal | |
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | |
j = journal.Reader() |
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 | |
# oc logs -c kibana <pod> | ./view-kibana-logs.py | |
import sys | |
import json | |
import fileinput | |
lines = 0 | |
valerrors = 0 | |
successes = 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
#!/usr/bin/awk -f | |
BEGIN { | |
if (length(DAY) > 0) { | |
gensub(/\./, "\\\\.", DAY) | |
dayfmt = " (" DAY ")" | |
} else { | |
dayfmt = "" | |
} | |
projects = "project\\..+\\." DAY |