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 bash | |
# Allow extra connections to a SwiftStack controller or node through the firewall. | |
# We require firewall-cmd be installed for this, or else we warn the user. | |
# On startup this script adds a new input chain called localrules-in... | |
# | |
# - To the INPUT chain if on a node; | |
# - To the IN_public_allow chain if on a controller. | |
# | |
# For Enterprise Linux 7 only; for IPv4 only. | |
# |
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
# Quick and Dirty Project Scraper. Pulls top 100 text Ebooks, massages the metadata to make it more Elasticsearch friendly, and uploads to Swift. | |
# Usage: Edit the params below and run me. | |
# It's slow. This is deliberate, because otherwise Gutenberg will block your connection (for up to 24 hours). Which is slower. | |
# straill 2018/04/18 | |
SWIFT_HOST=localhost:3880 | |
SWIFT_PROTO=http # ( http | https ) | |
SWIFT_USER=gutenberg | |
SWIFT_PASSWORD=password | |
SWIFT_AUTH_URL=${SWIFT_PROTO}://${SWIFT_HOST}/auth/v1.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/env bash | |
# Openstack Swift Object Live Replication Test | |
# straill (SwiftStack) 2017/10/26 | |
# | |
# Setup: | |
# - Ensure you have a swift account created - see SWIFT_USER below. | |
# - Then set the config varibles below for your endpoints and password. | |
# | |
# We push a test object into a swift cluster, then use swift-get-nodes to see where the replicas actually are. |
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 bash | |
# Check a given storage policy dispersion. If non-zero, return a warning. | |
# straill 2017/11/26 | |
. /opt/ss/etc/profile.d/01-swiftstack-controller.sh | |
# Configure me here. | |
# Usage note: when you change your storage layout, the dispersion of your storage policy WILL BE NON ZERO for some time. | |
# Further, if your cluster layout is not entirely balanced across failure domains (same amount of disks and nodes in each, and each disk has the same size), dispersion will increase. This doesn't indicate a cluster failure - just that swift is either rebalancing or doing the best it can with the storage it's been given. |
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 bash | |
# Probe for Swiftstack alerts. If we find ANY unacknowleged alerts in the controller, spit out a WARNING in check_mk. | |
# straill 2017/11/26 | |
. /opt/ss/etc/profile.d/01-swiftstack-controller.sh | |
# PGPASS location | |
export PGPASSFILE=/home/swiftstack/repstatus/pgpass | |
[ ! -f $PGPASSFILE ] && PGPASSFILE=/opt/ss/etc/pgpass | |
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 bash | |
set -x | |
HOST=$1 | |
if [ -d /etc/pki/ca-trust/source/anchors/ ] ; then | |
echo -n | openssl s_client -connect ${HOST}| sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /etc/pki/ca-trust/source/anchors/ssman.crt | |
update-ca-trust enable | |
update-ca-trust extract | |
elif [ -d /usr/local/share/ca-certificates ] ; then | |
echo -n | openssl s_client -connect ${HOST} | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /usr/local/share/ca-certificates/ssman.crt |
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 bash | |
# Openstack Swift Basic Throughput test | |
# straill (SwiftStack) 2017/10/16 | |
# | |
# Setup: | |
# - Ensure you have a swift account created - see SWIFT_USER below. | |
# - Then set the config varibles below for your endpoints and password. | |
# - Runs a simple PUT with a known size object; returns success levels based on speed | |
# - Runs a simple GET with a known size object; returns success levels based on speed |
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 bash | |
# Probe for Swiftstack replication cycle times, taken from postgres on controller | |
# straill 2016/11/01 | |
# Arguments: | |
# $1 cluster name | |
# $2 replication type (must be one of 'object', 'container', 'account') | |
. /opt/ss/etc/profile.d/01-swiftstack-controller.sh |
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 bash | |
# Probe for Swiftstack replication cycle times, taken from postgres on controller | |
# straill 2016/11/01 | |
# Arguments: | |
# $1 cluster name | |
# $2 replication type (must be one of 'object', 'container', 'account') | |
CID=$1 | |
RTYPE=$2 |
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 bash | |
# Openstack Swift Basic API tests for check_mk | |
# straill (SwiftStack) 2017/10/16 | |
# | |
# Setup: | |
# - Ensure you have a swift account created - see SWIFT_USER below. | |
# - Then set the config varibles below for your endpoints and password. | |
# - Runs basic functional test set using some (ugly) cURL commands; returns status in check_mk format | |
# - Failures will cause us to immediately bail and return bad status |
NewerOlder