Skip to content

Instantly share code, notes, and snippets.

View teddyking's full-sized avatar

Ed King teddyking

View GitHub Profile
@teddyking
teddyking / gist:9225394
Created February 26, 2014 07:50
Troubleshooting bosh-lite 'java.net.UnknownHostException: uaa.10.244.0.34.xip.io'
# login container
root@6d5e6e7c-3f5b-4c93-8788-b776e43571bd:~# nslookup uaa.10.244.0.34.xip.io
Server: 10.0.2.2
Address: 10.0.2.2#53
** server can't find uaa.10.244.0.34.xip.io: REFUSED
# login container
root@6d5e6e7c-3f5b-4c93-8788-b776e43571bd:~# ping 8.8.8.8
@teddyking
teddyking / nats_healthz_varz_info.rb
Created May 26, 2014 07:57
Prints out the /healthz and /varz connection info for running Cloud Foundry jobs.
# This script prints out the /healthz and /varz connection info
# for your running Cloud Foundry jobs.
#
# The nats_uri variable should be updated to suit your deployment.
# The default nats_uri value will work for a standard bosh-lite deployment.
require 'json'
require 'nats/client'
nats_uri = 'nats://nats:nats@10.244.0.6:4222'
@teddyking
teddyking / cf_loggregator_manifest_snippet.yml
Created October 25, 2014 10:12
Cloud Foundry Manifest Snippet - loggregator
# loggregator manifest config
jobs:
- instances: 1
name: loggregator_z1
networks:
- name: cf1
static_ips:
- 10.244.0.14
properties:
networks:
@teddyking
teddyking / cf_syslog_manifest_snippet.yml
Last active August 29, 2015 14:08
Cloud Foundry Manifest Snippet - syslog
# syslog_aggregator manifest config
jobs:
# NB: This job is optional. There's no need to include this job if
# you already have a syslog endpoint to send your logs to.
- instances: 1
name: syslog_aggregator_server
networks:
- name: cf1
static_ips:
- 10.244.0.18
@teddyking
teddyking / cf_collector_manifest_snippet.yml
Created October 25, 2014 10:13
Cloud Foundry Manifest Snippet - collector
# collector manifest config
jobs:
- instances: 1
name: collector
networks:
- name: cf1
static_ips:
- 10.244.0.38
properties:
networks:
@teddyking
teddyking / logsearch_releases_manifest_snippet.yml
Created October 25, 2014 15:35
logsearch Manifest Snippet - releases
# Add logsearch to the releases array.
releases:
- name: cf
version: latest
- name: logsearch
version: latest
@teddyking
teddyking / logsearch_resource_pools_manifest_snippet.yml
Created October 25, 2014 15:36
logsearch Manifest Snippet - resource_pools
# Add a resource pool for the logsearch jobs.
# Note: We're just using 1 additional resource pool here to keep things simple.
# Note: Update the stemcell name as required (run `bosh stemcells` to get the name of your stemcell).
# Note: We're using the services1 network for this tutorial, update this if you need to.
resource_pools:
- name: logsearch
network: services1
size: 6
stemcell:
name: bosh-warden-boshlite-ubuntu-trusty-go_agent
@teddyking
teddyking / logsearch_jobs_manifest_snippet.yml
Last active August 29, 2015 14:08
logsearch Manifest Snippet - jobs
- name: ls_api
release: logsearch
templates:
- name: api
- name: collectd
- name: elasticsearch
instances: 1
resource_pool: logsearch
networks:
- name: services1
@teddyking
teddyking / logsearch_properties_manifest_snippet.yml
Last active August 29, 2015 14:08
logsearch Manifest Snippet - properties
# Add the required logsearch properties
properties:
collectd:
hostname_prefix: "dev.logsearch."
python_librato:
include_regex: "collectd\\.cpu\\..*,collectd\\.df\\..*,collectd\\.disk\\..*,collectd\\.elasticsearch\\..*,collectd\\.entropy\\..*,collectd\\.interface\\..*,collectd\\.load\\..*,collectd\\.memory\\..*,collectd\\.processes\\..*,collectd\\.redis_.*,collectd\\.users\\..*"
elasticsearch:
host: 10.244.1.2
cluster_name: logsearch-bosh-lite
drain: true
@teddyking
teddyking / mnt_pids.rb
Created October 4, 2016 08:28
Hacktastic script to print a PID from each mount namespace on a host
mntnses = Dir.glob("/proc/*/ns/mnt")
foundmnts = []
foundpids = []
mntnses.each do |mntns|
actualmntns = `readlink "#{mntns}"`
pid = mntns.split("/")[2]
mntnum = actualmntns.gsub(/mnt:\[/, "").gsub(/\]/, "")
#puts "#{pid} - #{mntnum}"