svipul

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: LGPL-2.1 Imports: 6 Imported by: 0

README

Svipul
======

Svipul is the beginning of a new framework for polling network devices.

While it works, if you don't know me personally, you PROBABLY don't want to
test this yet. Name is likely to change too.

It is currently able to:

- Poll a network device based on orders from a RabbitMQ queue
- Scale horizontally I suppose?
- Do "entity maps" to map names to indices in a table, e.g. map
  ifName->index, cache the result and do requests based on that .
- Report back using Skogul ( https://github.com/telenornms/skogul )

The basic goal is to have a massively scalable solution that can be
dynamically configured at run-time, and ultimately handle ALL
information-requests to network devices, be it SNMP or GNMI or god knows
what.

The first iteration will focus on fundamentals and SNMP.

Basic design
------------

Design is subject to change, massively.

.. image:: docs/pollng.drawio.png

The basic concept is to have independent pollers that listen for tasks on a
queue. A locking service is needed too, but not (currently) shown. The
locking service is to prevent independent pollers from working on the same
device.

Each poller then uses Skogul to report back. This initial implementation
has Skogul embeded, thus an external one is not strictly speaking needed.

Results are streamed to a pub/sub-style exchange on RabbitMQ, and multiple
listeners can wait for it.

Each component is meant to be largely independent, and the design is meant
as a reference design where one need not implement all of it for it to be
useful. E.g.: You can get away with a simple poller, a shell script for
scheduler and skogul writing to influxDB directly if need be, using what
already exists today.

Name
----

Svipul is a Valkyrie. Valkyries are cool. Working name until recently was
tpoll, but it just changed.

Documentation

Overview

Package svipul is an advanced library and toolset for polling large amounts of network devices, initially with SNMP, but conceptually with any relevant protocol.

It works, or will work, through a central work-distribution database/api, and multiple, largely independent pollers. The results are reported using Skogul.

Index

Constants

This section is empty.

Variables

View Source
var Config conf = conf{
	DefaultCommunity: "public",
	Debug:            false,
	MibPaths:         []string{"mibs/modules"},
	MaxMapAge:        time.Second * 3600,
	MibModules: []string{
		"ADSL-LINE-MIB",
		"ADSL-TC-MIB",
		"ALARM-MIB",
		"ATM-FORUM-MIB",
		"ATM-MIB",
		"ATM-TC-MIB",
		"BGP4-MIB",
		"BRIDGE-MIB",
		"DIFFSERV-DSCP-TC",
		"DIFFSERV-MIB",
		"DISMAN-PING-MIB",
		"DISMAN-TRACEROUTE-MIB",
		"DLSW-MIB",
		"DRAFT-MSDP-MIB",
		"DS1-MIB",
		"DS3-MIB",
		"ENTITY-MIB",
		"ENTITY-STATE-MIB",
		"ENTITY-STATE-TC-MIB",
		"ESO-CONSORTIUM-MIB",
		"EtherLike-MIB",
		"ETHER-WIS",
		"FRAME-RELAY-DTE-MIB",
		"FR-MFR-MIB",
		"GGSN-MIB",
		"GMPLS-LSR-STD-MIB",
		"GMPLS-TC-STD-MIB",
		"GMPLS-TE-STD-MIB",
		"HCNUM-TC",
		"HOST-RESOURCES-MIB",
		"HOST-RESOURCES-TYPES",
		"IANA-ADDRESS-FAMILY-NUMBERS-MIB",
		"IANA-GMPLS-TC-MIB",
		"IANAifType-MIB",
		"IANA-RTPROTO-MIB",
		"IEEE8021-CFM-MIB",
		"IEEE8021-CFM-V2-MIB",
		"IEEE8021-PAE-MIB",
		"IEEE8021-TC-MIB",
		"IEEE8023-LAG-MIB",
		"IF-MIB",
		"IGMP-STD-MIB",
		"INET-ADDRESS-MIB",
		"INTEGRATED-SERVICES-MIB",
		"IP-FORWARD-MIB",
		"IP-MIB",
		"IPMROUTE-MIB",
		"IPMROUTE-STD-MIB",
		"IPV6-FLOW-LABEL-MIB",
		"IPV6-MIB",
		"IPV6-TC",
		"ISIS-MIB",
		"LLDP-MIB",
		"MPLS-L3VPN-STD-MIB",
		"MPLS-LSR-STD-MIB",
		"MPLS-TC-STD-MIB",
		"MPLS-TE-STD-MIB",
		"MPLS-VPN-MIB",
		"OPT-IF-MIB",
		"OSPF-MIB",
		"OSPF-TRAP-MIB",
		"OSPFV3-MIB",
		"P-BRIDGE-MIB",
		"PerfHist-TC-MIB",
		"PIM-MIB",
		"POWER-ETHERNET-MIB",
		"PPP-LCP-MIB",
		"PTOPO-MIB",
		"Q-BRIDGE-MIB",
		"RADIUS-ACC-CLIENT-MIB",
		"RADIUS-AUTH-CLIENT-MIB",
		"RMON2-MIB",
		"RMON-MIB",
		"RSTP-MIB",
		"SNA-SDLC-MIB",
		"SNMP-COMMUNITY-MIB",
		"SNMP-FRAMEWORK-MIB",
		"SNMP-MPD-MIB",
		"SNMP-NOTIFICATION-MIB",
		"SNMP-PROXY-MIB",
		"SNMP-TARGET-MIB",
		"SNMP-USER-BASED-SM-MIB",
		"SNMPv2-MIB",
		"SNMPv2-SMI",
		"SNMPv2-TC",
		"SNMPv2-TM",
		"SNMP-VIEW-BASED-ACM-MIB",
		"SONET-MIB",
		"SYSAPPL-MIB",
		"TCP-MIB",
		"TOKEN-RING-RMON-MIB",
		"TRANSPORT-ADDRESS-MIB",
		"TUNNEL-MIB",
		"UDP-MIB",
		"VPN-TC-STD-MIB",
		"VRRP-MIB",
		"VRRPV3-MIB"},
}

Functions

func Debug

func Debug(v ...any)

func Debugf

func Debugf(format string, v ...any)

func Debugln

func Debugln(v ...any)

func Fatal

func Fatal(v ...any)

func Fatalf

func Fatalf(format string, v ...any)

func Fatalln

func Fatalln(v ...any)

func Init

func Init()

func Log

func Log(v ...any)

func Logf

func Logf(format string, v ...any)

func Logln

func Logln(v ...any)

Types

type Node

type Node struct {
	Key       string // original input key, kept for posterity
	Name      string // sysName
	Numeric   string // .1.3.6.1.2.1.1.1 // root
	Qualified string // .1.3.6.1.2.1.1.1.0 // "full", with index
	Format    string // 255a <-- possibly obsolete
	Type      *models.Type
	Lookedup  bool // True if key was not a pure OID
}

Node is a rendered SMI node, e.g.: the result of a lookup. Usually handled by the smierte sub-package, but needs to be defined up here to avoid circular dependencies

type Walker

type Walker interface {
	BulkWalk(node []Node, cb func(pdu gosnmp.SnmpPDU) error) error
}

Walker is an interface for performing a BulkWalk, without having to worry about the underlying session. Today, only the session-subpackage and session.Session type implements it. Since it's tied to both a Node and a gosnmp.SnmpPDU type, it's rather strongly connected to SNMP atm.

Directories

Path Synopsis
cmd
addjob command
worker command
PS: While this started with a gosnmp walk-example, basically nothing is left of that, which is why I just removed the original copyright header, if you happen to be reading the git log.
PS: While this started with a gosnmp walk-example, basically nothing is left of that, which is why I just removed the original copyright header, if you happen to be reading the git log.
Package inventory deals with inventory locking and syncing.
Package inventory deals with inventory locking and syncing.

Jump to

Keyboard shortcuts

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