clients

package
v0.0.0-...-b63442e Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IfSpeed       = "ifSpeed"
	IfInErrors    = "ifInErrors"
	IfOutErrors   = "ifOutErrors"
	IfInDiscards  = "ifInDiscards"
	IfOutDiscards = "ifOutDiscards"

	IfInOctets    = "ifInOctets"
	IfOutOctets   = "ifOutOctets"
	IfHCInOctets  = "ifHCInOctets"
	IfHCOutOctets = "ifHCOutOctets"

	BytesIn     = "bytesIn"
	BytesOut    = "bytesOut"
	BytesInX64  = "bytesInX64"
	BytesOutX64 = "bytesOutX64"

	BytesPerSecondIn  = "bytesPerSecondIn"
	BytesPerSecondOut = "bytesPerSecondOut"
)

Variables

View Source
var AvailableMetrics = map[string]*SnmpMetric{
	IfSpeed: {Key: "ifSpeed", Mib: "ifSpeed", Oid: "1.3.6.1.2.1.2.2.1.5", Name: "Interface Speed",
		Description: "An estimate of the interface's current bandwidth in bits per second."},
	IfInErrors: {Key: "ifInErrors", Mib: "ifInErrors", Oid: "1.3.6.1.2.1.2.2.1.14", Name: "Inbound Errors",
		Description: "For packet-oriented interfaces, the number of inbound packets that contained errors" +
			" preventing them from being deliverable to a higher-layer protocol. For character- oriented or fixed-length interfaces," +
			" the number of inbound transmission units that contained errors preventing them from being deliverable to a higher-layer protocol."},
	IfOutErrors: {Key: "ifOutErrors", Mib: "ifOutErrors", Oid: "1.3.6.1.2.1.2.2.1.20", Name: "Outbound Errors",
		Description: "For packet-oriented interfaces, the number of outbound packets that could not be transmitted because of errors." +
			" For character-oriented or fixed-length interfaces, the number of outbound transmission units that could not be transmitted" +
			" because of errors."},
	IfInDiscards: {Key: "ifInDiscards", Mib: "ifInDiscards", Oid: "1.3.6.1.2.1.2.2.1.13", Name: "Inbound Discards",
		Description: "The number of inbound packets which were chosen to be discarded" +
			" even though no errors had been detected to prevent their being deliverable to a higher-layer protocol."},
	IfOutDiscards: {Key: "ifOutDiscards", Mib: "ifOutDiscards", Oid: "1.3.6.1.2.1.2.2.1.19", Name: "Outbound Discards",
		Description: "The number of outbound packets which were chosen to be discarded" +
			" even though no errors had been detected to prevent their being transmitted."},

	IfInOctets: {Key: "bytesIn", Mib: "ifInOctets", Oid: "1.3.6.1.2.1.2.2.1.10", Name: "Inbound Bytes",
		Description: "The total number of octets received on the interface, including framing characters."},
	IfOutOctets: {Key: "bytesOut", Mib: "ifOutOctets", Oid: "1.3.6.1.2.1.2.2.1.16", Name: "Outbound Bytes",
		Description: "The total number of octets transmitted out of the interface, including framing characters."},
	IfHCInOctets: {Key: "bytesInX64", Mib: "ifHCInOctets", Oid: "1.3.6.1.2.1.31.1.1.1.6", Name: "Inbound Bytes 64-bit",
		Description: "The total number of octets received on the interface, including framing characters." +
			"This object is a 64-bit version of ifInOctets."},
	IfHCOutOctets: {Key: "bytesOutX64", Mib: "ifHCOutOctets", Oid: "1.3.6.1.2.1.31.1.1.1.10", Name: "Outbound Bytes 64-bit",
		Description: "The total number of octets transmitted out of the interface, including framing characters. " +
			"This object is a 64-bit version of ifOutOctets."},
}
View Source
var NonMibMetrics = map[string]*SnmpMetric{
	BytesPerSecondIn: {Key: "bytesPerSecondIn", Mib: "-", Name: "Inbound Bytes Per Second",
		Description: "The number of inbound bytes per second for the interface"},
	BytesPerSecondOut: {Key: "bytesPerSecondOut", Mib: "-", Name: "Outbound Bytes Per Second",
		Description: "The number of outbound bytes per second for the interface"},
}

Functions

This section is empty.

Types

type Device

type Device struct {
	Name      string
	IP        string
	Community string
	LastOK    int64
}

type Interface

type Interface struct {
	Name   string
	Device string
	Index  int
	Status int
}

type Monitoring

type Monitoring struct {
	Name   string
	IP     string
	Device string
	LastOK int64
}

type NediClient

type NediClient struct {
	Server string
}

func (*NediClient) GetDeviceInterfaces

func (client *NediClient) GetDeviceInterfaces(device string) ([]Interface, error)

func (*NediClient) GetDevices

func (client *NediClient) GetDevices() ([]Device, error)

func (*NediClient) Init

func (client *NediClient) Init(server string) error

type SnmpClient

type SnmpClient struct {
}

func (*SnmpClient) GetSnmpData

func (client *SnmpClient) GetSnmpData(mibs []string, target string, secData *utils.SecurityData) ([]SnmpMetricData, error)

retrieve all mibs for one target IP

type SnmpMetric

type SnmpMetric struct {
	Key         string
	Mib         string
	Oid         string
	Name        string
	UnitType    SnmpUnitType
	Description string
}

type SnmpMetricData

type SnmpMetricData struct {
	SnmpMetric SnmpMetric
	Values     []SnmpValue
}

type SnmpUnitType

type SnmpUnitType string

type SnmpValue

type SnmpValue struct {
	Name  string
	Value int64
}

Jump to

Keyboard shortcuts

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