Skip to content

Instantly share code, notes, and snippets.

View jskarpe's full-sized avatar

Jon Skarpeteig jskarpe

  • Signicat AS
  • Norway
View GitHub Profile
filter {
# strip the syslog PRI part and create facility and severity fields.
# the original syslog message is saved in field %{syslog_raw_message}.
# the extracted PRI is available in the %{syslog_pri} field.
#
# You get %{syslog_facility_code} and %{syslog_severity_code} fields.
# You also get %{syslog_facility} and %{syslog_severity} fields if the
# use_labels option is set True (the default) on syslog_pri filter.
grok {
type => "syslog-relay"
@jskarpe
jskarpe / gist:5716947
Last active December 18, 2015 03:19 — forked from faleev/gist:3435377
#!/bin/bash
# MakeGood for PHP stopped working after Eclipse Indigo (3.8) due to inability to run testrunner.php
# This is a hack PHP binary, to be configured as PHP executable for MakeGood to start working in Juno, Kepler and Luna.
# Remove the -n operator to read all config files
options=`echo $@ | sed 's%-n %%' | sed 's%-c .+? %%'`
# Hardcode path to testrunner.php
options=`echo $options | sed 's@open_tag=on [^ ]*@open_tag=on /opt/testrunner.php
@jskarpe
jskarpe / build.xml
Last active June 22, 2016 06:12
Puppet module testing with acceptance tests in parallel using Apache Ant. Simplifies integration with Jenkins
<?xml version="1.0" encoding="UTF-8"?>
<project name="project" default="build">
<target name="build" depends="clean,bundle-install,syntax,lint">
<antcall target="spec" />
<antcall target="acceptance" />
</target>
<target name="clean">
<delete includeemptydirs="true" removeNotFollowedSymlinks="true" failonerror="false">
class apache2 {
package { 'apache2': ensure => present }
service { 'apache2:' ensure => running }
sensu::check { 'apache2':
command => 'check-process.rb --pattern apache2 --warn-under 1'
}
}
node 'www1.example.com' {
include ::apache
sensu::check { 'apache2':
command => 'check-process.rb --pattern apache2 --warn-under 1'
}
}
if ($::apache_statuspage_enabled) {
include ::collectd::plugin::apache
}
node 'www1.example.com' {
include ::apache
include ::monitoring
}
stage { 'last': }
Stage['main'] -> Stage['last']
class { 'apache2': }
class { 'monitoring':
stage => last
}
refacter { 'monitoring':
patterns => [
'^apache_',
],
}
Service <| title != 'collectd' |> {
before +> Class['monitoring::metrics::collectd'],
notify +> Refacter['monitoring']
}