probes

package
v0.0.0-...-5b448de Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OidSysDesc     = ".1.3.6.1.2.1.1.1.0"
	OidSysObjectId = ".1.3.6.1.2.1.1.2.0"
	OidSysUptime   = ".1.3.6.1.2.1.1.3.0"
	OidSysContact  = ".1.3.6.1.2.1.1.4.0"
	OidSysName     = ".1.3.6.1.2.1.1.5.0"
	OidSysLocation = ".1.3.6.1.2.1.1.6.0"
	OidSysServices = ".1.3.6.1.2.1.1.7.0"

	OidBoardSn = "1.3.6.1.2.1.47.1.1.1.1.11.256"

	// interfaces
	OidIfPhyAddr    = ".1.3.6.1.2.1.2.2.1.6"
	OidIfOperStatus = ".1.3.6.1.2.1.2.2.1.8"
	OidIfDescr      = ".1.3.6.1.2.1.2.2.1.2"
	OidIfMTU        = ".1.3.6.1.2.1.2.2.1.4"
	OidIfSpeed      = ".1.3.6.1.2.1.2.2.1.5"
	OidIfAlias      = ".1.3.6.1.2.1.31.1.1.1.18"

	OidIpForwarding = ".1.3.6.1.2.1.4.1.0"

	OidIpAddr    = ".1.3.6.1.2.1.4.20.1.1"
	OidIpIfindex = ".1.3.6.1.2.1.4.20.1.2"
	OidIpMask    = ".1.3.6.1.2.1.4.20.1.3"

	OidRouteDest    = ".1.3.6.1.2.1.4.21.1.1"
	OidRouteIfindex = ".1.3.6.1.2.1.4.21.1.2"
	OidRouteNexthop = ".1.3.6.1.2.1.4.21.1.7"
	OidRouteType    = ".1.3.6.1.2.1.4.21.1.8"
	OidRouteMask    = ".1.3.6.1.2.1.4.21.1.11"

	OidEnterprises = ".1.3.6.1.4.1"

	OidBaseNumPorts = ".1.3.6.1.2.1.17.1.2.0"
	OidStpRootCost  = ".1.3.6.1.2.1.17.2.6.0"
	OidStpRootPort  = ".1.3.6.1.2.1.17.2.7.0"
	OidFdbAddress   = ".1.3.6.1.2.1.17.4.3.1.1"

	// dot1dBase
	OidTpFdbPort              = ".1.3.6.1.2.1.17.4.3.1.2"
	OidPhysAddress            = ".1.3.6.1.2.1.3.1.1.2"
	OidBasePort               = ".1.3.6.1.2.1.17.1.4.1.1"
	OidBasePortIfindex        = ".1.3.6.1.2.1.17.1.4.1.2"
	OidTpFdb2Port             = ".1.3.6.1.2.1.17.7.1.2.2.1.2"
	OidDot1dBaseBridgeAddress = ".1.3.6.1.2.1.17.1.1.0"

	// qBridgeMIB
	OidDot1qPvid                     = ".1.3.6.1.2.1.17.7.1.4.5.1.1"
	OidDot1qVlanFdbId                = ".1.3.6.1.2.1.17.7.1.4.2.1.3"
	OidDot1qVlanCurrentEgressPorts   = ".1.3.6.1.2.1.17.7.1.4.2.1.4"
	OidDot1qVlanCurrentUntaggedPorts = ".1.3.6.1.2.1.17.7.1.4.2.1.5"

	OidIpNetToMediaPhysAddress = ".1.3.6.1.2.1.4.22.1.2"

	// LLDP
	OidLldpRemChassisIdSubType = ".1.0.8802.1.1.2.1.4.1.1.4"
	OidLldpRemChassisId        = ".1.0.8802.1.1.2.1.4.1.1.5"
	OidLldpRemPortIdSubType    = ".1.0.8802.1.1.2.1.4.1.1.6"
	OidLldpRemPortId           = ".1.0.8802.1.1.2.1.4.1.1.7"
	OidLldpRemManAddrIfId      = ".1.0.8802.1.1.2.1.4.2.1.4"
	OidLldpLocalManAddrIfId    = ".1.0.8802.1.1.2.1.3.8.1.5"
	OidLldpLocalPortId         = ".1.0.8802.1.1.2.1.3.7.1.3"
	OidLldpLocalPortDesc       = ".1.0.8802.1.1.2.1.3.7.1.4"
)
View Source
const (
	UnknownType = iota
	ServersType
	SwitchL2SnmpType
	PrinterType
	SwitchL3Type
	RouteType
	DeviceType
	GateDeviceType
	HostType
	SwitchL2Type
	WirelessRouteType
	Subnetype
)
View Source
const (
	DirectRouteType   = 3
	InDirectRouteType = 4
)
View Source
const (
	TypePortUp = 1 + iota
	TypePortDown
	TypePortLeaf
)
View Source
const (
	DetectConfigFile = "etc/topology_detect.json"
)
View Source
const DockerClientAPIVersion = "1.18"

DockerClientAPIVersion Client API version used

View Source
const (
	Namespace = "Topology_Detect"
)

Variables

View Source
var TopoRelationMap map[string]*topoRelation
View Source
var TopologyDetectChan chan *TopologyDetect

Functions

func InitSnmpConfig

func InitSnmpConfig() error

Types

type Attributes

type Attributes struct {
	PortID      string
	NetworkID   string
	NetworkName string
	TenantID    string
	IPs         string
	VNI         string
}

Attributes neutron attributes

type DockerProbe

type DockerProbe struct {
	sync.RWMutex
	*NetNSProbe
	// contains filtered or unexported fields
}

DockerProbe describes a Docker topology graph that enhance the graph

func NewDockerProbe

func NewDockerProbe(nsProbe *NetNSProbe, dockerURL string) (probe *DockerProbe, _ error)

NewDockerProbe creates a new topology Docker probe

func NewDockerProbeFromConfig

func NewDockerProbeFromConfig(nsProbe *NetNSProbe) (*DockerProbe, error)

NewDockerProbeFromConfig creates a new topology Docker probe based on configuration

func (*DockerProbe) Start

func (probe *DockerProbe) Start()

Start the probe

func (*DockerProbe) Stop

func (probe *DockerProbe) Stop()

Stop the probe

type FabricProbe

type FabricProbe struct {
	graph.DefaultGraphListener
	Graph *graph.Graph
	// contains filtered or unexported fields
}

FabricProbe describes a topology probe

func NewFabricProbe

func NewFabricProbe(g *graph.Graph) *FabricProbe

NewFabricProbe creates a new probe to enhance the graph

func (*FabricProbe) LinkNodes

func (fb *FabricProbe) LinkNodes(parent *graph.Node, child *graph.Node, linkMetadata *graph.Metadata)

LinkNodes link the parent and child (layer 2) if there not linked already

func (*FabricProbe) OnEdgeAdded

func (fb *FabricProbe) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded event

func (*FabricProbe) OnNodeDeleted

func (fb *FabricProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*FabricProbe) Start

func (fb *FabricProbe) Start()

Start the probe

func (*FabricProbe) Stop

func (fb *FabricProbe) Stop()

Stop the probe

type NetLinkProbe

type NetLinkProbe struct {
	sync.RWMutex
	Graph *graph.Graph
	// contains filtered or unexported fields
}

NetLinkProbe describes a list NetLink NameSpace probe to enhance the graph

func NewNetLinkProbe

func NewNetLinkProbe(g *graph.Graph) (*NetLinkProbe, error)

NewNetLinkProbe creates a new netlink probe

func (*NetLinkProbe) Register

func (u *NetLinkProbe) Register(nsPath string, root *graph.Node) (*NetNsNetLinkProbe, error)

Register a new network netlink/namespace probe in the graph

func (*NetLinkProbe) Start

func (u *NetLinkProbe) Start()

Start the probe

func (*NetLinkProbe) Stop

func (u *NetLinkProbe) Stop()

Stop the probe

func (*NetLinkProbe) Unregister

func (u *NetLinkProbe) Unregister(nsPath string) error

Unregister a probe from a network namespace

type NetNSProbe

type NetNSProbe struct {
	sync.RWMutex
	Graph        *graph.Graph
	Root         *graph.Node
	NetLinkProbe *NetLinkProbe
	// contains filtered or unexported fields
}

NetNSProbe describes a netlink probe in a network namespace

func NewNetNSProbe

func NewNetNSProbe(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe, runPath ...string) (*NetNSProbe, error)

NewNetNSProbe creates a new network namespace probe

func NewNetNSProbeFromConfig

func NewNetNSProbeFromConfig(g *graph.Graph, n *graph.Node, nlProbe *NetLinkProbe) (*NetNSProbe, error)

NewNetNSProbeFromConfig creates a new network namespace probe based on configuration

func (*NetNSProbe) Register

func (u *NetNSProbe) Register(path string, extraMetadata graph.Metadata) *graph.Node

Register a new network namespace path

func (*NetNSProbe) Start

func (u *NetNSProbe) Start()

Start the probe

func (*NetNSProbe) Stop

func (u *NetNSProbe) Stop()

Stop the probe

func (*NetNSProbe) Unregister

func (u *NetNSProbe) Unregister(path string)

Unregister a network namespace path

type NetNs

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

NetNs describes a network namespace path associated with a device / inode

func (*NetNs) String

func (ns *NetNs) String() string

type NetNsNetLinkProbe

type NetNsNetLinkProbe struct {
	sync.RWMutex
	Graph  *graph.Graph
	Root   *graph.Node
	NsPath string
	// contains filtered or unexported fields
}

NetNsNetLinkProbe describes a topology probe based on netlink in a network namespace

type NeutronPortNotFound

type NeutronPortNotFound struct {
	MAC string
}

NeutronPortNotFound error

func (NeutronPortNotFound) Error

func (e NeutronPortNotFound) Error() string

type NeutronProbe

type NeutronProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

NeutronProbe describes a topology porbe that map neutron attribues in the graph

func NewNeutronProbe

func NewNeutronProbe(g *graph.Graph, wspool *shttp.WSAsyncClientPool, authURL, username, password, tenantName, regionName, domainName string, availability gophercloud.Availability) (*NeutronProbe, error)

NewNeutronProbe creates a neutron probe that will enhance the graph

func NewNeutronProbeFromConfig

func NewNeutronProbeFromConfig(g *graph.Graph, wspool *shttp.WSAsyncClientPool) (*NeutronProbe, error)

NewNeutronProbeFromConfig creates a new neutron probe based on configuration

func (*NeutronProbe) EnhanceNode

func (mapper *NeutronProbe) EnhanceNode(node *graph.Node)

EnhanceNode enhance the graph node with neutron metadata (Name, MAC, Manager ...)

func (*NeutronProbe) OnNodeAdded

func (mapper *NeutronProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*NeutronProbe) OnNodeUpdated

func (mapper *NeutronProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*NeutronProbe) Start

func (mapper *NeutronProbe) Start()

Start the probe

func (*NeutronProbe) Stop

func (mapper *NeutronProbe) Stop()

Stop the probe

type OpenContrailMdata

type OpenContrailMdata struct {
	UUID    string
	Mac     string
	VRF     string
	LocalIP string
}

OpenContrailMdata metadata

type OpenContrailProbe

type OpenContrailProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

OpenContrailProbe describes a probe that reads OpenContrail database and updates the graph

func NewOpenContrailProbeFromConfig

func NewOpenContrailProbeFromConfig(g *graph.Graph, r *graph.Node) *OpenContrailProbe

NewOpenContrailProbeFromConfig creates a new OpenContrail probe based on configuration

func (*OpenContrailProbe) OnNodeAdded

func (mapper *OpenContrailProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*OpenContrailProbe) OnNodeDeleted

func (mapper *OpenContrailProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*OpenContrailProbe) OnNodeUpdated

func (mapper *OpenContrailProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*OpenContrailProbe) Start

func (mapper *OpenContrailProbe) Start()

Start the probe

func (*OpenContrailProbe) Stop

func (mapper *OpenContrailProbe) Stop()

Stop the probe

type OvsdbProbe

type OvsdbProbe struct {
	sync.Mutex
	Graph  *graph.Graph
	Root   *graph.Node
	OvsMon *ovsdb.OvsMonitor
	// contains filtered or unexported fields
}

OvsdbProbe describes a probe that reads OVS database and updates the graph

func NewOvsdbProbe

func NewOvsdbProbe(g *graph.Graph, n *graph.Node, p string, t string) *OvsdbProbe

NewOvsdbProbe creates a new graph OVS database probe

func NewOvsdbProbeFromConfig

func NewOvsdbProbeFromConfig(g *graph.Graph, n *graph.Node) *OvsdbProbe

NewOvsdbProbeFromConfig creates a new probe based on configuration

func (*OvsdbProbe) OnOvsBridgeAdd

func (o *OvsdbProbe) OnOvsBridgeAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeAdd event

func (*OvsdbProbe) OnOvsBridgeDel

func (o *OvsdbProbe) OnOvsBridgeDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeDel event

func (*OvsdbProbe) OnOvsBridgeUpdate

func (o *OvsdbProbe) OnOvsBridgeUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsBridgeUpdate event

func (*OvsdbProbe) OnOvsInterfaceAdd

func (o *OvsdbProbe) OnOvsInterfaceAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceAdd event

func (*OvsdbProbe) OnOvsInterfaceDel

func (o *OvsdbProbe) OnOvsInterfaceDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceDel event

func (*OvsdbProbe) OnOvsInterfaceUpdate

func (o *OvsdbProbe) OnOvsInterfaceUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsInterfaceUpdate event

func (*OvsdbProbe) OnOvsPortAdd

func (o *OvsdbProbe) OnOvsPortAdd(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortAdd event

func (*OvsdbProbe) OnOvsPortDel

func (o *OvsdbProbe) OnOvsPortDel(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortDel event

func (*OvsdbProbe) OnOvsPortUpdate

func (o *OvsdbProbe) OnOvsPortUpdate(monitor *ovsdb.OvsMonitor, uuid string, row *libovsdb.RowUpdate)

OnOvsPortUpdate event

func (*OvsdbProbe) Start

func (o *OvsdbProbe) Start()

Start the probe

func (*OvsdbProbe) Stop

func (o *OvsdbProbe) Stop()

Stop the probe

type PeeringProbe

type PeeringProbe struct {
	graph.DefaultGraphListener
	// contains filtered or unexported fields
}

PeeringProbe describes graph peering based on MAC address and graph events

func NewPeeringProbe

func NewPeeringProbe(g *graph.Graph) *PeeringProbe

NewPeeringProbe creates a new graph node peering probe

func (*PeeringProbe) OnNodeAdded

func (p *PeeringProbe) OnNodeAdded(n *graph.Node)

OnNodeAdded event

func (*PeeringProbe) OnNodeDeleted

func (p *PeeringProbe) OnNodeDeleted(n *graph.Node)

OnNodeDeleted event

func (*PeeringProbe) OnNodeUpdated

func (p *PeeringProbe) OnNodeUpdated(n *graph.Node)

OnNodeUpdated event

func (*PeeringProbe) Start

func (p *PeeringProbe) Start()

Start the MAC peering resolver probe

func (*PeeringProbe) Stop

func (p *PeeringProbe) Stop()

Stop the probe

type PortMetadata

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

PortMetadata neutron metadata

type SnmpLink struct {
	Name    string
	IfIndex int64
	Type    string
}

type SnmpProbe

type SnmpProbe struct {
	Graph    *graph.Graph
	SnmpRoot *graph.Node
	Root     *graph.Node

	TopologyDetectChan chan *TopologyDetect
	// contains filtered or unexported fields
}

func NewSnmpProbeFromConfig

func NewSnmpProbeFromConfig(g *graph.Graph) *SnmpProbe

func (*SnmpProbe) Run

func (s *SnmpProbe) Run()

func (*SnmpProbe) Start

func (s *SnmpProbe) Start()

func (*SnmpProbe) Stop

func (s *SnmpProbe) Stop()

type TopologyDetect

type TopologyDetect struct {
	IP        string
	Period    int64
	Community string
}

type TopologyDetectClient

type TopologyDetectClient struct {
	shttp.DefaultWSServerEventHandler
	WSServer *shttp.WSServer
	// contains filtered or unexported fields
}

func NewTopologyDetectClient

func NewTopologyDetectClient(w *shttp.WSServer) *TopologyDetectClient

func (*TopologyDetectClient) DetectTopology

func (td *TopologyDetectClient) DetectTopology(dp *TopologyDetect) (string, error)

func (*TopologyDetectClient) DetectTopologyDelete

func (td *TopologyDetectClient) DetectTopologyDelete(dp *TopologyDetect) (string, error)

func (*TopologyDetectClient) OnMessage

func (td *TopologyDetectClient) OnMessage(c *shttp.WSClient, m shttp.WSMessage)

type TopologyDetectReply

type TopologyDetectReply struct {
	TrackingID string
	// contains filtered or unexported fields
}

type TopologyDetectServer

type TopologyDetectServer struct {
	shttp.DefaultWSClientEventHandler
	WSAsyncClientPool *shttp.WSAsyncClientPool
	Graph             *graph.Graph
}

func NewServer

func NewServer(wspool *shttp.WSAsyncClientPool, graph *graph.Graph) *TopologyDetectServer

func (*TopologyDetectServer) OnMessage

func (td *TopologyDetectServer) OnMessage(c *shttp.WSAsyncClient, msg shttp.WSMessage)

Jump to

Keyboard shortcuts

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