Documentation ¶
Index ¶
- Constants
- func ExecSnmpWalk(host string, oid string, community string, version string) ([]string, string, error, int)
- func ExecSnmpWalkOnce(host string, oid string, community string, version string) ([]string, string, error, int)
- func ExecSnmpWalkWithTarget(target Target) ([]string, string, error, int)
- func ParseList(lines []string, entityMap EntityMap, config MibConfig)
- func ParseMap(lines []string, config MibConfig, dataMap map[string]string)
- func ParseObject(lines []string, entity Entity, config MibConfig)
- func ParseStringByPrefixRegex(input string, prefix string) (string, error)
- type Entity
- type EntityMap
- type Log
- type LogWrapper
- func (lw *LogWrapper) AddCommandLog(key string, command string, content []string, err error)
- func (lw *LogWrapper) AddError(key string, err string)
- func (lw *LogWrapper) AddLog(key string, command string, content []string, err error)
- func (lw *LogWrapper) AddSimpleLog(key string, content ...interface{})
- func (lw *LogWrapper) AddStatsLog(key string, command string, stats string)
- type MibConfig
- type Target
Constants ¶
View Source
const MibSleepSecond = time.Duration(500) * time.Millisecond
View Source
const (
SepEqual = " = "
)
Variables ¶
This section is empty.
Functions ¶
func ExecSnmpWalk ¶
func ExecSnmpWalk(host string, oid string, community string, version string) ([]string, string, error, int)
@title 执行snmp扫描命令 @author xv 11/6/20 7:56 PM @param host 待扫描机器的ip地址 @param oid @param community snmp的团体字 @param version 1|2c|3 @return (result, command, error, lineNum)
func ExecSnmpWalkOnce ¶ added in v0.1.7
func ExecSnmpWalkWithTarget ¶
func ParseObject ¶
Types ¶
type LogWrapper ¶
func (*LogWrapper) AddCommandLog ¶ added in v0.1.9
func (lw *LogWrapper) AddCommandLog(key string, command string, content []string, err error)
AddCommandLog @Description: @receiver lw @param key @param command @param content @param err
func (*LogWrapper) AddError ¶
func (lw *LogWrapper) AddError(key string, err string)
func (*LogWrapper) AddLog ¶
func (lw *LogWrapper) AddLog(key string, command string, content []string, err error)
func (*LogWrapper) AddSimpleLog ¶ added in v0.1.9
func (lw *LogWrapper) AddSimpleLog(key string, content ...interface{})
AddSimpleLog @Description: add log without command @receiver lw @param key if key exists, append @param content anything
func (*LogWrapper) AddStatsLog ¶ added in v0.1.9
func (lw *LogWrapper) AddStatsLog(key string, command string, stats string)
AddStats @Description: add command stats @receiver lw LogWrapper @param key log-group @param command log-group.command, add -stats suffix @param stats stats description
Click to show internal directories.
Click to hide internal directories.