csi

package module
v0.0.0-...-767721b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2015 License: GPL-2.0 Imports: 11 Imported by: 0

README

CSI - Crash Scene Investigation Build Status

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrashInspector

type CrashInspector struct {
}

CrashInspector gathers information about a crash.

func (CrashInspector) Inspect

func (self CrashInspector) Inspect(pid int, signal os.Signal) (*CrashReport, error)

Inspect gathers information for a crashed process identfied by pid, recording the signal that caused the crash.

Returns an error if either gathering system info or process-specific info fails.

type CrashReport

type CrashReport struct {
	Signal  os.Signal      // Signal that caused the crash
	System  *SystemReport  // Information about the overall system
	Process *ProcessReport // Information about the crashed process
}

Crash report bundles all meta-data about a crashed process.

type FSStats

type FSStats struct {
	BlockSize      int64  // Optimal transfer block size.
	BlockCount     uint64 // Total number of data blocks in a file system.
	BlockFree      uint64 // Free blocks in a file system.
	BlockAvailable uint64 // Free blocks available to unprivileged users.

}

Poor man's version of StatFs, just exposing the values we are actually interested in

type Mount

type Mount struct {
	Spec          string   // The field describes the block special device or remote filesystem to be mounted.
	File          string   // Describes the mount point for the filesytem.
	Type          string   // Describes the type of the filesystem.
	MntOps        string   // Describes the mount options associated with the filesystem.
	DumpFrequency int      // Dump frequency in days.
	PassNo        int      // Pass number on parallel fsck.
	FSStats       *FSStats // Filesystem data, may be nil.
}

Mount describes a mounted filesytem. Please see man fstab for further details.

type OSInspector

type OSInspector struct {
	DmesgCollector  log.Collector
	SyslogCollector log.Collector
	ReleaseFile     string
	MemInfo         string
	MTab            string
}

OSInspector provides means to gather information about the operating system

func (OSInspector) Inspect

func (self OSInspector) Inspect() (OSReport, error)

type OSReport

type OSReport struct {
	Name    string // Name of the OS
	Release string // Relase of the OS
	Logs    struct {
		Dmesg  []byte // Contents of the kernel log buffer
		Syslog []byte // Contents of syslog
	}
	Memory struct {
		Total uint64 // Total usable RAM
		Free  uint64 // Amound of memory currently unused
	}
	Swap struct {
		Total uint64 // Total amount of swap space available
		Free  uint64 // Amount of swap space that is currently unused
	}
	Mounts []Mount // All mounted filesystems
}

OSReport summarizes information about the operating system

type ProcessInspector

type ProcessInspector struct {
	PackagingSystem pkg.System // Queries into the underlying packaging system
}

ProcessInspector inspects an individual process

func (ProcessInspector) Inspect

func (self ProcessInspector) Inspect(id int) (*ProcessReport, error)

Inspect inspects an individual process, returning a report on sucess and nil in case of an error.

Returns an error in case of assembling required information fails.

type ProcessReport

type ProcessReport struct {
	Bundle pkg.Bundle // The package/bundle the executable executed in the process belongs to

	Cmdline     pid.Cmdline     // Command line
	Cwd         pid.Cwd         // Current working directory
	Env         pid.Environ     // Runtime environment
	Exe         pid.Exe         // Path to executed command
	Fd          pid.Fd          // All open fds
	IO          pid.IO          // IO statistics
	Limits      pid.Limits      // Resource limits
	Maps        pid.Maps        // Mapped memory regions of the process
	OomAdj      pid.OomAdj      // OomAdj factor for altering the kernel's badness heuristic
	OomScore    pid.OomScore    // Badness score of the process for OOM selection
	OomScoreAdj pid.OomScoreAdj // New style adjustment factor for altering the kernel's badness heuristic
	Root        pid.Root        // Filesystem root of a process
	Stat        pid.Stat        // Statistics about a process
	Statm       pid.Statm       // Statistics about a process's memory usage
}

ProcessReport bundles information about an individual process.

type SystemInspector

type SystemInspector struct {
	PkgSystem pkg.System // Retrievs information from the packaging system.
}

SystemInspector inspects core properties of the current system.

func (SystemInspector) Inspect

func (self SystemInspector) Inspect() (si SystemReport, err error)

Inspect gathers information about the current system and encodes it to encoder.

type SystemReport

type SystemReport struct {
	HostName     string   // HostName of this machine.
	Architecture pkg.Arch // Host architecture.
	OS           OSReport // Information about the OS.
}

SystemReport bundles system-specific information relevant in reporting and tracking down issues.

Directories

Path Synopsis
cmd
csi
pkg
pid

Jump to

Keyboard shortcuts

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