Documentation
¶
Index ¶
- func Ping(c *config.DeviceCfg, log *logrus.Logger, apidbg bool, filename string) (*sftp.Client, *ssh.Client, time.Duration, string, error)
- func SetDBConfig(c *config.DBConfig, d *config.DatabaseCfg)
- func SetLogDir(l string)
- type NmonFile
- func (nf *NmonFile) AddNmonSection(line string) bool
- func (nf *NmonFile) AppendText(text string)
- func (nf *NmonFile) Init(timezone string) (int64, error)
- func (nf *NmonFile) InitSectionDefs() (int64, error)
- func (nf *NmonFile) ProcessChunk(pa *pointarray.PointArray, Tags map[string]string, t time.Time, timeID string, ...)
- func (nf *NmonFile) ProcessPending(points *pointarray.PointArray, tags map[string]string)
- func (nf *NmonFile) Reopen()
- func (nf *NmonFile) ReopenIfChanged() bool
- func (nf *NmonFile) ResetPending()
- func (nf *NmonFile) ResetText()
- func (nf *NmonFile) SetPosition(newpos int64) error
- func (nf *NmonFile) SetTimeZoneLocation(tz string) (err error)
- func (nf *NmonFile) UpdateContent() (int, int64)
- type NmonSection
- type Server
- func (d *Server) GetNmonData()
- func (d *Server) GetOutSenderFromMap(influxdb map[string]*output.InfluxDB) (*output.InfluxDB, error)
- func (d *Server) ImportData(points *pointarray.PointArray) error
- func (d *Server) Init(c *config.DeviceCfg) error
- func (d *Server) SSHRemoteExec(cmd string) (string, error)
- func (d *Server) ScanNmonDevice() error
- func (d *Server) ToJSON() ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ping ¶
func Ping(c *config.DeviceCfg, log *logrus.Logger, apidbg bool, filename string) (*sftp.Client, *ssh.Client, time.Duration, string, error)
Ping check connection to the
func SetDBConfig ¶
func SetDBConfig(c *config.DBConfig, d *config.DatabaseCfg)
SetDBConfig set agent config
Types ¶
type NmonFile ¶
type NmonFile struct { File *rfile.File FilePattern string CurFile string Delimiter string //Hostname string <-not really needed //OS string <-not really needed //Serial string <-not really needed TextContent []string Sections map[string]NmonSection HostName string PendingLines []string LastTime time.Time RotateDelay int UserFilters map[string]*regexp.Regexp // contains filtered or unexported fields }
NmonFile type for remote NmonFiles
func NewNmonFile ¶
func NewNmonFile(sftp *sftp.Client, l *logrus.Logger, pattern string, host string, delay int, filtermap map[string]*regexp.Regexp) *NmonFile
NewNmonFile create a NmonFile , Hostname needed to Parse pattern
func (*NmonFile) AddNmonSection ¶
AddNmonSection add new Section
func (*NmonFile) AppendText ¶
AppendText add text section to dashboard
func (*NmonFile) InitSectionDefs ¶
InitSectionDefs Initialize section definitions.
func (*NmonFile) ProcessChunk ¶
func (nf *NmonFile) ProcessChunk(pa *pointarray.PointArray, Tags map[string]string, t time.Time, timeID string, lines []string)
ProcessChunk process a
func (*NmonFile) ProcessPending ¶
func (nf *NmonFile) ProcessPending(points *pointarray.PointArray, tags map[string]string)
ProcessPending process last
func (*NmonFile) ReopenIfChanged ¶
ReopenIfChanged check if file has changed read last data in previous file and reopen again if needed
func (*NmonFile) ResetPending ¶
func (nf *NmonFile) ResetPending()
ResetPending remove buffered data
func (*NmonFile) SetPosition ¶
SetPosition set remote file at newPos Posistion
func (*NmonFile) SetTimeZoneLocation ¶
SetTimeZoneLocation set the timezone used to input metrics in InfluxDB
func (*NmonFile) UpdateContent ¶
UpdateContent from remoteFile return num of new lines , and new pos
type Server ¶
type Server struct { devices.Base Timezone string NmonFile *NmonFile FilterMap map[string]*regexp.Regexp // contains filtered or unexported fields }
Server contains all runtime device related device configu ns and state
func (*Server) GetOutSenderFromMap ¶
func (d *Server) GetOutSenderFromMap(influxdb map[string]*output.InfluxDB) (*output.InfluxDB, error)
GetOutSenderFromMap to get info about the sender will use
func (*Server) ImportData ¶
func (d *Server) ImportData(points *pointarray.PointArray) error
ImportData getmon N data from Remote devices
func (*Server) Init ¶
Init does the following
- Initialize not set variables to some defaults - Initialize logfile for this device - Initialize comunication channels and initial device state
func (*Server) SSHRemoteExec ¶
SSHRemoteExec a way to exec basic commands