Documentation ¶
Index ¶
- Constants
- Variables
- func AWS(accessKey, secretKey, region string)
- func Add(md *opentsdb.MultiDataPoint, name string, value interface{}, t opentsdb.TagSet, ...)
- func AddHAProxyInstance(conf string) error
- func AddProcessConfig(line string) error
- func AddTS(md *opentsdb.MultiDataPoint, name string, ts int64, value interface{}, ...)
- func HAProxy(user, pwd string)
- func ICMP(host string)
- func InitFake(fake int)
- func InitPrograms(cpath string)
- func IsAlNum(s string) bool
- func IsDigit(s string) bool
- func Run(cs []Collector) chan *opentsdb.DataPoint
- func SNMPCisco(community, host string)
- func SNMPIfaces(community, host string)
- func TSys100NStoEpoch(nsec uint64) int64
- func Vsphere(user, pwd, host string)
- func WatchProcesses()
- type Collector
- type ElasticIndex
- type ElasticIndexDetails
- type ElasticIndexHealth
- type ElasticIndexStats
- type ElasticIndicesHealth
- type HostSystemIdentificationInfo
- type IntervalCollector
- type MetricMeta
- type MetricMetaHAProxy
- type PRSummary
- type Process
- type ProgramCollector
- type VRRPAddressEntry
- type VRRPInstanceEntry
- type WatchedProc
Constants ¶
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 ¶
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() {} )
var CPU_FIELDS = []string{
"user",
"nice",
"system",
"idle",
"iowait",
"irq",
"softirq",
"steal",
"guest",
"guest_nice",
}
var (
KeepAliveCommunity = "public"
)
Functions ¶
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 ¶
AddHAProxyInstance adds haproxy instances to be tracked.
func AddProcessConfig ¶
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 InitPrograms ¶
func InitPrograms(cpath string)
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 WatchProcesses ¶
func WatchProcesses()
Types ¶
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 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 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 ProgramCollector ¶
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)
Source Files ¶
- apache_mod_info_linux.go
- aws.go
- cassandra_unix.go
- chef_linux.go
- collectors.go
- conntrack_linux.go
- dell_hw.go
- disk_linux.go
- elasticsearch.go
- exim_linux.go
- fake.go
- haproxy_unix.go
- hbase_unix.go
- icmp.go
- ifstat_linux.go
- interval.go
- keepalived_linux.go
- memcached_unix.go
- netbackup.go
- ntp_unix.go
- opentsdb.go
- processes_linux.go
- procstats_linux.go
- program.go
- program_linux.go
- puppet_linux.go
- railgun_linux.go
- redis_unix.go
- riak.go
- snmp.go
- snmp_cisco.go
- snmp_ifaces.go
- vsphere.go
- yum_update_linux.go