v1.0.3 Latest Latest

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

Go to latest
Published: Jul 30, 2020 License: GPL-3.0 Imports: 7 Imported by: 0




This section is empty.


This section is empty.


func NewCollector

func NewCollector() collector.Collector

NewCollector returns a new instace of interface.Collector.

func ParsePool

func ParsePool(sshCtx *connector.SSHCommandContext, poolIn *Pool, poolOut chan *Pool)

ParsePool parses the outputs of a `show ip nat pool name "..."` and returns these pools

func ParseStatistics

func ParseStatistics(sshCtx *connector.SSHCommandContext, pools chan *Pool, statistics chan *Statistics)

ParseStatistics parses the cli outputs of `show ip nat statistics`


type Collector

type Collector struct {

Collector gathers counters for network address translation.

func (*Collector) Collect

func (c *Collector) Collect(ctx *collector.CollectContext)

Collect implements the collector.Collector interface's Collect function

func (*Collector) Describe

func (*Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements the collector.Collector interface's Describe function

func (*Collector) Name

func (*Collector) Name() string

Name implements the collector.Collector interface's Name function

type Pool

type Pool struct {
	Name string
	ID   string

	Type string

	Refcount float64

	Misses float64

	Netmask string
	StartIP string
	EndIP   string

	AddressesTotal    float64
	AddressesAvail    float64
	AddressesAssigned float64

	// Low ports are less than 1024. High ports are greater than or equal to 1024.
	UDPLowPortsAvail    float64
	UDPLowPortsAssigned float64

	TCPLowPortsAvail    float64
	TCPLowPortsAssigned float64

	UDPHighPortsAvail    float64
	UDPHighPortsAssigned float64

	TCPHighPortsAvail    float64
	TCPHighPortsAssigned float64

Pool represents one NAT pool returned by `show ip nat pool name "..."`

type Statistics

type Statistics struct {
	ActiveTranslations        float64
	ActiveStaticTranslations  float64
	ActiveDynamicTranslations float64

	OutsideInterfaces   []string
	InsideInterfaces    []string
	Hits                float64
	Misses              float64
	ExpiredTranslations float64

	InToOutDrops float64
	OutToInDrops float64

	LimitMaxAllowed float64
	LimitUsed       float64
	LimitMissed     float64

	PoolStatsDrop      float64
	MappingStatsDrop   float64
	PortBlockAllocFail float64
	IPAliasAddFail     float64
	LimitEntryAddFail  float64

Statistics contains the information returned by a `show ip nat statistics`

func NewStatistics

func NewStatistics() *Statistics

NewStatistics returns a new Statistics Instance and initializes some fields

Jump to

Keyboard shortcuts

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