Skip to content

Instantly share code, notes, and snippets.

@jcantrill
Last active July 25, 2018 13:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcantrill/163a0ba40bc441a1bb73fb049aaddad6 to your computer and use it in GitHub Desktop.
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
#!/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