This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Title: send_user_quota_to_carbon.py | |
# Version: 1.0 | |
# Author: Jason Davis | |
# Date: 08/07/2013 | |
# Purpose: Send Isilon user quota usage details to Graphite for visualization | |
# Notes: | |
# This was inspired by the work of "tjhartmann" https://github.com/tjhartmann/ilmn_scripts/blob/master/graphite/ifs_quotas.py | |
# This in intended to be executed on single node in cluster via cron. Tested with OneFS 6.5.5.x. | |
# This should also work on OneFS 7.x with slight modification of the isi quota command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env/python | |
# Version: 2.0 | |
# Author: Jason Davis | |
# Date: 11/2/2014 | |
# Changes: | |
# Replacing "/" with "_" as a delimiter was kinda a bad idea. Using "." which is more standard with Graphite metric naming. | |
# That last logic change was kinda crudely implemented. We shouldn't assume that each quota has a hard threshold and assign a value of 0. | |
# Added some logic to account for "NoneType" hard thresholds. This is typically seen in quotas being impelemented for accounting purposes only. | |
# Purpose: Send Isilon directory quota usage details to Graphite for visualization | |
# Notes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
hdd=$(isi status | grep 'Used:' | awk '{print$3}' | tr -d '()%') | |
clu_health=$(isi statistics query -nall --stats=cluster.health | grep average | awk '{print$2}') | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "value": "'"$hdd"'" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-hdd" | |
if [ $clu_health -eq 0 ] | |
then | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "text": "Healthy", "background-color": "#12DE4F" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-health" | |
else | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "mysecrettokenring", "text": "Attention", "background-color": "#DE4C12" }' --header=Content-Type:application/json "http://10.112.88.114:3030/widgets/aus-health" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dashing.Meter extends Dashing.Widget | |
@accessor 'value', Dashing.AnimatedValue | |
constructor: -> | |
super | |
@observe 'value', (value) -> | |
$(@node).find(".meter").val(value).trigger('change') | |
ready: -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'snmp' | |
NetApp_DataO = Array.new | |
SNMP::Manager.open(:Host => 'netapp-filer.local', :Version => :SNMPv1, :Community => 'public') do |manager| | |
manager.load_module("NETAPP-MIB") | |
response = manager.get(["miscGlobalStatus.0", | |
"miscGlobalStatusMessage.0"]) | |
response.each_varbind do |varbind| | |
NetApp_DataO.push(varbind.value.to_s) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#Send top 10 results of isi statistics heat ordered by pathname to Dashing | |
heat=($(isi statistics heat --nodes=all --pathdepth=6 --totalby=Path | head -16 | grep ifs | awk '{print $5,$1}' | egrep -v ".ifsvar" | sed 's,/ifs/,/,g' | xargs)) | |
heat_array=($heat) | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "<your auth token>", "items": [{ "label": "'"$heat_array[1]"'", "value": "'"$heat_array[2]"'" }, { "label": "'"$heat_array[3]"'", "value": "'"$heat_array[4]"'" }, { "label": "'"$heat_array[5]"'", "value": "'"$heat_array[6]"'" }, { "label": "'"$heat_array[7]"'", "value": "'"$heat_array[8]"'" }, { "label": "'"$heat_array[9]"'", "value": "'"$heat_array[10]"'" }, { "label": "'"$heat_array[11]"'", "value": "'"$heat_array[12]"'" }, { "label": "'"$heat_array[13]"'", "value": "'"$heat_array[14]"'" }, { "label": "'"$heat_array[15]"'", "value": "'"$heat_array[16]"'" }, { "label": "'"$heat_array[17]"'", "value": "'"$heat_array[18]"'" }, { "label": "'"$heat_array[19]"'", "value": "'"$heat_array[20]"'" } ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!python | |
# | |
# Disk space usage displayed as a tree - duTree.py | |
# | |
# Run program without arguments to see its usage. | |
import string, sys, os, getopt | |
from os.path import * | |
boolStrings = ['off', 'on'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#Stats->Dashing | |
#08/22/14 Added in some uh... logic to account for column number changes when a disk pool is in an 'ATTN' state | |
#07/23/14 Commented out the heat stuff as heat is expensive to run on a large cluster | |
hdd=$(isi_classic status -d | grep 'Used:' | awk '{print$3}' | tr -d '()%') | |
ssd=$(isi_classic status -d | grep 'Used:' | awk '{print$5}' | tr -d '()%') | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "St0r!tCS", "value": "'"$hdd"'" }' --header=Content-Type:application/json "http://10.112.81.131:3030/widgets/nahpc-hdd" | |
/usr/local/bin/wget -O- --post-data='{ "auth_token": "St0r!tCS", "value": "'"$ssd"'" }' --header=Content-Type:application/json "http://10.112.81.131:3030/widgets/nahpc-ssd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
#Stats->Graphite | |
#10/27/16 Added boot wear monitoring. Removed Dashing stuff. | |
#02/27/16 Added username specific latency and operation collection. Pushing this data to both Graphite and Dashing | |
#03/29/15 Added in more accurate tracking of tier capacity via diskpools_to_json.py | |
#09/24/14 Added in queries for SmartPool capacity tracking | |
#08/22/14 Added in NFSv3 latency stats | |
#Let's first look and see if we have a stuck execution of the script. If the lock is older than 3 minutes we'll kill the PID and cleanup the lock. | |
find /tmp/send_stats_to_carbon.lck -mmin +3 -exec kill -9 `cat /tmp/send_stats_to_carbon.lck` {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#Notes | |
#This is a little hacky given that you can't calculate a utilization percentage on a quota with no hard-threshold. The "hack" is to set the hard value from 0 to 1. | |
#Also I'm abusing the fact that if you give Graphite a unix timestamp of 0 then it just straight up drops the metric. | |
import os | |
import sys | |
import time | |
import json | |
from subprocess import Popen,PIPE | |
from socket import socket |
OlderNewer