Skip to content

Instantly share code, notes, and snippets.

View andre's full-sized avatar

Andre Lewis andre

View GitHub Profile
# MySQL Statistics by Eric Lindvall <eric@5stops.com>
# MySQLTuner integration by Andre Lewis <@andre@scoutapp.com>
class MysqlQueryStatistics < Scout::Plugin
ENTRIES = %w(Com_insert Com_select Com_update Com_delete)
OPTIONS=<<-EOS
user:
name: MySQL username
@andre
andre / mysql_replication_monitor_2.rb
Created October 17, 2012 20:32
A version of MySQLReplicationMonitor that relies on triggers instead of internally-generated alerts
require 'time'
require 'date'
class MysqlReplicationMonitor < Scout::Plugin
needs 'mysql'
OPTIONS=<<-EOS
host:
name: Host
notes: The slave host to monitor
default: 127.0.0.1
# MySQL Statistics by Eric Lindvall <eric@5stops.com>
# MySQLTuner integration by Andre Lewis <@andre@scoutapp.com>
class MysqlQueryStatistics < Scout::Plugin
ENTRIES = %w(Com_insert Com_select Com_update Com_delete)
require 'shellwords'
OPTIONS=<<-EOS
user:
name: MySQL username
@andre
andre / php_fpm_status.rb
Created May 30, 2013 16:47
added connections per second
class PHPFpmStatus < Scout::Plugin
needs 'open-uri', 'json'
OPTIONS=<<-EOS
url:
name: FPM Status Url
default: "http://localhost/status?json"
EOS
def build_report
require "time"
require "digest/md5"
# MySQL Slow Queries Monitoring plug in for scout.
# Created by Robin "Evil Trout" Ward for Forumwarz, based heavily on the Rails Request
# Monitoring Plugin.
#
# See: http://blog.forumwarz.com/2008/5/27/monitor-slow-mysql-queries-with-scout
#
# Example line from a slow queries log file:
# MySQL Statistics by Eric Lindvall <eric@5stops.com>
# MySQLTuner integration by Andre Lewis <@andre@scoutapp.com>
class MysqlQueryStatistics < Scout::Plugin
ENTRIES = %w(Com_insert Com_select Com_update Com_delete)
OPTIONS=<<-EOS
user:
name: MySQL username
notes: Specify the username to connect with
default: root

Keybase proof

I hereby claim:

  • I am andre on github.
  • I am alewis (https://keybase.io/alewis) on keybase.
  • I have a public key ASD01o6BN0D9I5fD0vid_1wsLHzlIrv6Xjk3mkdmleYeVwo

To claim this, I am signing this object:

# Drop this file in config/initializers to run your Rails project on Ruby 1.9.
# This is three separate monkey patches -- see comments in code below for the source of each.
# None of them are original to me, I just put them in one file for easily dropping into my Rails projects.
# Also see original sources for pros and cons of each patch. Most notably, the MySQL patch just assumes
# that everything in your database is stored as UTF-8. This was true for me, and there's a good chance it's
# true for you too, in which case this is a quick, practical solution to get you up and running on Ruby 1.9.
#
# Andre Lewis 1/2010
# encoding: utf-8
$VERBOSE = false
require 'benchmark'
require 'net/http'
require 'net/https'
require 'uri'
class UrlMonitor < Scout::Plugin
include Net
OPTIONS=<<-EOS
@andre
andre / hipchat.md
Last active December 19, 2015 14:38
Hipchat notifications

HipChat Notifications

Is email just not fast enough? Do you want instant notification of Scout alerts in your HipChat room? We've added a direct integration to HipChat:

Setup is just what you'd expect - provide your API token (a notification token is fine) and the room name or ID: