Documentation ¶
Index ¶
- func CheckError(e error)
- func CheckInfo(e error)
- func GetCfgFile() string
- func GetPrettyJSON(contents []byte) bytes.Buffer
- func InitSFTP(sshUser string, host string, key string) *sftp.Client
- func IsFile(file string) bool
- func ReplaceComma(s string) string
- func SPrintHTTPRequest(request *http.Request) string
- func SPrintHTTPResponse(response *http.Response) string
- func SPrintPrettyJSON(contents []byte) string
- type Config
- func (config *Config) AddDashboardParams()
- func (config *Config) BuildCfgFile(cfgfile string)
- func (config *Config) ConnectDB(db string) *influxdbclient.InfluxDB
- func (config *Config) GetDB(dbType string) *influxdbclient.InfluxDB
- func (config *Config) GetLogDB() *influxdbclient.InfluxDB
- func (config *Config) LoadCfgFile() (cfgfile string)
- func (config *Config) Sanitized() (debugConfig Config)
- type File
- type FileScanner
- type Files
- type Input
- type Inputs
- type RemoteFileScanner
- type SSHConfig
- type Tag
- type TagParsers
- type Tags
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPrettyJSON ¶
GetPrettyJSON returns pretty json string
func SPrintHTTPRequest ¶
SPrintHTTPRequest print raw http request for debugging purpose
func SPrintHTTPResponse ¶
SPrintHTTPResponse print raw http response for debugging purpose
func SPrintPrettyJSON ¶
SPrintPrettyJSON helper used to display JSON output in a nicer way
Types ¶
type Config ¶
type Config struct { Debug bool DebugFile string Timezone string InfluxdbUser string InfluxdbPassword string InfluxdbServer string InfluxdbPort string InfluxdbSecure bool InfluxdbSkipCertCheck bool InfluxdbDatabase string GrafanaUser string GrafanaPassword string GrafanaURL string `toml:"grafana_URL"` GrafanaAccess string GrafanaDatasource string HMCServer string `toml:"hmc_server"` HMCUser string `toml:"hmc_user"` HMCPassword string `toml:"hmc_password"` HMCDatabase string `toml:"hmc_database"` HMCDataRetention string `toml:"hmc_data_retention"` HMCManagedSystem string `toml:"hmc_managed_system"` HMCManagedSystemOnly bool `toml:"hmc_managed_system_only"` HMCSamples int `toml:"hmc_samples"` ImportSkipDisks bool ImportAllCpus bool ImportBuildDashboard bool ImportForce bool ImportSkipMetrics string ImportLogDatabase string ImportLogRetention string ImportDataRetention string ImportSSHUser string `toml:"import_ssh_user"` ImportSSHKey string `toml:"import_ssh_key"` DashboardWriteFile bool StatsLimit int StatsSort string StatsFilter string StatsFrom string StatsTo string StatsHost string Metric string `toml:"metric,omitempty"` ListFilter string `toml:",omitempty"` ListHost string `toml:",omitempty"` Inputs Inputs `toml:"input"` }
Config is the configuration structure used by nmon2influxdb
func ParseParameters ¶
ParseParameters parse parameter from command line in Config struct
func (*Config) AddDashboardParams ¶
func (config *Config) AddDashboardParams()
AddDashboardParams initialize default parameters for dashboard
func (*Config) BuildCfgFile ¶
BuildCfgFile creates a default configuration file
func (*Config) ConnectDB ¶
func (config *Config) ConnectDB(db string) *influxdbclient.InfluxDB
ConnectDB connect to the specified influxdb database
func (*Config) GetDB ¶
func (config *Config) GetDB(dbType string) *influxdbclient.InfluxDB
GetDB create or get the influxdb database used for nmon data
func (*Config) GetLogDB ¶
func (config *Config) GetLogDB() *influxdbclient.InfluxDB
GetLogDB create or get the influxdb database like defined in config
func (*Config) LoadCfgFile ¶
LoadCfgFile loads current configuration file settings
type File ¶
type File struct { Name string FileType string Host string SSHUser string SSHKey string Delimiter string // contains filtered or unexported fields }
File structure used to select nmon files to import
func (*File) GetRemoteScanner ¶
func (nmonFile *File) GetRemoteScanner() (*RemoteFileScanner, error)
GetRemoteScanner open an nmon file based on file extension and provides a bufio Scanner
func (*File) GetScanner ¶
func (nmonFile *File) GetScanner() (*FileScanner, error)
GetScanner open an nmon file based on file extension and provides a bufio Scanner
type Files ¶
type Files []File
Files array of File
func (*Files) AddRemote ¶
func (nmonFiles *Files) AddRemote(file string, fileType string, host string, user string, key string)
AddRemote a remote file in the NmonFIles structure
type RemoteFileScanner ¶
RemoteFileScanner struct for remote files
type TagParsers ¶
TagParsers access struct : TagParsers[mesurement][tag name]
func ParseInputs ¶
func ParseInputs(inputs Inputs) TagParsers
ParseInputs process user inputs and compile regular expressions