Skip to content

Instantly share code, notes, and snippets.

View jfqd's full-sized avatar

Stefan Husch jfqd

View GitHub Profile
@jfqd
jfqd / memcached_munin_plugin.rb
Created March 16, 2010 08:07
Memcached Munin Plugin
#!/usr/bin/ruby
# memcached munin plugin
# requirements: memcached and the memcache gem (sudo gem install memcache)
require 'rubygems'
require 'memcache'
HOST = ENV['HOST'].nil? ? '127.0.0.1' : ENV['HOST']
PORT = ENV['PORT'].nil? ? 11211 : ENV['PORT']
@jfqd
jfqd / passenger_memory_stats.rb
Created March 25, 2010 08:04
Passenger and Apache Memory Munin Plugin
#!/usr/bin/ruby
# Passenger and Apache Memory Munin Plugin
# put in /usr/share/munin/plugins/ and link into /etc/munin/plugins then restart munin-node
# by Dan Manges, http://www.dcmanges.com/blog/rails-application-visualization-with-munin
# small changes by jfqd 2010-03-25
# NOTE: you might need to add munin to allow passwordless sudo for passenger-memory-stats
def output_config
puts <<-END
// create calendar table - need to be run only once!
FMiCalConnector_Settings( "-createCalendarsTable" )
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='puppet'>
<service
name='network/puppet/client'
type='service'
version='1'>
<create_default_instance enabled='false' />
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type='manifest' name='puppetmasterd'>
<service
name='network/puppet/master'
type='service'
version='1'>
<create_default_instance enabled='false' />
#!/bin/bash
# (c) 2010 S. Husch | qutic development
# postflight init script after zone installation
# Make sure only root can run this script
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
<service_bundle type="manifest" name="memcached">
<service name="application/database/memcached" type="service" version="1">
<dependency name="network" grouping="require_all" restart_on="error" type="service">
<service_fmri value="svc:/milestone/network:default"/>
</dependency>
<instance name="default" enabled="true">
<method_context>
<method_credential user="webservd" group="webservd"/>
#!/bin/bash
# memcached build script for nexenta ncp3 (no package available)
cd /usr/local/src
# get libevent library
/usr/bin/wget http://www.monkey.org/~provos/libevent-1.4.14b-stable.tar.gz
/usr/sbin/tar xzf libevent-1.4.14b-stable.tar.gz
cd libevent-1.4.14b-stable
./configure
@jfqd
jfqd / kstat
Created September 2, 2010 12:26
#!/usr/perl5/bin/perl
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
#!/usr/bin/ruby
# passenger_status.rb
def output_config
puts <<-END
graph_category App
graph_title passenger status
graph_vlabel count
sessions.label sessions