Documentation ¶
Index ¶
- Constants
- Variables
- type DeviceMetrics
- func (dm *DeviceMetrics) GetPingStats(ctx context.Context, pinger *ping.Pinger) ([]*kt.JCHF, error)
- func (dm *DeviceMetrics) GetStatusFlows() []*kt.JCHF
- func (dm *DeviceMetrics) Poll(ctx context.Context, server *gosnmp.GoSNMP, pinger *ping.Pinger) ([]*kt.JCHF, error)
- func (dm *DeviceMetrics) ResetPingStats()
- type InterfaceMetrics
- type Poller
Constants ¶
View Source
const ( SNMP_ifHCInOctets = "ifHCInOctets" SNMP_ifHCInUcastPkts = "ifHCInUcastPkts" SNMP_ifHCOutOctets = "ifHCOutOctets" SNMP_ifHCOutUcastPkts = "ifHCOutUcastPkts" SNMP_ifInErrors = "ifInErrors" SNMP_ifOutErrors = "ifOutErrors" SNMP_ifInDiscards = "ifInDiscards" SNMP_ifOutDiscards = "ifOutDiscards" SNMP_ifHCOutMulticastPkts = "ifHCOutMulticastPkts" SNMP_ifHCOutBroadcastPkts = "ifHCOutBroadcastPkts" SNMP_ifHCInMulticastPkts = "ifHCInMulticastPkts" SNMP_ifHCInBroadcastPkts = "ifHCInBroadcastPkts" SNMP_ifInErrorsPercent = "ifInErrorPercent" SNMP_ifOutErrorsPercent = "ifOutErrorPercent" AllDeviceInterface = "device" Uptime = "Uptime" )
SNMP keys used in various places
View Source
const (
STATUS_CHECK_TIME = 60 * time.Second
)
Variables ¶
View Source
var (
MAX_COUNTER_INTS = 250
)
Functions ¶
This section is empty.
Types ¶
type DeviceMetrics ¶
type DeviceMetrics struct {
// contains filtered or unexported fields
}
func NewDeviceMetrics ¶
func NewDeviceMetrics(gconf *kt.SnmpGlobalConfig, conf *kt.SnmpDeviceConfig, metrics *kt.SnmpDeviceMetric, profileMetrics map[string]*kt.Mib, profile *mibs.Profile, log logger.ContextL) *DeviceMetrics
func (*DeviceMetrics) GetPingStats ¶
func (*DeviceMetrics) GetStatusFlows ¶
func (dm *DeviceMetrics) GetStatusFlows() []*kt.JCHF
Return a flow with status of SNMP, reguardless of if the rest of the system is working.
func (*DeviceMetrics) ResetPingStats ¶
func (dm *DeviceMetrics) ResetPingStats()
type InterfaceMetrics ¶
type InterfaceMetrics struct {
// contains filtered or unexported fields
}
func NewInterfaceMetrics ¶
func NewInterfaceMetrics(gconf *kt.SnmpGlobalConfig, conf *kt.SnmpDeviceConfig, metrics *kt.SnmpDeviceMetric, profileMetrics map[string]*kt.Mib, profile *mibs.Profile, tickDurationSec int, log logger.ContextL) *InterfaceMetrics
func (*InterfaceMetrics) DiscardDeltaState ¶
func (im *InterfaceMetrics) DiscardDeltaState()
type Poller ¶
type Poller struct {
// contains filtered or unexported fields
}
func NewPoller ¶
func NewPoller(server *gosnmp.GoSNMP, gconf *kt.SnmpGlobalConfig, conf *kt.SnmpDeviceConfig, jchfChan chan []*kt.JCHF, metrics *kt.SnmpDeviceMetric, profile *mibs.Profile, log logger.ContextL) *Poller
func NewPollerForExtention ¶
func NewPollerForExtention(gconf *kt.SnmpGlobalConfig, conf *kt.SnmpDeviceConfig, jchfChan chan []*kt.JCHF, metrics *kt.SnmpDeviceMetric, profile *mibs.Profile, log logger.ContextL) *Poller
func NewPollerForPing ¶
func NewPollerForPing(gconf *kt.SnmpGlobalConfig, conf *kt.SnmpDeviceConfig, jchfChan chan []*kt.JCHF, metrics *kt.SnmpDeviceMetric, profile *mibs.Profile, log logger.ContextL) *Poller
func (*Poller) Poll ¶
PollSNMPCounter polls SNMP for counter statistics like # bytes and packets transferred.
func (*Poller) StartExtensionOnlyLoop ¶
Simpler loop which only runs on ext data, no actual snmp polling.
func (*Poller) StartPingOnlyLoop ¶
Simpler loop which only runs on ping data, no actual snmp polling.
Click to show internal directories.
Click to hide internal directories.