Code Monkey home page Code Monkey logo

stasher's Introduction

Overview

stasher is a tool to manage DCOS infrastructure

Requirements

Use the config for DCOS_PASSWORD_DEV, DCOS_PASSWORD_STAGE AND DCOS_PASSWORD_PROD

Usage

./stasher -h

Examples

./stasher -s ethos01-an1-control.dev.cloud.adobe.io -t apigateway
./stasher -s ethos01-an1-control.dev.cloud.adobe.io -v -t klam-ssh
./stasher -s ethos01-an1-control.dev.cloud.adobe.io -v -a all
./stasher -s ethos01-an1-control.dev.cloud.adobe.io -v -a capcom

Usages

Show Deployments

./stasher -s ethos01-ew1-control.stage.cloud.adobe.io -d

Kill task

./stasher -s ethos01-an1-control.dev.cloud.adobe.io -t ethos-datadog.765773b3-9977-11e7-9948-766e67cdfad4 -k

Show tasks

./stasher -s ethos01-an1-control.dev.cloud.adobe.io -t ethos-datadog

List apps

./stasher -s ethos01-ue1-control.dev.cloud.adobe.io -l | grep '"id"' | more

Show apps

./stasher -s ethos01-an1-control.dev.cloud.adobe.io -a ethos-datadog

Edit app

./stasher -s ethos01-ue1-control.dev.cloud.adobe.io -v -a ethos-datadog -e

Show Mesos slaves

./stasher -s ethos01-ue1-control.dev.cloud.adobe.io -m slaves

./stasher -s ethos01-ue1-control.dev.cloud.adobe.io -m flags

Show Mesos tasks

./stasher -s ethos01-ue1-control.dev.cloud.adobe.io -m tasks

Staging tasks

./stasher -s ethos01-uw2-control.dev.cloud.adobe.io -m frameworks | jq -r '.frameworks[]' | grep -B 5 STAGI | grep '"id"' "id": "liuapi-dev-b647512149.liuapi---790396c0bcc85c1012191faaa48ff57e715dded7----0ada80.c57ec2c6-a9d0-11e7-93f7-0ad74b1f6b8d", "id": "rmcmahonorderapi-dev-a463154862.rmcmahonorderapi---fd1dde806e71666b7e04036efa3dcb16cf28df05----9ec70c.c9d9d5c1-a955-11e7-93f7-0ad74b1f6b8d

Count unreachable tasks

./stasher -s ethos01-uw2-control.dev.cloud.adobe.io -m frameworks | jq -r '.frameworks[]' | grep -B 5 UNREA | grep '"id"' | wc -l 69

Killed tasks

./stasher -s ethos01-uw2-control.dev.cloud.adobe.io -m frameworks | jq -r '.frameworks[]' | grep -B 40 KILLING | grep '"id"'

Kill specific task

/stasher -s ethos01-ue1-control.stage.cloud.adobe.io -t $(./stasher -s ethos01-ue1-control.stage.cloud.adobe.io -t apigateway | grep 10.71.22.65 | awk '{ print $2 }') -k

Restart multiple hosts

for i in "10.70.24.136" "10.70.24.143"; do ./stasher -s ethos01-an1-control.prod.cloud.adobe.io -t $(./stasher -s ethos01-an1-control.prod.cloud.adobe.io -t apigateway | grep $i | awk '{ print $2 }') -k; sleep 100; done

Create a JIRA ticket

./stasher -z "Api gateway restart" -y "Api gateway in host 10.1.2.3" -j

Restart apigateway and create JIRA ticket

SERVER=ethos01-ue1-control.prod.cloud.adobe.io; for i in "10.71.28.149" "10.71.30.90"; do ./stasher -s $SERVER -t $(./stasher -s $SERVER -t apigateway | grep $i | awk '{ print $2 }') -k -z "Api gateway restart in host $i" -y "Api gateway in host $i" -j; sleep 10; done

Send message to slack CHANNEL

Go to https://channel.slack.com/apps/manage/custom-integrations and get the Webhook URL.

CHANNEL="#stasher" WEBHOOKURL="https://hooks.slack.com/services/XXXX/XXXX/" USERNAME="sancheza" ./stasher -c "This is posted to #ethos-ops-standup and comes from a bot named sancheza"

Author

Alejandro Sanchez Acosta [email protected]

stasher's People

Contributors

asancheza avatar bryceaj avatar filmaj avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stasher's Issues

Need a license and updated contribution guidelines

Hello,

I'm Fil from Adobe's Open Source Office. We need to make sure every open source repo owned by Adobe has a proper license, copyright headers and contribution guidelines. This repo is missing a license as well as lacks the proper content in its contribution guidelines (there is no mention of the requirement to sign Adobe's CLA).

@asancheza if this repo is still to be open and active, could you please submit an open sourcing request for this repo over at opensource.corp.adobe.com? If we no longer wish to maintain this repo, then we should remove it or archive it. If we do decide to archive it, we should still put in a license.

Send notifications to Slack

Description

Send notifications to slack

Steps to Reproduce

  1. Add -c option
  2. Specify the message to send to Slack
  3. Send the message to the specific channel

Expected behavior: Send messages to Slack channel

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.