snmp

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: May 18, 2020 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Errorf

func Errorf(err error, msg string, format ...interface{}) error

func NewReader

func NewReader(meta *reader.Meta, c conf.MapConf) (reader.Reader, error)

Types

type Field

type Field struct {
	Name           string `json:"field_name"`
	Oid            string `json:"field_oid"`
	OidIndexSuffix string `json:"field_oid_index_suffix"`
	IsTag          bool   `json:"field_is_tag"`
	Conversion     string `json:"field_conversion"`
}

type NestedError

type NestedError struct {
	Err       error
	NestedErr error
}

func (NestedError) Error

func (ne NestedError) Error() string

type RTable

type RTable struct {
	Name string
	Time string
	Rows []RTableRow
}

type RTableRow

type RTableRow struct {
	Tags   map[string]string
	Fields map[string]interface{}
}

type Reader

type Reader struct {
	SnmpName       string
	Agents         []string      // agent address [ip:port]
	Timeout        time.Duration // 等待回复的时间
	Interval       time.Duration // 收集频率
	Retries        int
	Version        uint8  // 1, 2, 3
	Community      string // version 1&2 的参数
	MaxRepetitions uint8  // version 2&3 的参数
	ContextName    string // version 3 参数

	SecLevel     string //"noAuthNoPriv", "authNoPriv", "authPriv"
	SecName      string
	AuthProtocol string // "MD5", "SHA", "", 默认: ""
	AuthPassword string
	PrivProtocol string // "DES", "AES", "", 默认: ""
	PrivPassword string
	EngineID     string
	EngineBoots  uint32
	EngineTime   uint32

	Tables          []Table
	Fields          []Field
	ConnectionCache []snmpConnection
	// contains filtered or unexported fields
}

Reader holds the configuration for the plugin.

func (*Reader) Close

func (r *Reader) Close() error

func (*Reader) Gather

func (r *Reader) Gather() error

func (*Reader) Name

func (r *Reader) Name() string

func (*Reader) ReadData added in v1.5.2

func (r *Reader) ReadData() (Data, int64, error)

func (*Reader) ReadLine

func (r *Reader) ReadLine() (string, error)

func (*Reader) SetMode

func (r *Reader) SetMode(mode string, v interface{}) error

func (*Reader) Source

func (r *Reader) Source() string

func (*Reader) Start

func (r *Reader) Start() error

func (*Reader) StoreData

func (r *Reader) StoreData(datas []Data) (err error)

func (*Reader) SyncMeta

func (r *Reader) SyncMeta()

type Table

type Table struct {
	Name        string   `json:"table_name"`
	InheritTags []string `json:"table_inherit_tags"`
	IndexAsTag  bool     `json:"table_index_tag"`
	Fields      []Field  `json:"table_fields"`
	Oid         string   `json:"table_oid"`
}

func (Table) Build

func (t Table) Build(gs snmpConnection, walk bool) (*RTable, error)

Jump to

Keyboard shortcuts

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