Skip to content

Instantly share code, notes, and snippets.

View skamithi's full-sized avatar

Stanley Karunditu skamithi

  • Raleigh, North Carolina
View GitHub Profile
@skamithi
skamithi / tower_testing.md
Created December 15, 2017 16:43
network partition testing

When all 3 nodes come up, there are no network partitions

vagrant@tower1 ~]$ sudo rabbitmqctl cluster_status
Cluster status of node rabbitmq@tower1 ...
[{nodes,[{disc,[rabbitmq@tower1,rabbitmq@tower2,rabbitmq@tower3]}]},
 {running_nodes,[rabbitmq@tower2,rabbitmq@tower3,rabbitmq@tower1]},
 {cluster_name,<<"rabbitmq@tower2">>},
 {partitions,[]},
 {alarms,[{rabbitmq@tower2,[]},{rabbitmq@tower3,[]},{rabbitmq@tower1,[]}]}]
@skamithi
skamithi / crazy_long_skip_key.txt
Created December 14, 2017 15:18
base skip_key gist for vmware inventory script
skip_keys=acquiremksticket,acquireticket,answer,answervm,attachdisk,attachdisk_task,checkcustomizationspec,clone,clonevm_task,consolidatedisks,consolidatevmdisks_task,createscreenshot,createscreenshot_task,createsecondary,createsecondaryex,createsecondaryvmex_task,createsecondaryvm_task,createsnapshot,createsnapshotex,createsnapshotex_task,createsnapshot_task,customize,customizevm_task,defragmentalldisks,destroy,destroy_task,detachdisk,detachdisk_task,disablesecondary,disablesecondaryvm_task,enablesecondary,enablesecondaryvm_task,estimatestorageforconsolidatesnapshots_task,estimatestoragerequirementforconsolidate,exportvm,extractovfenvironment,makeprimary,makeprimaryvm_task,markastemplate,markasvirtualmachine,migrate,migratevm_task,mounttoolsinstaller,poweroff,poweroffvm_task,poweron,poweronvm_task,promotedisks,promotedisks_task,putusbscancodes,querychangeddiskareas,queryfaulttolerancecompatibility,queryfaulttolerancecompatibilityex,queryunownedfiles,rebootguest,reconfigvm_task,reconfigure,refreshstorageinfo,
@skamithi
skamithi / ansible_without_debug.log
Created August 16, 2017 01:41
debug junos vqfx connection to ansible 2.4 fails on netconf actions
2017-08-16 01:37:45,386 p=9431 u=vagrant | ansible-playbook 2.4.0
config file = /home/vagrant/git/ansible-network-testing/ansible.cfg
configured module search path = [u'/home/vagrant/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/vagrant/ansible-dev/lib/python2.7/site-packages/ansible
executable location = /home/vagrant/ansible-dev/bin/ansible-playbook
python version = 2.7.5 (default, Nov 6 2016, 00:28:07) [GCC 4.8.5 20150623 (Red Hat 4.8.5-11)]
2017-08-16 01:37:45,386 p=9431 u=vagrant | Using /home/vagrant/git/ansible-network-testing/ansible.cfg as config file
2017-08-16 01:37:45,391 p=9431 u=vagrant | Parsed /home/vagrant/git/ansible-network-testing/inventory/hosts inventory source with ini plugin
2017-08-16 01:37:45,540 p=9431 u=vagrant | PLAYBOOK: test.yml *************************************************************************************************************************************************************
2017-08-16 01:37:45,54
@skamithi
skamithi / test.py
Created June 12, 2017 19:33
debugging ansible module
# The subcommands in this function make it easier to debug ansiballz
# modules. Here's the basic steps:
#
# Run ansible with the environment variable: ANSIBLE_KEEP_REMOTE_FILES=1 and -vvv
# to save the module file remotely::
# $ ANSIBLE_KEEP_REMOTE_FILES=1 ansible host1 -m ping -a 'data=october' -vvv
#
# Part of the verbose output will tell you where on the remote machine the
# module was written to::
# [...]
@skamithi
skamithi / new_project.yaml
Created January 29, 2016 21:16
Creating tenant users - heat script
heat_template_version: 2015-04-30
description: Create a new Project. Assign a user and user-role pair.
parameters:
demo_project_name:
type: string
description: project name
demo_user_role:
type: string
[
{
"driver_hwmon": [
"fan1"
],
"min": 7200,
"cpld_path": "/sys/bus/platform/devices/dell_s6000_cpld.0",
"0": "ok",
"state": "OK",
"prev_state": "OK",
#! /usr/bin/env ruby
# encoding: UTF-8
#
# check-environmentals
#
# DESCRIPTION:
# Send a Warning message if an environmental sensor is
# more than the warning threshold.
# Send a critical message if sensor is beyond critical threshold.
# Event is sent on first match. So if multiple environmental sensors
#!/bin/bash
#
# Wrapper script for sflowtool when used in pipe input in logstash.
# This wrapper script ensures that the sflowtool is not running prior to start of the sflowtool.
ARGS="$@"
SFLOWTOOL_PID=$(/bin/ps -ef | /bin/grep "/usr/bin/sflowtool $ARGS" | /bin/grep -v "grep" | /bin/awk ' { print $2 } ')
if [ ! -z $SFLOWTOOL_PID ]; then
kill -s 9 $SFLOWTOOL_PID
@skamithi
skamithi / logstash-input-sflowtool
Created December 4, 2015 05:07 — forked from whiskeyalpharomeo/logstash-input-sflowtool
Logstash Input for sFlowtool
input {
pipe {
type => "sflow"
command => "/usr/local/bin/sflowtool_wrapper.sh -l -p 6343"
}
}
@skamithi
skamithi / gist:0f4ce3568fb2a764d03a
Created November 22, 2015 23:42 — forked from mrichar1/gist:a433240cbe142f101e69
Logging events from sensu to logstash

To log checks from sensu into logstash, I use the following sensu config:

{
  "handlers": {
    "logstash": {
      "type": "tcp",
      "socket": {
        "host": "logstash.example.com",
        "port": 1234