Skip to content

Instantly share code, notes, and snippets.

View jcooklin's full-sized avatar

Joel Cooklin jcooklin

View GitHub Profile
@jcooklin
jcooklin / README.md
Last active October 9, 2021 12:27
relay-collectd-task

This compose file demonstrates the snap-relay, a stand-alone streaming plugin. The compose file will start a container for snap, the relay, collectd and influxdb. A short lived 'init' container is started which loads the plugins and starts the task.

This compose file makes the following assumptions.

@jcooklin
jcooklin / -
Created May 22, 2017 18:49
snap psutil task definition
---
version: 1
schedule:
interval: 1s
type: simple
workflow:
collect:
metrics:
/intel/psutil/cpu/*/guest: {}
/intel/psutil/cpu/*/idle: {}
package nginxdbg
import (
"bufio"
"fmt"
"os"
"strings"
"time"
"github.com/intelsdi-x/snap/control/plugin"
#!/bin/bash -x
SESSION_NAME="snap-cpu"
tmux has-session -t ${SESSION_NAME}
if [ $? != 0 ]
then
# create the session
tmux new-session -s ${SESSION_NAME} -n snapd -d
@jcooklin
jcooklin / -
Last active March 22, 2016 18:10
{
"schedule": {
"interval": "200ms",
"type": "simple"
},
"version": 1,
"workflow": {
"collect": {
"metrics": {
"/intel/procfs/cpu/all/active_percentage": {},
@jcooklin
jcooklin / run-snapd.sh
Created January 5, 2016 21:51
starts a snap tribe, loads plugins and starts a task
#!/bin/bash
typeset -i num
num=6
echo "starting seed"
$SNAP_PATH/bin/snapd --tribe --tribe-port 6000 --tribe-addr 127.0.0.1 --tribe-node-name seed --api-port 8181 -l 1 -t 0 --enable-instrumentation 2>&1 > /tmp/p-seed.out &
echo "starting $num snap agents"
for ((i=1;i<num;i++))
do
sleep .1
@jcooklin
jcooklin / rfc.md
Last active December 20, 2015 19:43
rfc: tribe redux

#RFC: Tribe - subtribes, policy, message encryption and calling remote plugins

This spec proposes the following features and enhancements to tribe

  • Group members of the global tribe into named subtribes replacing what today is called agreements
  • Tribe policies to dynamically add nodes to subtribes
  • Enable calling remote plugins through sharing plugin meta via tribe
  • Encryption of tribe messages
@jcooklin
jcooklin / -
Last active December 3, 2015 19:43
snap-preso.html
<!DOCTYPE html>
<html>
<head>
<title>snap</title>
<meta charset="utf-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
@jcooklin
jcooklin / sign-plugin.sh
Last active December 3, 2015 00:28
Signs snap plugin
#!/bin/bash
die() {
echo >&2 "$@"
exit 1
}
if [ "$#" -lt 3 ] || [ "$#" -gt 3 ]
then
die "Error: expected the secret-keyring public-keyring and plugin to sign"
@jcooklin
jcooklin / create-gpg-signing-key.sh
Last active December 3, 2015 00:29
Creates a gpg signing key
#!/bin/bash
gpg_batch_config="/tmp/gpg-batch"
my_name="Joel Cooklin"
my_email="joel.r.cooklin@intel.com"
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
echo ""