readers

package
v3.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2016 License: MIT Imports: 22 Imported by: 10

Documentation

Overview

Package readers provides objects that gathers resource data from a host.

+build linux

+build linux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, constructor func() IReader)

Register makes any reader constructor available by name.

Types

type CpuInfo

type CpuInfo struct {
	Data map[string][]gopsutil_cpu.InfoStat
}

CpuInfo is a reader that scrapes cpu info data. Data source: https://github.com/shirou/gopsutil/tree/master/cpu

func (*CpuInfo) Run

func (c *CpuInfo) Run() error

func (*CpuInfo) ToJson

func (c *CpuInfo) ToJson() ([]byte, error)

type CpuStat

type CpuStat struct {
	Data map[string][]gopsutil_cpu.TimesStat
}

CpuStat is a reader that scrapes cpu stat data. Data source: https://github.com/shirou/gopsutil/tree/master/cpu

func NewCpuStat

func NewCpuStat() *CpuStat

NewCpuStat is CpuStat constructor.

func (*CpuStat) Run

func (c *CpuStat) Run() error

Run gathers gopsutil_cpu.CPUTimes data.

func (*CpuStat) ToJson

func (c *CpuStat) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type DMI added in v1.1.6

type DMI struct {
	Data map[string]map[string]string
}

func (*DMI) Run added in v1.1.6

func (d *DMI) Run() error

func (*DMI) ToJson added in v1.1.6

func (d *DMI) ToJson() ([]byte, error)

type Df

type Df struct {
	Data    map[string]map[string]interface{}
	FSPaths string
}

Df is a reader that scrapes disk free data and presents it in the form similar to `df`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func (*Df) Run

func (d *Df) Run() error

Run gathers df information.

func (*Df) ToJson

func (d *Df) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type DiskIO

type DiskIO struct {
	Data map[string]gopsutil_disk.IOCountersStat
}

DiskIO is a reader that gathers disk io data. Data source: https://github.com/shirou/gopsutil/tree/master/disk

func (*DiskIO) Run

func (d *DiskIO) Run() error

Run gathers disk IO information from gopsutil.

func (*DiskIO) ToJson

func (d *DiskIO) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type DiskPartitions

type DiskPartitions struct {
	Data map[string]map[string]gopsutil_disk.PartitionStat
}

DiskPartitions is a reader that gathers partition data. Data source: https://github.com/shirou/gopsutil/tree/master/disk

func (*DiskPartitions) Run

func (d *DiskPartitions) Run() error

Run gathers partition information from gopsutil.

func (*DiskPartitions) ToJson

func (d *DiskPartitions) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Du

type Du struct {
	Data    map[string]map[string]interface{}
	FSPaths string
}

Df is a reader that scrapes disk usage data and presents it in the form similar to `du`. Data sources: * https://github.com/cloudfoundry/gosigar/tree/master * https://github.com/shirou/gopsutil/tree/master/disk

func (*Du) Run

func (d *Du) Run() error

Run gathers du information.

func (*Du) ToJson

func (d *Du) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Free

type Free struct {
	Data map[string]map[string]interface{}
}

Free is a reader that scrapes swapory data and presents it in the form similar to `free`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func (*Free) Run

func (m *Free) Run() error

Run gathers free data from gosigar.

func (*Free) ToJson

func (m *Free) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type HostInfo

type HostInfo struct {
	Data map[string]interface{}
}

func (*HostInfo) Run

func (h *HostInfo) Run() error

Run gathers host information from gopsutil.

func (*HostInfo) ToJson

func (h *HostInfo) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type HostUsers

type HostUsers struct {
	Data map[string]gopsutil_host.UserStat
}

func (*HostUsers) Run

func (h *HostUsers) Run() error

Run gathers user information from gopsutil.

func (*HostUsers) ToJson

func (h *HostUsers) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type IOStat

type IOStat struct {
	Data map[string]map[string]float64
}

func (*IOStat) Run

func (ios *IOStat) Run() error

Run gathers load average information from gosigar.

func (*IOStat) ToJson

func (ios *IOStat) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type IReader

type IReader interface {
	Run() error
	ToJson() ([]byte, error)
}

IReader is generic interface for all readers.

func NewCpuInfo

func NewCpuInfo() IReader

NewCpuInfo is CpuInfo constructor.

func NewDMI added in v1.1.6

func NewDMI() IReader

func NewDf

func NewDf() IReader

NewDf is Df constructor.

func NewDiskIO

func NewDiskIO() IReader

NewDiskIO is DiskIO constructor.

func NewDiskPartitions

func NewDiskPartitions() IReader

NewDiskPartitions is DiskPartitions constructor.

func NewDu

func NewDu() IReader

func NewFree

func NewFree() IReader

func NewGoStruct

func NewGoStruct(name string) (IReader, error)

NewGoStruct instantiates IReader

func NewGoStructByConfig

func NewGoStructByConfig(config resourced_config.Config) (IReader, error)

NewGoStructByConfig instantiates IReader given Config struct

func NewHostInfo

func NewHostInfo() IReader

func NewHostUsers

func NewHostUsers() IReader

func NewIOStat

func NewIOStat() IReader

func NewLoadAvg

func NewLoadAvg() IReader

func NewNagiosPlugin

func NewNagiosPlugin() IReader

func NewNetIO

func NewNetIO() IReader

func NewNetInterfaces

func NewNetInterfaces() IReader

func NewPs

func NewPs() IReader

func NewShell

func NewShell() IReader

func NewUname

func NewUname() IReader

func NewUptime

func NewUptime() IReader

type LoadAvg

type LoadAvg struct {
	Data map[string]interface{}
}

func (*LoadAvg) Run

func (l *LoadAvg) Run() error

Run gathers load average information from gosigar.

func (*LoadAvg) ToJson

func (l *LoadAvg) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type NagiosPlugin

type NagiosPlugin struct {
	Shell
}

func (*NagiosPlugin) Run

func (s *NagiosPlugin) Run() error

Run NagiosPlugins out external program and store the output on c.Data.

func (*NagiosPlugin) ToJson

func (s *NagiosPlugin) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type NetIO

type NetIO struct {
	Data map[string]gopsutil_net.IOCountersStat
}

func (*NetIO) Run

func (n *NetIO) Run() error

Run gathers network IO data from gopsutil.

func (*NetIO) ToJson

func (n *NetIO) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type NetInterfaces

type NetInterfaces struct {
	Data map[string]gopsutil_net.InterfaceStat
}

func (*NetInterfaces) Run

func (n *NetInterfaces) Run() error

Run gathers network interfaces data from gopsutil.

func (*NetInterfaces) ToJson

func (n *NetInterfaces) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Ps

type Ps struct {
	Data       map[string]map[string]interface{}
	NameFilter []interface{}
}

func (*Ps) Run

func (p *Ps) Run() error

Run gathers ps information from gosigar.

func (*Ps) ToJson

func (p *Ps) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Shell

type Shell struct {
	Command string
	Data    map[string]interface{}
}

func (*Shell) Run

func (s *Shell) Run() error

Run shells out external program and store the output on c.Data.

func (*Shell) ToJson

func (s *Shell) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Uname

type Uname struct {
	Data map[string]interface{}
}

Uname is a reader that returns uname data.

func (*Uname) Run

func (u *Uname) Run() error

Run gathers uname information from syscall.

func (*Uname) ToJson

func (u *Uname) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

type Uptime

type Uptime struct {
	Data map[string]interface{}
}

Uptime is a reader that presents its data in the form similar to `uptime`. Data source: https://github.com/cloudfoundry/gosigar/tree/master

func (*Uptime) Run

func (u *Uptime) Run() error

Run gathers uptime information from gosigar.

func (*Uptime) ToJson

func (u *Uptime) ToJson() ([]byte, error)

ToJson serialize Data field to JSON.

Directories

Path Synopsis
Package docker gathers Docker related data from a host.
Package docker gathers Docker related data from a host.
Package haproxy gathers haproxy related data from a host.
Package haproxy gathers haproxy related data from a host.
Package mcrouter gathers mcrouter related data from a host.
Package mcrouter gathers mcrouter related data from a host.
Package memcache gathers memcache related data from a host.
Package memcache gathers memcache related data from a host.
Package mysql gathers MySQL related data from a host.
Package mysql gathers MySQL related data from a host.
Package redis gathers Redis related data from a host.
Package redis gathers Redis related data from a host.

Jump to

Keyboard shortcuts

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