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
#!/usr/bin/env python | |
import json,sys | |
from subprocess import Popen, PIPE | |
from StringIO import StringIO | |
r = Popen(['ceph','report'],stdout=PIPE,stderr=PIPE) | |
cephreport, _ = r.communicate() | |
obj=json.load(StringIO(cephreport)) |
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
#!/usr/bin/env python | |
import sys | |
import simplejson as json | |
obj=json.load(sys.stdin) | |
# osd_data_object osd.id = [ 'osdSize': [size,used,avail,used%], 'TotalPGs': [primary, secondary], 'PoolName1': [primary, secondary] , 'PoolName2': [primary, secondary], ... ]; | |
osd_data={} |
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
#!/usr/bin/env python | |
import sys | |
import simplejson as json | |
obj=json.load(sys.stdin) | |
for field in [ 'epoch', 'fsid', 'created','modified']: | |
print field+' '+str(obj['osdmap'][field]); |
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
#!/usr/bin/env python | |
import sys | |
import simplejson as json | |
obj=json.load(sys.stdin) | |
hashes_data={0:'rjenkins1', 'rjenkins1': 0} | |
ruletypes_data={1:'replicated',2:'raid4',3:'erasure'} | |
itemById={} |
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
#!/usr/bin/python | |
import sys | |
import csv | |
debug=False | |
stats={} | |
files=sys.argv | |
for csvFile in files: |
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/bash | |
echo osd,device,pci id,pci path,description | |
for i in $(mount | awk '/ceph\/osd/ {printf("%s,%s\n", $1, $3)}'); do | |
osdid=$(echo $i | awk -F, '{print $2}' | awk -F\/ '{sub (/[^0-9]+/, "", $NF); print "osd."$NF}') | |
basedev=$(basename $(echo $i | awk -F, '{print $1}' | sed -e 's/[0-9]//g')) | |
syspath=$(find /sys/devices/ -name $basedev) | |
hostpath=$(basename $(echo $syspath | awk -F\/host '{print $1}') | sed -e 's/^[0-9]*://') | |
if [ $(echo $hostpath | grep ata -c) -gt 0 ]; then | |
hostpath=$(basename $(dirname $(echo $syspath | awk -F\/host '{print $1}')) | sed -e 's/^[0-9]*://') | |
fi |
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/bash | |
echo -n "Finding host.. " | |
remosd=$1 | |
remhost=$(ceph osd find $remosd 2>/dev/null | grep host | awk '{print $4}' | sed -e s/[\",]//g) | |
if [ "$remhost"x == ""x ]; then | |
echo Failed: osd.$remosd does not exist. | |
else | |
echo $remhost | |
ssh $remhost -- "echo -n 'Stopping osd.$remosd: '; stop ceph-osd id=$remosd; echo -n 'Removing upstart flag: '; rm -f /var/lib/ceph/osd/ceph-$remosd/upstart; echo done; remdrive=\$(mount | grep \"ceph-$remosd \" | awk '{print \$1}'); echo -n \"Umounting $remdrive: \"; umount \$remdrive; echo done; echo -n \"Removing mount point\"; rmdir /var/lib/ceph/osd/ceph-$remosd; echo done" |
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
/* | |
* CAN_Bus_Monitor | |
* by: Michael J. Kidd <[email protected]> | |
* Rev: 1.0 | |
* Date: 2015-11-23 | |
* | |
*/ | |
#include <SPI.h> | |
#include "mcp_can.h" |
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
#!/usr/bin/python | |
import sys | |
import socket | |
def Main(host,color): | |
port = 5577 | |
s = socket.socket() | |
s.connect((host, port)) |
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/bash | |
if [ -z $2 ]; then | |
echo | |
echo "Usage: $(basename $0) <ceph.log> <osd-tree>" | |
echo | |
exit 1 | |
fi | |
if [ ! -e $1 ]; then |
OlderNewer