nettygo

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

README

GO Netty SNMP

License

Network Device information Discovery via SNMP

Netty_snmp is a flexible,powerful,high performance tool for network device information collection. It will recognize network device's manufacture and platform(netmiko driver) automatically through SNMP SysObjectId and collect a lot of network basic information with friendly output format and exceptions traceback.

Inspirations of SNMP and why not command line tools(CLI):

CLI output is un-structure data, we need use regex/textfsm liked tools to extract the information from network device output. It's very painful to maintain the string-based regex code and very hard to extend. SNMP is fast, stable to get and all data is structured which is easy to handle by code, also it's much easier to maintain the codebase, some of items is generic for all network manufacturers, such as interface, hostname, lldp neighbors. One time coding and support all vendors, fancy, right? So, personally use snmp to collect basic information of network device is a better choice than CLI.

Installation

go get github.com/netty-community/netty-go

// Examples

See examples usage


Main Support Items

  • Hostname: the hostname of network device

  • System Description: the textual information of the system: include model name, software version, hardware version and etc.

  • Uptime: network device uptime

  • ChassisID: the mac address of chassis, the unique identifier of chassis

  • Interfaces: interface full information

    • Interface Index
    • Interface Name
    • Interface Description
    • Interface Mtu
    • Interface Speed: physical speed
    • Interface High Speed: negotiation speed
    • Interface Type
    • Interface Mac Address
    • Interface Admin status
    • Interface Operational Status
    • Interface IP Addresses: (L3 Interface)
    • Interface Port Mode: access/trunk/hybrid ...
  • LLDP Neighbors: lldp information will local and remote connection info

    • Local Chassis Id: the unique identifier mac address of chassis
    • Local Hostname: the hostname of local device
    • Local Interface Name
    • Local Interface Description
    • Remote Chassis Id: the unique identifier mac address of lldp neighbor chassis
    • Remote Hostname: the hostname of lldp neighbor
    • Remote Interface Name: the interface name of lldp neighbor
    • Remote interface Description: the interface description of lldp neighbor
  • Entities

    • Entity Physical Description: the mode information of entity
    • Entity Physical Name: the name of entity
    • Entity Software revision: software version
    • Entity Serial Number: the serial number of entity
  • VLANS

    • support vlan collection
    • enrich vlan info
  • Prefixes

    • support ip prefix collection
    • enrich prefix info
  • ARP Table

  • Mac Address Table


waiting for implement

  • StackWise
  • Routing table

Main support manufactures

well tested
  • Cisco
  • Huawei
  • Aruba
basic tested
  • H3C
  • Ruijie
  • Arista
  • Fortinet
  • PaloAlto
  • Juniper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDeviceModel

func GetDeviceModel(sysObjId string) *dt.DeviceModel

func GetDeviceModelFromManufacturer

func GetDeviceModelFromManufacturer(mf manufacturer.Manufacturer, sysObjId string) *dt.DeviceModel

Types

type Dispatcher

type Dispatcher struct {
	Targets []string
	Config  factory.BaseSnmpConfig
}

func NewDispatcher

func NewDispatcher(targets []string, config factory.BaseSnmpConfig) *Dispatcher

func (*Dispatcher) Dispatch

func (d *Dispatcher) Dispatch() []*factory.DispatchResponse

func (*Dispatcher) DispatchApScan

func (d *Dispatcher) DispatchApScan() []*factory.DispatchApScanResponse

func (*Dispatcher) DispatchBasic

func (d *Dispatcher) DispatchBasic() []*factory.DispatchBasicResponse

func (*Dispatcher) IcmpReachable

func (d *Dispatcher) IcmpReachable(address string) bool

linux need privilege for udp

func (*Dispatcher) Session

func (d *Dispatcher) Session(config *factory.SnmpConfig) (*gosnmp.GoSNMP, error)

func (*Dispatcher) SnmpReachable

func (d *Dispatcher) SnmpReachable(session *gosnmp.GoSNMP) bool

func (*Dispatcher) SshReachable

func (d *Dispatcher) SshReachable(address string) bool

func (*Dispatcher) SysObjectID

func (d *Dispatcher) SysObjectID(session *gosnmp.GoSNMP) string

Directories

Path Synopsis
examples
cliexample command

Jump to

Keyboard shortcuts

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