Documentation ¶
Index ¶
- func CheckError(e error)
- func CheckInfo(e error)
- func GetCfgFile() (cfgfile string)
- func GetPrettyJSON(contents []byte) bytes.Buffer
- func InitSFTP(sshUser string, host string, key string) *sftp.Client
- func IsNotFile(file string) bool
- func PrintHTTPRequest(request *http.Request)
- func PrintHTTPResponse(response *http.Response)
- func PrintPrettyJSON(contents []byte)
- func ReplaceComma(s string) 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()
- type File
- type FileScanner
- type Files
- type RemoteFileScanner
- type SSHConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCfgFile ¶
func GetCfgFile() (cfgfile string)
GetCfgFile returns the current configuration file path
func GetPrettyJSON ¶
GetPrettyJSON returns pretty json string
func PrintHTTPRequest ¶
PrintHTTPRequest print raw http request for debugging purpose
func PrintHTTPResponse ¶
PrintHTTPResponse print raw http response for debugging purpose
func PrintPrettyJSON ¶
func PrintPrettyJSON(contents []byte)
PrintPrettyJSON helper used to display JSON output in a nicer way
Types ¶
type Config ¶
type Config struct { Debug bool Timezone string InfluxdbUser string InfluxdbPassword string InfluxdbServer string InfluxdbPort string 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"` }
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 ¶
func (config *Config) LoadCfgFile()
LoadCfgFile loads current configuration file settings
type File ¶
type File struct { Name string FileType string Host string SSHUser string SSHKey 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