Coder Social home page Coder Social logo

dcosjq's Introduction

What is dcosjq?

In short, dcosjq is a simple command line tool for parsing files contained within DC/OS diagnostic bundles.

The intent of dcosjq is to mimic the functionality of the DC/OS CLI when working with DC/OS diagnostic bundles and parse the information in the bundles more effective and efficiently. To accomplish this, we leverage the use of jq. Using dcosjq allows you to quickly gather information about a cluster and its state without having to open large, and often cumbersome, JSON files.

This project is currently a work-in-progress and will likely be updated regularly. Any feedback or contributions are welcome.

Installation

$ git clone [email protected]:some-things/dcosjq.git
$ cp dcosjq/dcosjq.sh /usr/local/bin/dcosjq
$ chmod +x /usr/local/bin/dcosjq

Running via Docker

To run dcosjq against a bundle using Docker, execute the following commands while the bundle root is your working directory:

$ docker run --rm -it -v "$(pwd)":/bundle -w="/bundle" dnemes/dcosjq:latest
$ dcosjq

To run dcosjq against a live cluster using Docker, execute the following commands:

$ docker run --rm -it dnemes/dcosjq:latest
$ cluster-setup
Target cluster DC/OS version: <your-cluster-version>
Target cluster URL (https://<cluster-url>): <your-cluster-url>
<complete authentication>
$ dcosjq

Note: You may consider adding the following aliases to your bashrc/zshrc file:

alias dcosjq-docker='docker run --rm -it dnemes/dcosjq:latest'
alias dcosjq-docker-bundle='docker run --rm -it -v "$(pwd)":/bundle -w="/bundle" dnemes/dcosjq:latest'

Environment Variables

dcosjq supports the following environment variables:

Variable Default Description
DCOSJQ_TICKETS_DIR ${HOME}/Documents/logs/tickets Directory where the bundle will be extracted

Usage

Note: For JSON and log parsing features, dcosjq must be executed from within the DC/OS diagnostic bundles root directory with all files decompressed.

Parsing JSON files:

General Cluster Information:

# Relevant DC/OS config.yaml information
$ dcosjq cluster info

# Resources (cpu, mem, disk, gpu) for all agents
$ dcosjq cluster resources

Exhibitor

# Exhibitor/Zookeeper leader
$ dcosjq exhibitor leader

# Exhibitor/Zookeeper status
$ dcosjq exhibitor status

Mesos

- General Information:
# Mesos leader
$ dcosjq mesos leader

# Mesos flags
$ dcosjq mesos flags
- Framework:
# Mesos framework list
$ dcosjq framework list

# Mesos framework's information
$ dcosjq framework <id>

# Mesos framework's agents
$ dcosjq framework <id> agents

# Mesos framework's tasks
$ dcosjq framework <id> tasks [--all]

# Mesos framework's task's information
$ dcosjq framework <id> tasks <id>

# Mesos framework's roles
$ dcosjq framework <id> roles

# Mesos framework's DC/OS package options (if applicable)
$ dcosjq framework <id> options
- Task:
# Mesos task list
$ dcosjq task list

# Mesos task's information
$ dcosjq task <id>
- Role:
# Mesos role list
$ dcosjq role list

# Mesos role's information
$ dcosjq role <id>

# Mesos role's agents
$ dcosjq role <id> agents
- Agent:
# Mesos agent list
$ dcosjq agent list

# Mesos agent's information
$ dcosjq agent <id>

# Mesos agent's resources (cpu, mem, disk, gpu)
$ dcosjq agent <id> resources

# Mesos agent's frameworks
$ dcosjq agent <id> frameworks

# Mesos agent's tasks
$ dcosjq agent <id> tasks

Marathon

# Marathon leader
$ dcosjq marathon leader

# Marathon information
$ dcosjq marathon info

# Marathon app list
$ dcosjq marathon app list

# Marathon app's JSON configuration
$ dcosjq marathon app <id> show

# Marathon deployment list
$ dcosjq marathon deployment list

# Marathon deployment's information
$ dcosjq marathon deployment <id>

# Marathon group list
$ dcosjq marathon group list

# Marathon group's information
$ dcosjq marathon group <id>

# Marathon pod list
$ dcosjq marathon pod list

# Marathon pod's information
$ dcosjq marathon pod <id> show

# Marathon task list
$ dcosjq marathon task list

# Marathon task's information
$ dcosjq marathon task <id>

Checks:

Note: Checks are to be used as indicators and do not necessarily mean there are any issues within the cluster. In other words, if you are experiencing issues, they may provide helpful information and/or rule out any known/common issues.

$ dcosjq checks

Miscellaneous:

Format all JSON files within the current working directory and all sub-directories:

$ dcosjq format

Extract/decompress/move/format bundle files. Please review and understand the code here before using this feature. All files will be moved to the path specified in USER_TICKETS_DIR (Default: $HOME/Documents/logs/tickets) :

$ dcosjq extract <bundle-name>.zip

Contributing

Any issues, features, or pull requests are welcome!

Contact

dcosjq's People

Contributors

jeffwhite530 avatar some-things avatar

Watchers

 avatar  avatar

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.