Skip to content

Instantly share code, notes, and snippets.

View mainframe's full-sized avatar

Andres Toomsalu mainframe

View GitHub Profile
#!/usr/bin/env python
'''
Simple Python script which endlessly keeps writing 100MB to a temp file.
Used to demonstrate a Ceph cluster. This script runs inside a Virtual Machine (KVM)
running on a RBD image on a Ceph cluster.
The demo is to randomly pull out machines and show that the script can still write
and read data.
@mainframe
mainframe / ceph-rados-latency.py
Created December 6, 2016 13:29 — forked from wido/ceph-rados-latency.py
Simple Python script to store RADOS read/write latency in Graphite
#!/usr/bin/env python
'''
This script writes X MegaByte random data to 10 RADOS objects and read the data again afterwards
It writes these statistics towards a Graphite server so you can see what the latency
inside your cluster is for both Read and Write
Author: Wido den Hollander <wido@widodh.nl>
'''
@mainframe
mainframe / crush-location-lookup.sh
Created December 6, 2016 13:29 — forked from wido/crush-location-lookup.sh
Ceph CRUSH Location lookup
#!/bin/bash
# Generates a CRUSH location based on the machine's hostname.
# This Gist was written for a customer who has mixed SSDs and HDDs in a a chassis.
# Hostname example in this case: dc2-rk01-ceph01 (Datacenter 2, rack 01, Ceph machine 01)
# It checks if the backing disk is a SSD or not and then comes up with the CRUSH location
while :; do
case $1 in
--cluster)
@mainframe
mainframe / ceph-udev-disk-scheduler.rules
Created December 6, 2016 13:28 — forked from wido/ceph-udev-disk-scheduler.rules
ceph-udev-disk-scheduler.rules
# udev rule to set disk schedulers for Ceph
# For spinning disks we want the CFQ scheduler so that we can set
# priorities on client and recovery I/O threads
#
# Author: Wido den Hollander <wido@42on.com>
# Date: July 2015
# Use deadline for SSDs
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline"
@mainframe
mainframe / zabbix-ceph-mon.py
Created December 6, 2016 13:27 — forked from wido/zabbix-ceph-mon.py
Zabbix Ceph Monitor Cron
#!/usr/bin/env python
'''
Script to send Zabbix Agent active data to the Zabbix Server.
It runs the ceph command locally to get information from the running
OSDs and send the aggegrated data back to Zabbix.
'''
import sys
import subprocess
@mainframe
mainframe / ceph-upgrade-hammer-jewel.sh
Created December 6, 2016 13:26 — forked from wido/ceph-upgrade-hammer-jewel.sh
Ceph upgrade OSD from Hammer to Jewel
#!/bin/bash
#
# Script for updating a running Ceph Hammer cluster to Jewel
#
# This has to be run on the OSD node(s) as root
#
# Written for and tested on CentOS 7
#
# Used to upgrade Ceph at ODC-Noord in the Netherlands
#
@mainframe
mainframe / rbd-export-import.py
Created December 6, 2016 13:25 — forked from wido/rbd-export-import.py
Multi threaded RBD copy
#!/usr/bin/env python
"""
Python script to multi-threaded copy a RBD image from one cluster to another
This script requires a configuration file and a RBD image to copy.
It will copy the RBD image from the source pool to destination pool as
specified in the configuration file.
It assumes the destination image already exists and is at least the size of the
@mainframe
mainframe / nf-s3-http.cyberduckprofile
Created November 22, 2015 00:12
Cyberduck NodeFabric S3 connection profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Protocol</key>
<string>s3</string>
<key>Vendor</key>
<string>NodeFabric</string>
<key>Scheme</key>
<string>http</string>
@mainframe
mainframe / on-net-speedtest.sh
Created May 28, 2013 06:42
Test network speed with speedtest.net
#!/bin/bash
# Copyright (C) 2013, OpenNode LLC. All rights reserved.
# Email: info@opennodecloud.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@mainframe
mainframe / on-dell-omsetup.sh
Created May 27, 2013 21:12
Setup Dell OpenManage software and management service
#!/bin/bash
# Copyright (C) 2013, OpenNode LLC. All rights reserved.
# Email: info@opennodecloud.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,