This file contains hidden or 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
#Knife invocations supply FQDN as the node name at creation time and this becomes hostname( option -N) | |
execute "Configure Hostname" do | |
command "hostname --file /etc/hostname" | |
action :nothing | |
end | |
#Ensure the hostname of the system is set to knife provided node name | |
file "/etc/hostname" do | |
content node.name |
This file contains hidden or 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/bash | |
#/etc/network/if-up.d/update_hosts | |
set -e | |
#Variable IFACE is setup by Ubuntu network init scripts to whichever interface changed status. | |
[ "$IFACE" == "eth0" ] || exit | |
myname=`cat /etc/hostname` | |
shortname=`cat /etc/hostname | cut -d "." -f1` | |
hostsfile="/etc/hosts" | |
#Knock out line with "old" IP |
This file contains hidden or 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/ruby | |
require 'rubygems' | |
require 'hipchat-api' | |
require 'getopt/long' | |
require 'socket' | |
require 'erb' | |
#Do not modify these constants! (after you set these up, of course) | |
HipApiKey='ABCDEFGHKJHKJHKJHKJH' | |
Room='Nagios' |
This file contains hidden or 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
#Run this from your Knife folder with "knife exec /pathto/knife_status.rb" | |
stats=Array.new | |
sizes=[0,0,0] | |
TimeFormat="%F %R" | |
Sep='|' | |
nodes.all do |thisnode| | |
checkintime=Time.at(thisnode['ohai_time']).to_i | |
rubyver = thisnode['languages']['ruby']['version'] | |
recipes = thisnode.run_list.expand(thisnode.chef_environment).recipes.join(",") |
NewerOlder