Skip to content

Instantly share code, notes, and snippets.

View discreet's full-sized avatar

Chris Pisano discreet

  • Morning Consult
  • Washington D.C.
View GitHub Profile
@discreet
discreet / Puppet Graphite
Last active August 29, 2015 14:01
Mark Puppet Changes in Graphite
#This will have Puppet send it's changes to Graphite and mark a vertical line on any graph you create to show when the change was made and make it easy to correlate before and after utilization.
require 'puppet'
require 'yaml'
require 'socket'
require 'time'
Puppet::Reports.register_report(:graphite_event) do
configfile = File.join([File.dirname(Puppet.settings[:config]), "graphite_event.yaml"])
@discreet
discreet / SplunkUF_Version
Last active August 29, 2015 14:01
Splunk Universal Forwarder Version
#This fact will pull the Splunk Universal Forwarder version and then normalize it so you can use versioncmp in Puppet to update your Splunk Universal Forwarders.
#Splunk Universal Forwarder Version
Facter.add("SplunkUF_Version") do
confine :osfamily => "RedHat"
setcode do
SplunkUF_Version = Facter::Util::Resolution.exec("/opt/splunkforwarder/bin/splunk --version | awk {'print $4'}")
if SplunkUF_Version.length < 5