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 ¶
- func BuildGrafanaGraphPanel(np Panel) grafanaclient.Panel
- func BuildGrafanaRow(title string, panels *Panels) grafanaclient.Row
- func BuildGrafanaTablePanel(np Panel) grafanaclient.Panel
- func Dashboard(c *cli.Context)
- func DashboardFile(config *nmon2influxdblib.Config, file string)
- func DashboardTemplate(config *nmon2influxdblib.Config, file string)
- func DisplayStats(stats *influxdbclient.DataStats, sort string, limit int)
- func Import(c *cli.Context)
- func ListMeasurement(c *cli.Context)
- func NameFilter(filter string) (tags []grafanaclient.Tag)
- func Stat(c *cli.Context)
- func TagsFilter(filters map[string]string) (tags []grafanaclient.Tag)
- type DataSerie
- type Nmon
- func (nmon *Nmon) AppendText(text string)
- func (nmon *Nmon) BuildPoint(serie string, values []string) map[string]interface{}
- func (nmon *Nmon) ConvertTimeStamp(s string) (time.Time, error)
- func (nmon *Nmon) DbURL() string
- func (nmon *Nmon) GenerateAixDashboard() grafanaclient.Dashboard
- func (nmon *Nmon) GenerateLinuxDashboard() grafanaclient.Dashboard
- func (nmon *Nmon) GetTimeStamp(label string) (timeStamp string, err error)
- func (nmon *Nmon) InitGrafanaSession() *grafanaclient.Session
- func (nmon *Nmon) SetLocation(tz string) (err error)
- func (nmon *Nmon) SetTimeFrame()
- func (nmon *Nmon) StartTime() string
- func (nmon *Nmon) StopTime() string
- func (nmon *Nmon) UploadDashboard(dashboard grafanaclient.Dashboard) (err error)
- func (nmon *Nmon) WriteDashboard()
- type Panel
- type Panels
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 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 ListMeasurement ¶
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 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 (*Nmon) AppendText ¶
AppendText add text section to dashboard
func (*Nmon) BuildPoint ¶
BuildPoint create a point and convert string value to float when possible
func (*Nmon) ConvertTimeStamp ¶
ConvertTimeStamp convert the string timestamp in time.Time structure
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 ¶
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 ¶
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) UploadDashboard ¶
func (nmon *Nmon) UploadDashboard(dashboard grafanaclient.Dashboard) (err error)
UploadDashboard upload dashboard to current grafana instance