Skip to content

Instantly share code, notes, and snippets.

@blemmenes
blemmenes / sosreport_fetcher.yaml
Last active November 25, 2020 03:54
Ansible playbook to install, run, gather, archive sosreports
---
# sosreport runner/fetcher
# usage:
# ansible-playbook sosreport.yaml —limit=<node/nodes> -e "dest=~/temp name=<name> case_id=<case/ticket>"
- hosts: all
gather_facts: false
vars:
sos_path: "{{ dest }}/{{ case_id }}/{{ run_time }}"
@blemmenes
blemmenes / get_usage.py
Created July 13, 2018 17:26
Simple script to get usage info for testing
#!/usr/bin/python
import requests
import json
import argparse
from awsauth import S3Auth
def parse_args():
parser = argparse.ArgumentParser(
description='RADOSGW address S3 access_key and secret_key'
@blemmenes
blemmenes / portgoup connected vms.py
Created October 9, 2018 14:21
portgroup connected vms
from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect
from pyVmomi import vim
import atexit
host = " "
user = " "
password = ' '
serviceInstance = SmartConnectNoSSL(host=host,
user=user,
@blemmenes
blemmenes / get_bucket_usage.py
Created February 4, 2019 19:12
Simple script to test usage gathering
#!/usr/bin/python
import requests
import json
import argparse
from awsauth import S3Auth
def parse_args():
parser = argparse.ArgumentParser(
description='RADOSGW address S3 access_key and secret_key'
@blemmenes
blemmenes / autorepair.sh
Created July 29, 2020 16:45
bash script to repair PGs
#!/bin/bash
# from https://github.com/cernceph/ceph-scripts/blob/master/tools/scrubbing/autorepair.sh
for PG in $(ceph pg ls inconsistent -f json | jq -r .pg_stats[].pgid)
do
echo Checking inconsistent PG $PG
if ceph pg ls repair | grep -wq ${PG}
then
echo PG $PG is already repairing, skipping
continue