View limb.go
package main
import (
"fmt"
"math/bits"
"sort"
)
type Limb byte
View gist:536300a5b1d6208394b264736ed76612
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>
View example.txt
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"))
View _.xkb_symbols_local
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> };
View Overview
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
View bosun-hiera-config.json
{
"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",
View hook.go
package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
)
View notes.md

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
View Backup Cronjob
0 * * * * cp -a /var/lib/redis/bosun-redis.rdb '/mnt/bosun_backup/bosun_redis_'$(date +\%Y-\%m-\%d-\%H).rdb && find '/mnt/bosun_backup/' -maxdepth 1 -name 'bosun_*.rdb' -ctime '+2' -delete
## Hmpf, ctime makes no since, just noticed, but whatever.
View gist:a63fbf1d36f6d4f6cc100383cf140906
$metric = "sum:5m-avg:rate{counter,,1}:__ny-nexus02.os.net.bytes{host=ny-nexus02,iname=Ethernet3/1}"
$monthToDate = mtod(-4)
$commit = 150
$mtdAgo = epoch()-$monthToDate
$q = q($metric, tod($mtdAgo), "") * 8
$mtdAgo > d("1d") && percentile($q, .95) / 1e6 > $commit*.70