Last active
July 25, 2018 13:00
-
-
Save jcantrill/163a0ba40bc441a1bb73fb049aaddad6 to your computer and use it in GitHub Desktop.
This script checks the ability of the fluent pods to connect to Elasticsearch
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/sh | |
pods=${1:-"--all"} | |
shift | |
if [ "${pods}" == "--all" ]; then | |
pods=$(oc get pods -l component=fluentd -o jsonpath={.items[*].metadata.name}) | |
fi | |
for p in $pods; do | |
output=$(oc exec $p -- curl --silent -q https://logging-es:9200/ --key /etc/fluent/keys/key --cacert /etc/fluent/keys/ca --cert /etc/fluent/keys/cert "$@") | |
result=$? | |
if [ $result -eq 0 ] ; then | |
echo "$p - good" | |
else | |
echo "$p - bad: $output" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment