• Stars
    star
    147
  • Rank 251,347 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Unit testing for the cloud

Build Status

Table of Contents

Overview

This readme documents the current (development) version of distributive.

Distributive is a tool for running distributed health checks in datacenters. It was designed with Consul in mind, but is stack agnostic. It is simple to configure (with YAML checklists) and easy to deploy and run. It has no runtime dependencies, and can be shipped as a single binary.

Usually, some external server will ask the host to execute this program, reading a checklist from a YAML file, and will record this program's exit code and standard out. Distributive's output includes information about which checks in a checklist failed, and how so.

The exit code meanings are defined as Consul, Kubernetes, Sensu, and Nagios recognize them.

  • Exit code 0 - Checklist is passing
  • Exit code 1 - Checklist is warning
  • Any other code - Checklist is failing

As of right now, only exit codes 0 and 1 are used, even if a checklist fails.

Installation and Usage

Installation/Building

To install the development version (potentially unstable):

  1. Clone this repo: git clone https://github.com/CiscoCloud/distributive && cd distributive
  2. Get Glide.
  3. Install dependencies with glide install
  4. (Optional) Test with go test $(glide novendor)
  5. Build a binary with go build .
  6. Follow the "Usage" instructions below

Distributive currently only supports Linux.

Usage

The default behavior is to run any checks specified via --file, --url, --stdin, or --directory options, or all checks in /etc/distributive.d/ if no location is specified.

$ distributive --help
[...]
GLOBAL OPTIONS:
   --verbosity          info | debug | fatal | error | panic | warn
   --file, -f           Read a checklist from a file
   --url, -u            Read a checklist from a URL
   --directory, -d      Read all of the checklists in this directory
   --stdin, -s          Read data piped from stdin as a checklist
   --no-cache           Don't use a cached version of a remote check, fetch it.
   --help, -h           show help
   --version, -v        print the version

Examples:

$ /path/to/distributive --verbosity="warn" -f ./samples/filesystem.yml
$ distributive --f="/etc/distributive/samples/network.yaml" --verbosity=debug
$ ./distributive -u "http://pastebin.com/raw.php?i=5c1BAxcX"
$ /distributive --verbosity="info"
$ /path/to/distributive -d "/etc/distributive.d/" # same as default behavior
$ cat samples/filesystem.yml | ./distributive -d "" -s=true --verbosity=fatal

Supported Frameworks

Distributive attempts to be as framework-agnostic as possible. It is known to work well with Consul, Kubernetes, Sensu, and Nagios, which have similar design in how they detect passing and failing checks. There is documentation on how to use Distributive with Consul on our Github wiki.

Checks

For the impatient, examples of every single implemented check are available in the samples/ directory, sorted by category. There is extensive documentation for each check available on our Github wiki.

If you'd like to see how Distributive is used in production environments, take a look at the RPM source, which includes checks used in Mantl.

Dependencies

Distributive itself has no dependencies; it is a standalone binary. Some checks, however, rely on output from specific commands. These dependencies are outlined for each check on our Github wiki.

Comparison to Other Software

Distributive was created with the idea of pushing responsibility to the nodes, It was also designed around the idea of constantly changing infrastructure, with servers being added and destroyed constantly, changing IP addresses, and even changing roles. Integration with Consul provides even greater flexibility.

Serverspec

Serverspec runs on a single control server, and requires each check to be in a directory matching the hostname of the machine to run it on. Distributive was designed for dynamic systems with changing IPs, which can report into Consul, Sensu, or another framework as soon as they are ready, and require little or no centralized configuration. Additionally, Distributive attempts to rely as little as possible on external tools/commands, using mostly just the Go standard library.

Nagios

Nagios is an end-to-end monitoring, security, and notification framework. It provides many services not included in Distributive, and solves a very different problem. Distributive is simple, lightweight, and easy to configure, and doesn't provide its own scheduling, dashboard, etc. It is designed to be used within frameworks such as Sensu and Consul. Luckily, Distributive conforms to [Nagios exit code specifications] nagios, and can be used just like any other plugin. Its advantage over other plugins is that it is small, fast, and has no dependencies.

Contributing and Getting Help

Contributing

Thank you for your interest in contributing! To get started, please check out our wiki.

Getting Help

All comments, questions, and contributions are always welcome. We strive to provide expedient and detailed support for anyone using our software. Please submit any requests via our Github Issues Page, where someone will see it and get to work promptly.

License

Copyright © 2015 Cisco Systems, Inc.

Licensed under the Apache License, Version 2.0 (the "License").

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

haproxy-consul

Dynamic haproxy configuration using consul
Shell
168
star
2

marathon-consul

bridge Marathon information to Consul KV
Go
85
star
3

kubernetes-ansible

Install and configure Google Kubernetes on OpenStack
Ruby
82
star
4

nginx-consul

nginx configured with consul template
Shell
41
star
5

k8sclass

Class Materials for Kubernetes Training.
Python
21
star
6

exhibitor-mesos-framework

Exhibitor on Apache Mesos for reliably running Zookeeper on Mesos
Scala
20
star
7

mantl-api

Mantl API
Go
17
star
8

consulacl

Command line interface to Consul ACL endpoint
Go
17
star
9

mantl-devnet-learninglabs

Self paced interactive Learning Labs for learninglabs.cisco.com
HTML
15
star
10

mantl-universe

The Mantl Universe package repository - install Mesos frameworks on Mantl
11
star
11

consulkv

Command line interface to Consul K/V
10
star
12

docker-consul-template

Alpine Linux + consul-template Docker container. Use as a base for other containers
10
star
13

shipped-demo-cart

Cart microservice for shopping site.
Go
8
star
14

ContainerCF

Container.CF Open Source Home
Shell
6
star
15

vault-rpm

Spec file and sources needed to package vault
Shell
6
star
16

vaquero-docs

Documentation for the Vaquero project
CSS
6
star
17

syslog-service

Go based Syslog service that can run within an infrastructure role on Mesos.
Go
5
star
18

docker-logstash

Ruby
4
star
19

clus-my-hero-app

Shell
3
star
20

Shipped-Learning-Labs

A place for uploading, reviewing, and tracking development of Shipped Learning Labs
HTML
3
star
21

shipped-demo-web

Web site for shopping site demo that connect to all microservices.
HTML
3
star
22

consul-utils-rpm

Command line utilities for Consul
3
star
23

edge-test

Test implementation for containerization of the edge components and their validation results.
Java
3
star
24

shipped-devbox

Shipped developer Vagrant box
Shell
3
star
25

shipped-buildpack-template-spark

Shipped buildpack for Cisco Spark, details on developers API at https://developer.cisco.com/site/spark/
JavaScript
2
star
26

docker-utilities

2
star
27

phoenix

Apache Kafka to S3 backup and restore
2
star
28

vaquero-vagrant

Shell
2
star
29

shipped-walkthru

2
star
30

shipped-mongo-sample-client

Python
1
star
31

shipped-feedback

Feedback and issue tracking for the Cisco Shipped project.
1
star
32

marathon-cli

A golang cli to manage apps and groups in Marathon
Go
1
star
33

PCF-Metapod

Automating installation of Cloud Foundry on Metapod
Ruby
1
star
34

mantl-kibana

Shell
1
star
35

shipped-traefik-simulator

Simulate status code and response time delay for HTTP endpoint.
HTML
1
star
36

shipped-buildpack-template-golang

Go - Template Buildpack
Go
1
star
37

vaquero-examples

1
star
38

aie-burnit

Go
1
star