nms

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package nms provides network monitoring system through different various protocols such as SNMP, SSH

Index

Constants

This section is empty.

Variables

View Source
var (
	// OID holds essentiall OIDs that need for each interface
	OID = map[string]string{
		"sysDescr":             "1.3.6.1.2.1.1.1.0",
		"ifDescr":              "1.3.6.1.2.1.2.2.1.2",
		"ifAlias":              "1.3.6.1.2.1.31.1.1.1.18",
		"ifOperStatus":         "1.3.6.1.2.1.2.2.1.8",
		"ifHCInOctets":         "1.3.6.1.2.1.31.1.1.1.6",
		"ifHCInUcastPkts":      "1.3.6.1.2.1.31.1.1.1.7",
		"ifHCOutOctets":        "1.3.6.1.2.1.31.1.1.1.10",
		"ifHCOutUcastPkts":     "1.3.6.1.2.1.31.1.1.1.11",
		"ifHCInMulticastPkts":  "1.3.6.1.2.1.31.1.1.1.8",
		"ifHCOutMulticastPkts": "1.3.6.1.2.1.31.1.1.1.12",
		"ifHCInBroadcastPkts":  "1.3.6.1.2.1.31.1.1.1.9",
		"ifHCOutBroadcastPkts": "1.3.6.1.2.1.31.1.1.1.13",
		"ifInDiscards":         "1.3.6.1.2.1.2.2.1.13",
		"ifInErrors":           "1.3.6.1.2.1.2.2.1.14",
		"ifOutDiscards":        "1.3.6.1.2.1.2.2.1.19",
		"ifOutErrors":          "1.3.6.1.2.1.2.2.1.20",
	}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	SNMP *SNMPClient
	Host string
}

Client represents NMS client

func NewClient

func NewClient(args string, cfg cli.Config) (Client, error)

NewClient makes new NMS client

func (*Client) ShowInterface

func (c *Client) ShowInterface(args string) error

ShowInterface prints out interface(s) information based on specific portocol (SNMP/SSH/...) for now it supports only SNMP

type SNMPClient

type SNMPClient struct {
	Args     snmpgo.SNMPArguments
	Host     string
	SysDescr string
}

SNMPClient represents all necessary SNMP parameters

func NewSNMP

func NewSNMP(a string, cfg cli.Config) (*SNMPClient, error)

NewSNMP sets and validates SNMP parameters

func (*SNMPClient) BulkWalk

func (c *SNMPClient) BulkWalk(oid ...string) ([]*snmpgo.VarBind, error)

BulkWalk retrieves a subtree of management values

func (*SNMPClient) GetOIDs

func (c *SNMPClient) GetOIDs(oid ...string) ([]*snmpgo.VarBind, error)

GetOIDs retrieves values based on the oid(s)

type Widgets

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

Widgets represents termui widgets

Jump to

Keyboard shortcuts

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