Skip to content

Instantly share code, notes, and snippets.

View kylebrandt's full-sized avatar
🦥
🛠️

Kyle Brandt kylebrandt

🦥
🛠️
View GitHub Profile
@kylebrandt
kylebrandt / notes.md
Created June 17, 2016 16:49
Release notes

0.5.0 Release Notes

Bosun

This is our first non-preview release in 9 months and includes significant changes since 0.4.0. Future releases should be at a quicker pace since this release involved a complete refactor of Bosun's internal storage.

  • We have moved Bosun's internal storage from purely in-memory (that was seralized to bolt) to redis/ledis and refactored the code to be more incident based. In 0.4.0 the dashboard could take 10-30 seconds to load at times. It now should not take more than a second under normal conditions, and should be even faster in a future release. This also results in faster startup times for Bosun and other performance improvements
  • Deprecated the logstash queries and replaced them with more generic elastic functions. This supports different time formats, index naming schemes, and adds more search possibilities
  • Added support for basic series operations. Before wit
@kylebrandt
kylebrandt / hook.go
Last active July 13, 2016 19:07
hook for bosun conf file saving to push to git
package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
)
@kylebrandt
kylebrandt / bosun-hiera-config.json
Created August 8, 2016 14:40
Bosun Puppet Example ( :: in fname is dir )
{
"classes": [
"bosun",
],
"bosun::quiet": false,
"bosun::httplisten": ":8080",
"bosun::timeanddate": [ 202, 75, 179, 136 ],
"bosun::hostname": "bosun.example.com",
"bosun::shorturlkey": "2220abb99ef14ebaa2a9c12afd8185e1",
"bosun::rulefilepath": "/opt/bosun/config/prod.conf",
@kylebrandt
kylebrandt / Overview
Created February 2, 2017 21:05
Previewing Puppet ERB Files with JSON Datasource from Commandline
Based on the idea in this SO answer: http://stackoverflow.com/a/30037886/107156
1) Create a ruby file to contain the variables
2) when running erb, important that file as a library
Notes:
- The .rb file must have all variables that you call methods on (i.e. `any?`) or you will get a nilClass error.
- The switch to -r doesn't have the .rb extension on it, but the file does
@kylebrandt
kylebrandt / keybase.md
Created February 5, 2016 20:26
kyebase.md

Keybase proof

I hereby claim:

  • I am kylebrandt on github.
  • I am kylebrandt (https://keybase.io/kylebrandt) on keybase.
  • I have a public key whose fingerprint is 8A84 EBFD 20C4 C59D 8DE9 FEEA 6554 F744 4F64 75E4

To claim this, I am signing this object:

@kylebrandt
kylebrandt / _.xkb_symbols_local
Created February 24, 2017 23:03
keyboard remappings with xkb
partial modifier_keys
xkb_symbols "kycracra" {
modifier_map Mod3 { Super_L, Super_R };
key <SUPR> { [ NoSymbol, Super_L ] };
modifier_map Mod3 { <SUPR> };
key <HYPR> { [ NoSymbol, Hyper_L ] };
modifier_map Mod4 { <HYPR> };
@kylebrandt
kylebrandt / gist:733572edb66c27894f22
Created March 1, 2016 18:59
ny bosun haproxy config
global
chroot /var/lib/haproxy
daemon
group haproxy
log 127.0.0.1 local0
maxconn 4000
pidfile /var/run/haproxy.pid
stats socket /var/lib/haproxy/stats
user haproxy
@kylebrandt
kylebrandt / index.html
Created May 25, 2014 03:19
Graphing a Linear Regression Forecast with d3.js and simple_statistics.js
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>D3 Learning</title>
<script src="simple_statistics.js"></script>
<script src="d3.v3.min.js" charset="utf-8"></script>
<style>
.line {
fill: none;
@kylebrandt
kylebrandt / example.txt
Created August 10, 2017 20:02
Bosun Host Down
alert host.down {
template = host.down
macro = host.based.contacts
macro = host.generic_info
$notes = Both ny-bosun01 and co-tsdb01 have to agree a host is down
$unit_string = Bosun ping timeout
$query_string = "sum:bosun.ping.timeout{dst_host=*,host=ny-bosun01|co-tsdb01}"
$last_two = sum(t(min(rename(q($query_string, "2m", ""), "host=source,dst_host=host")), "host"))
$previous_four = sum(t(min(rename(q($query_string, "5m", "1m"), "host=source,dst_host=host")), "host"))
$five_to_seven = sum(t(max(rename(q($query_string, "7m", "5m"), "host=source,dst_host=host")), "host"))
@kylebrandt
kylebrandt / gist:536300a5b1d6208394b264736ed76612
Last active October 12, 2017 12:22
Draft of Port-Channel Admin/Oper Alert
template network.nexus.portchannel.bad {
subject = {{.Last.Status}}: {{.Eval .Alert.Vars.upDownByHost | printf "%.f" }} down Port-Channels on {{.Group.host}}
body = `{{ template "header" . }}
{{/* source is http://www.net-snmp.org/docs/mibs/interfaces.html . Oper and Admin are actually different in that Admin only includes up/down/testing. However, 1, 2, 3 of Oper status is the same as the first 3 of admin status, so the same map can be used */}}
{{ $statusReference := makeMap "1" "up" "2" "down" "3" "testing" "4" "unknown" "5" "dormat" "6" "not present" "7" "lowerLayerDown" }}
{{ $joinResult := .LeftJoin .Alert.Vars.adminUpAndOperDown .Alert.Vars.operStatus .Alert.Vars.adminStatus }}
{{ if notNil $joinResult }}
<h2>Port-Channels with Non-Healthy Status</h2>