nmon

package
v2.1.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package nmon provides wrapper on nmon reltaed commands import nmon report in InfluxDB author: adejoux@djouxtech.net

Package nmon provides wrapper on nmon reltaed commands import nmon report in InfluxDB author: adejoux@djouxtech.net

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildGrafanaGraphPanel

func BuildGrafanaGraphPanel(np Panel) grafanaclient.Panel

BuildGrafanaGraphPanel generates a grafana graph panel

func BuildGrafanaRow

func BuildGrafanaRow(title string, panels *Panels) grafanaclient.Row

BuildGrafanaRow generate a row composed of panels

func BuildGrafanaTablePanel

func BuildGrafanaTablePanel(np Panel) grafanaclient.Panel

BuildGrafanaTablePanel generates a grafana graph panel

func Dashboard

func Dashboard(c *cli.Context)

Dashboard entry point for nmon dashboard sub command

func DashboardFile

func DashboardFile(config *nmon2influxdblib.Config, file string)

DashboardFile export dashboard to file

func DashboardTemplate

func DashboardTemplate(config *nmon2influxdblib.Config, file string)

DashboardTemplate generates dashboard from toml template

func DisplayStats

func DisplayStats(stats *influxdbclient.DataStats, sort string, limit int)

DisplayStats displays metrics statistics in text mode.

func Import

func Import(c *cli.Context)

Import is the entry point for subcommand nmon import

func ListMeasurement

func ListMeasurement(c *cli.Context)

ListMeasurement list all measurements in INFLUXDB database

func NameFilter

func NameFilter(filter string) (tags []grafanaclient.Tag)

NameFilter add a Grafana filter on name tag

func Stat

func Stat(c *cli.Context)

Stat get and display metrics statistics

func TagsFilter

func TagsFilter(filters map[string]string) (tags []grafanaclient.Tag)

TagsFilter add a standard grafana filter

Types

type DataSerie

type DataSerie struct {
	Columns []string
}

DataSerie structure contains the columns and points to insert in InfluxDB

type Nmon

type Nmon struct {
	Hostname    string
	Serial      string
	OS          string
	TimeStamps  map[string]string
	TextContent string
	DataSeries  map[string]DataSerie
	Debug       bool
	Config      *nmon2influxdblib.Config

	Location   *time.Location
	TagParsers nmon2influxdblib.TagParsers
	// contains filtered or unexported fields
}

Nmon structure used to manage nmon files

func InitNmon

func InitNmon(config *nmon2influxdblib.Config, nmonFile nmon2influxdblib.File) (nmon *Nmon)

InitNmon init nmon structure for nmon file import

func InitNmonTemplate

func InitNmonTemplate(config *nmon2influxdblib.Config) (nmon *Nmon)

InitNmonTemplate init nmon structure when creating dashboard

func NewNmon

func NewNmon() *Nmon

NewNmon initialize a Nmon structure

func (*Nmon) AppendText

func (nmon *Nmon) AppendText(text string)

AppendText add text section to dashboard

func (*Nmon) BuildPoint

func (nmon *Nmon) BuildPoint(serie string, values []string) map[string]interface{}

BuildPoint create a point and convert string value to float when possible

func (*Nmon) ConvertTimeStamp

func (nmon *Nmon) ConvertTimeStamp(s string) (time.Time, error)

ConvertTimeStamp convert the string timestamp in time.Time structure

func (*Nmon) DbURL

func (nmon *Nmon) DbURL() string

DbURL generates InfluxDB server url

func (*Nmon) GenerateAixDashboard

func (nmon *Nmon) GenerateAixDashboard() grafanaclient.Dashboard

GenerateAixDashboard custom minimal dashboard for AIX

func (*Nmon) GenerateLinuxDashboard

func (nmon *Nmon) GenerateLinuxDashboard() grafanaclient.Dashboard

GenerateLinuxDashboard custom minimal dashboard for Linux

func (*Nmon) GetTimeStamp

func (nmon *Nmon) GetTimeStamp(label string) (timeStamp string, err error)

GetTimeStamp retrieves the TimeStamp corresponding to the entry

func (*Nmon) InitGrafanaSession

func (nmon *Nmon) InitGrafanaSession() *grafanaclient.Session

InitGrafanaSession connects to grafana instance and setup influxdb datasource

func (*Nmon) SetLocation

func (nmon *Nmon) SetLocation(tz string) (err error)

SetLocation set the timezone used to input metrics in InfluxDB

func (*Nmon) SetTimeFrame

func (nmon *Nmon) SetTimeFrame()

SetTimeFrame set the current timeframe for the dashboard

func (*Nmon) StartTime

func (nmon *Nmon) StartTime() string

StartTime returns the starting timestamp for dashboard

func (*Nmon) StopTime

func (nmon *Nmon) StopTime() string

StopTime returns the ending timestamp for dashboard

func (*Nmon) UploadDashboard

func (nmon *Nmon) UploadDashboard(dashboard grafanaclient.Dashboard) (err error)

UploadDashboard upload dashboard to current grafana instance

func (*Nmon) WriteDashboard

func (nmon *Nmon) WriteDashboard()

WriteDashboard to file

type Panel

type Panel struct {
	Host            string
	Title           string
	Measurement     string
	Function        string
	Filters         []grafanaclient.Tag
	Group           []string
	Stack           bool
	Table           bool
	TableLegend     bool
	LeftYAxisLabel  string
	RightYAxisLabel string
	NegativeY       string
	Span            int
}

Panel custom Panel fro Grafana

type Panels

type Panels []Panel

Panels array of Panel

func (*Panels) Add

func (panels *Panels) Add(npanel *Panel)

Add append Panel

Jump to

Keyboard shortcuts

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