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 python3 | |
import sys | |
# data extracted from cloudping : https://www.cloudping.co/grid/p_90/timeframe/1D | |
rows = [] | |
try: | |
max_latency = int(sys.argv[1]) | |
except (IndexError, ValueError): | |
max_latency = 20 |
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 python3 | |
# simple POC code to illustrate the integration of radosgw-admin and a prometheus | |
# client | |
# | |
# Requires: | |
# python3-jmespath | |
# python3-prometheus_client | |
# ceph-common installed (i.e. radosgw-admin command is available) | |
# ceph.conf configured |
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/python3 | |
import threading | |
from prometheus_client import start_http_server | |
from prometheus_client.core import GaugeMetricFamily, REGISTRY | |
import os | |
import subprocess | |
import json | |
import time | |
import enum |
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 python3 | |
import cherrypy | |
# Test: | |
# curl -H "Content-Type: application/json" http://localhost:8000/data --data '{"data":30}' -X POST | |
class Root: | |
def __init__(self): |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"$$hashKey": "object:140", | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", |
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
import datetime | |
import os | |
import json | |
# 1. ensure your host has python3-remoto installed | |
import remoto | |
# 2. Pick the location of the cephadm 'binary' to ship to the target | |
# cephadm_path = '/home/paul/git/ceph/src/cephadm/cephadm' | |
# cephadm_path = '/usr/sbin/cephadm' |
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
{ | |
"health": { | |
"host_facts": "active", | |
"list_daemons": "active", | |
"ceph_volume": "active", | |
"http_server": "active" | |
}, | |
"host": { | |
"scrape_timestamp": 1599777626.2632258, | |
"scrape_duration_secs": 0.01775193214416504, |
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 python3 | |
import os | |
import fcntl | |
import subprocess | |
import logging | |
import time | |
import select | |
import json | |
import datetime | |
from urllib.request import urlopen |
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
import yaml | |
import threading | |
import logging | |
import json | |
import os | |
import subprocess | |
import socket | |
import sys | |
import fcntl | |
import select |
NewerOlder