Graphite does two things:
- Store numeric time-series data
- Render graphs of this data on demand
What Graphite does not do is collect data for you, however there are some tools out there that know
| #!/usr/bin/python | |
| import socket,select | |
| # -*- coding: utf-8 -*- | |
| import sys, os, time, atexit | |
| from signal import SIGTERM | |
| class Daemon: | |
| """ | |
| A generic daemon class. | |
| Usage: subclass the Daemon class and override the _run() method |
| #!/usr/bin/python | |
| import sys | |
| import MySQLdb | |
| import ConfigParser | |
| config=ConfigParser.ConfigParser() | |
| config.readfp(open('/tmp/DNS.conf')) | |
| pick_list=config.get('DNS','ip') | |
| hostlist=map(str,pick_list.split(',')) | |
| def pingcmd(ip,port): |
| #!/usr/bin/python | |
| import socket,select | |
| # -*- coding: utf-8 -*- | |
| import sys, os, time, atexit | |
| from signal import SIGTERM | |
| class Daemon: | |
| """ | |
| A generic daemon class. | |
| Usage: subclass the Daemon class and override the _run() method |
| #!/usr/local/bin/python | |
| import sys | |
| import MySQLdb | |
| import ConfigParser | |
| config=ConfigParser.ConfigParser() | |
| config.readfp(open('/tmp/DNS.conf')) | |
| pick_list=config.get('DNS','ip') | |
| hostlist=map(str,pick_list.split(',')) | |
| monitor_user=config.get('check_mysql','username') |
| #!/usr/bin/python | |
| # Copyright Jon Berg , turtlemeat.com | |
| # Modified by nikomu @ code.google.com | |
| import string,cgi,time | |
| from os import curdir, sep | |
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| from sys import exit | |
| import os # os. path |
| #/usr/bin/python | |
| import pylibmc | |
| from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer | |
| import cgi | |
| import logging | |
| class example(): | |
| host = "" | |
| server = "" | |
| def __init__(self, host='10.10.93.16',port=11211): |
| #!/bin/bash | |
| #filename cm.sh | |
| #author:wumin | |
| #---Date:2011.12.29 pm--- | |
| #notice:not suport kind of ubuntu and debian system.(debian not suport /dev/tcp/host/port stye ) | |
| usage() { | |
| format_usage="Usage:\n |
| <?php | |
| $size = pow(2, 16); | |
| for ($key = 0, $maxKey = $size - 1; $key <= $maxKey; ++$key) | |
| { | |
| $post_string = $post_string.$key . '=1' .'&'; | |
| } | |
| //echo $post_string, "\n"; | |
| //create cURL connection | |
| $curl_connection = | |
| curl_init('http://127.0.0.1/a.php'); |
Graphite does two things:
What Graphite does not do is collect data for you, however there are some tools out there that know
| #!/usr/bin/env python | |
| # Parse disk:* from lshw -xml | |
| """ | |
| Sample Output: | |
| ATA Disk Hitachi HDS72105 /dev/sda | |
| Disk Space: 500107862016 | |
| Sector size: 512 |