bun

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2018 License: Unlicense Imports: 13 Imported by: 0

README

bun

DC/OS diagnostics bundle analysis tool

Installation

Download binaries from the release page or install from source:

$ go get github.com/adyatlov/bun/bun

Usage

$ mkdir bundle
$ unzip bundle.zip -d bundle
$ cd bundle
$ bun
PROBLEM: dcos-version - Versions are different
Details:
master 172.16.0.23 has DC/OS version 1.11.0
agent 172.16.0.28 has DC/OS version 1.11.0
agent 172.16.0.29 has DC/OS version 1.11.0
agent 172.16.0.21 has DC/OS version 1.11.1
master 172.16.0.22 has DC/OS version 1.11.0
master 172.16.0.24 has DC/OS version 1.11.0
agent 172.16.0.25 has DC/OS version 1.11.0
public agent 172.16.0.26 has DC/OS version 1.11.0
agent 172.16.0.27 has DC/OS version 1.11.0

OK: node-count - Masters: 3, Agents: 5, Public Agents: 1, Total: 9
PROBLEM: health - Some DC/OS systemd units are not healthy.
Details:
172.16.0.21 dcos-docker-gc.service: health = 1

Feedback

Please, report bugs and share your ideas for new features via the issue page.

Contribution

Pull requests are welcome.

Documentation

Index

Constants

View Source
const (
	SUndefined Status = "UNDEFINED"
	SOK               = "OK"
	SProblem          = "PROBLEM"
)
View Source
const (
	JSON    ContentType = "JSON"
	Journal             = "journal"
	Dmesg               = "dmesg"
)
View Source
const (
	Master      HostType = "master"
	Agent                = "agent"
	PublicAgent          = "public agent"
)

Variables

This section is empty.

Functions

func OpenFile

func OpenFile(basePath string, typeName string) (rc io.ReadCloser, err error)

OpenFile opens bundle file. Caller is responsible for closing the file.

func RegisterCheck

func RegisterCheck(ci CheckInfo, c Check)

func RegisterFileType

func RegisterFileType(f FileType)

func SendProg

func SendProg(p chan<- Progress, stage string, step int, count int)

Types

type Bundle

type Bundle struct {
	Path  string
	Hosts map[string]Host // IP to Host map
}

func NewBundle

func NewBundle(path string) (Bundle, error)

func (Bundle) OpenFile

func (b Bundle) OpenFile(fileType string) (io.ReadCloser, error)

OpenFile opens bundle file. Caller is responsible for closing the file.

type Check

type Check func(context.Context, Bundle, chan<- Progress) (Fact, error)

type CheckInfo

type CheckInfo struct {
	Name        string
	Description string
}

func Checks

func Checks() []CheckInfo

type ContentType

type ContentType string

type Fact

type Fact struct {
	Status     Status
	Short      string
	Long       string
	Errors     []string
	Structured interface{}
}

Fact is a piece of knowledge about DC/OS cluster learned from a diagnostic bundle.

type FileType

type FileType struct {
	Name        string
	ContentType ContentType
	// If HostTypes is not empty, then Path is relative to the host's directory,
	// otherwise, it's relative to the bundle's root directory.
	Path        string
	Description string
	HostTypes   map[HostType]struct{}
}

func GetFileType

func GetFileType(typeName string) (FileType, error)

type Host

type Host struct {
	Type HostType
	IP   string
	Path string
}

func (Host) OpenFile

func (h Host) OpenFile(fileType string) (io.ReadCloser, error)

OpenFile opens a host-related file. Caller is responsible for closing the file.

type HostType

type HostType string

type NamedProgress

type NamedProgress struct {
	Name string
	Progress
}

type Progress

type Progress struct {
	Stage string
	Step  int
	Count int
}

type Report

type Report struct {
	CheckInfo
	Fact
}

func RunCheck

func RunCheck(ctx context.Context, name string, b Bundle,
	np chan<- NamedProgress) (Report, error)

type Status

type Status string

Directories

Path Synopsis
check

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL