collectors

package
v0.0.0-...-ff130e0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2015 License: MIT Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VRRPInstanceTable = ".1.3.6.1.4.1.9586.100.5.2.3.1"
	VRRPAddressTable  = ".1.3.6.1.4.1.9586.100.5.2.6.1"
)

Variables

View Source
var (
	// DefaultFreq is the duration between collection intervals if none is
	// specified.
	DefaultFreq = time.Second * 15

	AddTags opentsdb.TagSet

	AddProcessDotNetConfig = func(line string) error {
		return fmt.Errorf("process_dotnet watching not implemented on this platform")
	}
	WatchProcessesDotNet = func() {}
)
View Source
var CPU_FIELDS = []string{
	"user",
	"nice",
	"system",
	"idle",
	"iowait",
	"irq",
	"softirq",
	"steal",
	"guest",
	"guest_nice",
}
View Source
var (
	KeepAliveCommunity = "public"
)

Functions

func AWS

func AWS(accessKey, secretKey, region string)

func Add

func Add(md *opentsdb.MultiDataPoint, name string, value interface{}, t opentsdb.TagSet, rate metadata.RateType, unit metadata.Unit, desc string)

Add appends a new data point with given metric name, value, and tags. Tags may be nil. If tags is nil or does not contain a host key, it will be automatically added. If the value of the host key is the empty string, it will be removed (use this to prevent the normal auto-adding of the host tag).

func AddHAProxyInstance

func AddHAProxyInstance(conf string) error

AddHAProxyInstance adds haproxy instances to be tracked.

func AddProcessConfig

func AddProcessConfig(line string) error

func AddTS

func AddTS(md *opentsdb.MultiDataPoint, name string, ts int64, value interface{}, t opentsdb.TagSet, rate metadata.RateType, unit metadata.Unit, desc string)

AddTS is the same as Add but lets you specify the timestamp

func HAProxy

func HAProxy(user, pwd string)

HAProxy registers an HAProxy collector.

func ICMP

func ICMP(host string)

ICMP registers an ICMP collector a given host.

func InitFake

func InitFake(fake int)

func InitPrograms

func InitPrograms(cpath string)

func IsAlNum

func IsAlNum(s string) bool

IsAlNum returns true if s is alphanumeric.

func IsDigit

func IsDigit(s string) bool

IsDigit returns true if s consists of decimal digits.

func Run

func Run(cs []Collector) chan *opentsdb.DataPoint

Run runs specified collectors. Use nil for all collectors.

func SNMPCisco

func SNMPCisco(community, host string)

SNMPCisco registers a SNMP CISCO collector for the given community and host.

func SNMPIfaces

func SNMPIfaces(community, host string)

SNMPIfaces registers a SNMP Interfaces collector for the given community and host.

func TSys100NStoEpoch

func TSys100NStoEpoch(nsec uint64) int64

func Vsphere

func Vsphere(user, pwd, host string)

Vsphere registers a vSphere collector.

func WatchProcesses

func WatchProcesses()

Types

type Collector

type Collector interface {
	Run(chan<- *opentsdb.DataPoint)
	Name() string
	Init()
}
func Search(s string, e string) []Collector

Search returns all collectors matching the pattern s, and exclude those matching e.

type ElasticIndex

type ElasticIndex struct {
	Primaries ElasticIndexDetails `json:"primaries"`
	Total     ElasticIndexDetails `json:"total"`
}

type ElasticIndexDetails

type ElasticIndexDetails struct {
	Completion struct {
		SizeInBytes float64 `json:"size_in_bytes"`
	} `json:"completion"`
	Docs struct {
		Count   float64 `json:"count"`
		Deleted float64 `json:"deleted"`
	} `json:"docs"`
	Fielddata struct {
		Evictions         float64 `json:"evictions"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"fielddata"`
	FilterCache struct {
		Evictions         float64 `json:"evictions"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"filter_cache"`
	Flush struct {
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"flush"`
	Get struct {
		Current             float64 `json:"current"`
		ExistsTimeInMillis  float64 `json:"exists_time_in_millis"`
		ExistsTotal         float64 `json:"exists_total"`
		MissingTimeInMillis float64 `json:"missing_time_in_millis"`
		MissingTotal        float64 `json:"missing_total"`
		TimeInMillis        float64 `json:"time_in_millis"`
		Total               float64 `json:"total"`
	} `json:"get"`
	IDCache struct {
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
	} `json:"id_cache"`
	Indexing struct {
		DeleteCurrent      float64 `json:"delete_current"`
		DeleteTimeInMillis float64 `json:"delete_time_in_millis"`
		DeleteTotal        float64 `json:"delete_total"`
		IndexCurrent       float64 `json:"index_current"`
		IndexTimeInMillis  float64 `json:"index_time_in_millis"`
		IndexTotal         float64 `json:"index_total"`
	} `json:"indexing"`
	Merges struct {
		Current            float64 `json:"current"`
		CurrentDocs        float64 `json:"current_docs"`
		CurrentSizeInBytes float64 `json:"current_size_in_bytes"`
		Total              float64 `json:"total"`
		TotalDocs          float64 `json:"total_docs"`
		TotalSizeInBytes   float64 `json:"total_size_in_bytes"`
		TotalTimeInMillis  float64 `json:"total_time_in_millis"`
	} `json:"merges"`
	Percolate struct {
		Current           float64 `json:"current"`
		MemorySize        string  `json:"memory_size"`
		MemorySizeInBytes float64 `json:"memory_size_in_bytes"`
		Queries           float64 `json:"queries"`
		TimeInMillis      float64 `json:"time_in_millis"`
		Total             float64 `json:"total"`
	} `json:"percolate"`
	Refresh struct {
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"refresh"`
	Search struct {
		FetchCurrent      float64 `json:"fetch_current"`
		FetchTimeInMillis float64 `json:"fetch_time_in_millis"`
		FetchTotal        float64 `json:"fetch_total"`
		OpenContexts      float64 `json:"open_contexts"`
		QueryCurrent      float64 `json:"query_current"`
		QueryTimeInMillis float64 `json:"query_time_in_millis"`
		QueryTotal        float64 `json:"query_total"`
	} `json:"search"`
	Segments struct {
		Count         float64 `json:"count"`
		MemoryInBytes float64 `json:"memory_in_bytes"`
	} `json:"segments"`
	Store struct {
		SizeInBytes          float64 `json:"size_in_bytes"`
		ThrottleTimeInMillis float64 `json:"throttle_time_in_millis"`
	} `json:"store"`
	Suggest struct {
		Current      float64 `json:"current"`
		TimeInMillis float64 `json:"time_in_millis"`
		Total        float64 `json:"total"`
	} `json:"suggest"`
	Translog struct {
		Operations  float64 `json:"operations"`
		SizeInBytes float64 `json:"size_in_bytes"`
	} `json:"translog"`
	Warmer struct {
		Current           float64 `json:"current"`
		Total             float64 `json:"total"`
		TotalTimeInMillis float64 `json:"total_time_in_millis"`
	} `json:"warmer"`
}

type ElasticIndexHealth

type ElasticIndexHealth struct {
	ActivePrimaryShards float64 `json:"active_primary_shards"`
	ActiveShards        float64 `json:"active_shards"`
	InitializingShards  float64 `json:"initializing_shards"`
	NumberOfReplicas    float64 `json:"number_of_replicas"`
	NumberOfShards      float64 `json:"number_of_shards"`
	RelocatingShards    float64 `json:"relocating_shards"`
	Status              string  `json:"status"`
	UnassignedShards    float64 `json:"unassigned_shards"`
}

type ElasticIndexStats

type ElasticIndexStats struct {
	All    ElasticIndex `json:"_all"`
	Shards struct {
		Failed     float64 `json:"failed"`
		Successful float64 `json:"successful"`
		Total      float64 `json:"total"`
	} `json:"_shards"`
	Indices map[string]ElasticIndex `json:"indices"`
}

type ElasticIndicesHealth

type ElasticIndicesHealth struct {
	ActivePrimaryShards float64                       `json:"active_primary_shards"`
	ActiveShards        float64                       `json:"active_shards"`
	ClusterName         string                        `json:"cluster_name"`
	Indices             map[string]ElasticIndexHealth `json:"indices"`
	InitializingShards  float64                       `json:"initializing_shards"`
	NumberOfDataNodes   float64                       `json:"number_of_data_nodes"`
	NumberOfNodes       float64                       `json:"number_of_nodes"`
	RelocatingShards    float64                       `json:"relocating_shards"`
	Status              string                        `json:"status"`
	TimedOut            bool                          `json:"timed_out"`
	UnassignedShards    float64                       `json:"unassigned_shards"`
}

type HostSystemIdentificationInfo

type HostSystemIdentificationInfo struct {
	IdentiferValue string `xml:"identifierValue"`
	IdentiferType  struct {
		Label   string `xml:"label"`
		Summary string `xml:"summary"`
		Key     string `xml:"key"`
	} `xml:"identifierType"`
}

type IntervalCollector

type IntervalCollector struct {
	F        func() (opentsdb.MultiDataPoint, error)
	Interval time.Duration // defaults to DefaultFreq if unspecified
	Enable   func() bool

	// internal use
	sync.Mutex
	// contains filtered or unexported fields
}

func (*IntervalCollector) Enabled

func (c *IntervalCollector) Enabled() bool

func (*IntervalCollector) Init

func (c *IntervalCollector) Init()

func (*IntervalCollector) Name

func (c *IntervalCollector) Name() string

func (*IntervalCollector) Run

func (c *IntervalCollector) Run(dpchan chan<- *opentsdb.DataPoint)

type MetricMeta

type MetricMeta struct {
	Metric   string
	TagSet   opentsdb.TagSet
	RateType metadata.RateType
	Unit     metadata.Unit
	Desc     string
}

type MetricMetaHAProxy

type MetricMetaHAProxy struct {
	Name   string
	Ignore bool
	MetricMeta
}

MetricMetaHAProxy is a super-structure which adds a friendly Name, as well as an indicator on if a metric is to be ignored.

type PRSummary

type PRSummary struct {
	Changes struct {
		Total float64 `yaml:"total"`
	} `yaml:"changes"`
	Events struct {
		Failure float64 `yaml:"failure"`
		Success float64 `yaml:"success"`
		Total   float64 `yaml:"total"`
	} `yaml:"events"`
	Resources struct {
		Changed         float64 `yaml:"changed"`
		Failed          float64 `yaml:"failed"`
		FailedToRestart float64 `yaml:"failed_to_restart"`
		OutOfSync       float64 `yaml:"out_of_sync"`
		Restarted       float64 `yaml:"restarted"`
		Scheduled       float64 `yaml:"scheduled"`
		Skipped         float64 `yaml:"skipped"`
		Total           float64 `yaml:"total"`
	} `yaml:"resources"`
	Time    map[string]string `yaml:"time"`
	Version struct {
		Config string `yaml:"config"`
		Puppet string `yaml:"puppet"`
	} `yaml:"version"`
}

type Process

type Process struct {
	Pid       string
	Command   string
	Arguments string
}

type ProgramCollector

type ProgramCollector struct {
	Path     string
	Interval time.Duration
}

func (*ProgramCollector) Init

func (c *ProgramCollector) Init()

func (*ProgramCollector) Name

func (c *ProgramCollector) Name() string

func (*ProgramCollector) Run

func (c *ProgramCollector) Run(dpchan chan<- *opentsdb.DataPoint)

type VRRPAddressEntry

type VRRPAddressEntry struct {
	VRRPAddressIndex       int64
	VRRPAddressType        int64
	VRRPAddressValue       string `snmp:"octet"`
	VRRPAddressBroadcast   string `snmp:"octet"`
	VRRPAddressMask        int64
	VRRPAddressScope       int64
	VRRPAddressIfIndex     int64
	VRRPAddressIfName      string
	VRRPAddressIfAlias     string
	VRRPAddressStatus      int64
	VRRPAddressAdvertising int64
}

type VRRPInstanceEntry

type VRRPInstanceEntry struct {
	VInstanceIndex             int64
	VInstanceName              string
	VInstanceVirtualRouterId   int64
	VInstanceState             int64
	VInstanceInitialState      int64
	VInstanceWantedState       int64
	VInstanceBasePriority      int64
	VInstanceEffectivePriority int64
	VInstanceVipsStatus        int64
	VInstancePrimaryInterface  string
	VInstanceTrackPrimaryIf    int64
	VInstanceAdvertisementsInt int64
	VInstancePreempt           int64
	VInstancePreemptDelay      int64
	VInstanceAuthType          int64
	VInstanceLvsSyncDaemon     int64
	VInstanceLvsSyncInterface  string
	VInstanceSyncGroup         string
	VInstanceGarpDelay         int64
	VInstanceSmtpAlert         int64
	VInstanceNotifyExec        int64
	VInstanceScriptMaster      string
	VInstanceScriptBackup      string
	VInstanceScriptFault       string
	VInstanceScriptStop        string
	VInstanceScript            string
}

type WatchedProc

type WatchedProc struct {
	Command   string
	Name      string
	Processes map[string]int
	ArgMatch  *regexp.Regexp
	// contains filtered or unexported fields
}

func NewWatchedProc

func NewWatchedProc(watch string) (*WatchedProc, error)

NewWatchedProc takes a string of the form "command,name,regex".

func (*WatchedProc) Check

func (w *WatchedProc) Check(procs []*Process)

Check finds all matching processes and assigns them a new unique id.

func (*WatchedProc) Remove

func (w *WatchedProc) Remove(pid string)

Jump to

Keyboard shortcuts

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