-
Notifications
You must be signed in to change notification settings - Fork 183
/
protocols.go
56 lines (41 loc) · 1.9 KB
/
protocols.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// +build linux
package protocols
//go:generate collectd-template-to-go protocols.tmpl
import (
"github.com/signalfx/signalfx-agent/internal/core/config"
"github.com/signalfx/signalfx-agent/internal/monitors"
"github.com/signalfx/signalfx-agent/internal/monitors/collectd"
)
const monitorType = "collectd/protocols"
// MONITOR(collectd/protocols): Gathers metrics about the network protocol
// stacks running on the system by using the [collectd protocols
// plugin](https://collectd.org/wiki/index.php/Plugin:Protocols).
//
// See the [integrations
// doc](https://github.com/signalfx/integrations/tree/master/collectd-protocols)
// for more information.
// CUMULATIVE(protocol_counter.ActiveOpens): The number of times TCP connections transitioned from the CLOSED state to the SYN-SENT state.
// CUMULATIVE(protocol_counter.CurrEstab): The number of TCP connections currently in either ESTABLISHED or CLOSE-WAIT state.
// CUMULATIVE(protocol_counter.DelayedACKs): The number of acknowledgements delayed by TCP Delayed Acknowledgement
// CUMULATIVE(protocol_counter.InDestUnreachs): The number of ICMP Destination Unreachable messages received
// CUMULATIVE(protocol_counter.PassiveOpens): The number of times that a server opened a connection, due to receiving a TCP SYN packet.
// CUMULATIVE(protocol_counter.RetransSegs): The total number of segments retransmitted
func init() {
monitors.Register(monitorType, func() interface{} {
return &Monitor{
MonitorCore: *collectd.NewMonitorCore(CollectdTemplate),
}
}, &Config{})
}
// Config is the monitor-specific config with the generic config embedded
type Config struct {
config.MonitorConfig `singleInstance:"true"`
}
// Monitor is the main type that represents the monitor
type Monitor struct {
collectd.MonitorCore
}
// Configure configures and runs the plugin in collectd
func (m *Monitor) Configure(conf *Config) error {
return m.SetConfigurationAndRun(conf)
}