ifmibpoller

package module
v0.0.0-...-fc45f82 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SNMPv2_TC_TruthValue_True  = 1
	SNMPv2_TC_TruthValue_False = 2

	OID_ifMIB_ifXEntry = ".1.3.6.1.2.1.31.1.1.1"

	// State
	OID_ifXEntry_ifName             = ".1.3.6.1.2.1.31.1.1.1.1"
	OID_ifXEntry_ifHighSpeed        = ".1.3.6.1.2.1.31.1.1.1.15"
	OID_ifXEntry_ifConnectorPresent = ".1.3.6.1.2.1.31.1.1.1.17"
	OID_ifXEntry_ifAlias            = ".1.3.6.1.2.1.31.1.1.1.18"

	// Measurement
	OID_ifXEntry_ifHCInOctets         = ".1.3.6.1.2.1.31.1.1.1.6"
	OID_ifXEntry_ifHCInUcastPkts      = ".1.3.6.1.2.1.31.1.1.1.7"
	OID_ifXEntry_ifHCInMulticastPkts  = ".1.3.6.1.2.1.31.1.1.1.8"
	OID_ifXEntry_ifHCInBroadcastPkts  = ".1.3.6.1.2.1.31.1.1.1.9"
	OID_ifXEntry_ifHCOutOctets        = ".1.3.6.1.2.1.31.1.1.1.10"
	OID_ifXEntry_ifHCOutUcastPkts     = ".1.3.6.1.2.1.31.1.1.1.11"
	OID_ifXEntry_ifHCOutMulticastPkts = ".1.3.6.1.2.1.31.1.1.1.12"
	OID_ifXEntry_ifHCOutBroadcastPkts = ".1.3.6.1.2.1.31.1.1.1.13"
)
View Source
const (
	DefaultSNMPPort = 161
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(name string) *Agent

func (*Agent) Configure

func (a *Agent) Configure(config *AgentConfig) bool

func (*Agent) RegisterSampleListener

func (a *Agent) RegisterSampleListener(ch chan<- *IfStats)

func (*Agent) Start

func (a *Agent) Start() bool

func (*Agent) Stop

func (a *Agent) Stop() bool

func (*Agent) UnregisterSampleListener

func (a *Agent) UnregisterSampleListener(ch chan<- *IfStats)

type AgentConfig

type AgentConfig struct {
	Address   string
	Community string
	Refresh   time.Duration
}

type IfMibCount

type IfMibCount struct {
	InOctets         []uint64
	InUcastPkts      []uint64
	InMulticastPkts  []uint64
	InBroadcastPkts  []uint64
	OutOctets        []uint64
	OutUcastPkts     []uint64
	OutMulticastPkts []uint64
	OutBroadcastPkts []uint64
}

func (*IfMibCount) Equal

func (x *IfMibCount) Equal(y *IfMibCount) bool

type IfMibState

type IfMibState struct {
	Index     []uint64
	Name      []string
	Alias     []string
	Present   []bool
	Linkspeed []uint64
}

func (*IfMibState) Equal

func (x *IfMibState) Equal(y *IfMibState) bool

type IfStats

type IfStats struct {
	Timestamp time.Time     `json:"-"`
	Duration  time.Duration `json:"-"`

	State IfMibState
	Count IfMibCount
}

func (*IfStats) Walk

func (st *IfStats) Walk(snmp *gosnmp.GoSNMP) error

Directories

Path Synopsis
cmd
ifmibpoller command

Jump to

Keyboard shortcuts

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