support

package
v0.0.0-...-ebe7275 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-2-Clause-Patent Imports: 18 Imported by: 0

README

support collect-log command

Support collect-log command will collect the logs on the servers or individual clients for debugging purpose.This options is available for daos_server, dmg and daos_agent binaries. It will collect the specific logs, config and other DAOS related metrics and system information.

dmg support collect-log is the single command, which will initiate the log collection over gRPC,collect and copy the logs on each servers.Logs will be Rsync to the admin node.

daos_server support collect-log command will collect the information on that particular DAOS server.It will not collect the dmg command information as dmg command needs to be run from the admin node.

daos_agent support collect-log will collect the information on the client and collect the DAOS client side log with other system related information.

List of items collected as part of dmg support collect-log

  • dmg network,storage and system command output
  • daos server config
  • helper_log_file mention in daos server config
  • control_log_file mention in daos server config
  • engines log_file mention in daos server config
  • daos metrics for all the engines
  • daos_server dump-topology, version output
  • system information

List of items collected as part of daos_server support collect-log

  • daos server config
  • helper_log_file mention in daos server config
  • control_log_file mention in daos server config
  • engines log_file mention in daos server config
  • daos metrics for all the engines
  • daos_server dump-topology, version output
  • system information

List of items collected as part of daos_agent support collect-log

  • daos agent config
  • log_file mention in daos agent config
  • daos client log if it's set D_LOG_FILE
  • daos_agent dump-topology, net-scan, version output
  • system information

support collect-log command options

support collect-log help describe the use of each options.

# dmg support collect-log  --help
Usage:
  dmg [OPTIONS] support collect-log [collect-log-OPTIONS]

Application Options:
      --allow-proxy         Allow proxy configuration via environment
  -i, --insecure            Have dmg attempt to connect without certificates
  -d, --debug               Enable debug output
      --log-file=           Log command output to the specified file
  -j, --json                Enable JSON output
  -J, --json-logging        Enable JSON-formatted log output
  -o, --config-path=        Client config file path

Help Options:
  -h, --help                Show this help message

[collect-log command options]
      -l, --host-list=      A comma separated list of addresses <ipv4addr/hostname> to connect to
      -s, --stop-on-error   Stop the collect-log command on very first error
      -t, --target-folder=  Target Folder location where log will be copied
      -z, --archive         Archive the log/config files
      -c, --extra-logs-dir= Collect the Logs from given directory
      -D, --start-date=     Specify the start date, the day from log will be collected, Format: MM-DD
      -F, --end-date=       Specify the end date, the day till the log will be collected, Format: MM-DD
      -S, --log-start-time= Specify the log collection start time, Format: HH:MM:SS
      -E, --log-end-time=   Specify the log collection end time, Format: HH:MM:SS
      -e, --log-type=       collect specific logs only admin,control,server and ignore everything else

Documentation

Index

Constants

View Source
const (
	CopyServerConfigEnum int32 = iota
	CollectSystemCmdEnum
	CollectServerLogEnum
	CollectExtraLogsDirEnum
	CollectDaosServerCmdEnum
	CollectDmgCmdEnum
	CollectDmgDiskInfoEnum
	CollectAgentCmdEnum
	CollectClientLogEnum
	CollectAgentLogEnum
	CopyAgentConfigEnum
	RsyncLogEnum
	ArchiveLogsEnum
)
View Source
const (
	MMDDYYYY        = "1-2-2006"
	HHMMSS          = "15:4:5"
	MMDDHHMMSS      = "1/2-15:4:5"
	MMDDYYYY_HHMMSS = "1-2-2006 15:4:5"
	YYYYMMDD_HHMMSS = "2006/1/2 15:4:5"
)
View Source
const (
	DaosServerConfig = "DaosServerConfig" // Copy the server config

)

Folder names to copy logs and configs

View Source
const DmgDeviceHealthCmd = "dmg storage query list-devices --health"
View Source
const DmgListDeviceCmd = "dmg storage query list-devices"

Variables

View Source
var AgentCmd = []string{
	"daos_agent version",
	"daos_agent net-scan",
	"daos_agent dump-topology",
}
View Source
var DaosServerCmd = []string{
	"daos_server version",
	"daos_metrics",
	"dump-topology",
}
View Source
var DmgCmd = []string{
	"dmg system get-prop",
	"dmg system query",
	"dmg system list-pools",
	"dmg system leader-query",
	"dmg system get-attr",
	"dmg network scan",
	"dmg storage scan",
	"dmg storage scan -n",
	"dmg storage scan -m",
	"dmg storage query list-pools -v",
	"dmg storage query usage",
}
View Source
var ServerLog = []string{
	"EngineLog",
	"ControlLog",
	"HelperLog",
}
View Source
var SystemCmd = []string{
	"dmesg",
	"df -h",
	"mount",
	"ps axf",
	"top -bcn1 -w512",
	"lspci -D",
	"sysctl -a",
	"printenv",
	"rpm -qa --qf '(%{INSTALLTIME:date}): %{NAME}-%{VERSION}\n'",
}

Functions

func ArchiveLogs

func ArchiveLogs(log logging.Logger, opts ...CollectLogsParams) error

Create the Archive of log folder.

func CollectSupportLog

func CollectSupportLog(log logging.Logger, opts ...CollectLogsParams) error

Common Entry/Exit point function.

func GetHostName

func GetHostName() (string, error)

Get the system hostname

Types

type CollectLogSubCmd

type CollectLogSubCmd struct {
	StopOnError          bool   `short:"s" long:"stop-on-error" description:"Stop the collect-log command on very first error"`
	TargetFolder         string `short:"t" long:"target-folder" description:"Target Folder location where log will be copied"`
	Archive              bool   `short:"z" long:"archive" description:"Archive the log/config files"`
	ExtraLogsDir         string `short:"c" long:"extra-logs-dir" description:"Collect the Logs from given directory"`
	LogStartDate         string `short:"D" long:"start-date" description:"Specify the start date, the day from log will be collected, Format: MM-DD"`
	LogEndDate           string `short:"F" long:"end-date" description:"Specify the end date, the day till the log will be collected, Format: MM-DD"`
	LogStartTime         string `short:"S" long:"log-start-time" description:"Specify the log collection start time, Format: HH:MM:SS"`
	LogEndTime           string `short:"E" long:"log-end-time" description:"Specify the log collection end time, Format: HH:MM:SS"`
	FileTransferExecArgs string `short:"T" long:"transfer-args" description:"Extra arguments for alternate file transfer tool"`
}

func (*CollectLogSubCmd) DateTimeValidate

func (cmd *CollectLogSubCmd) DateTimeValidate() error

Verify if the date and time argument is valid and return error if it's invalid

type CollectLogsParams

type CollectLogsParams struct {
	Config               string
	Hostlist             string
	TargetFolder         string
	AdminNode            string
	ExtraLogsDir         string
	JsonOutput           bool
	LogFunction          int32
	LogCmd               string
	LogStartDate         string
	LogEndDate           string
	LogStartTime         string
	LogEndTime           string
	StopOnError          bool
	FileTransferExecArgs string
}

type LogTypeSubCmd

type LogTypeSubCmd struct {
	LogType string `short:"e" long:"log-type" description:"collect specific logs only admin,control,server and ignore everything else"`
}

func (*LogTypeSubCmd) LogTypeValidate

func (cmd *LogTypeSubCmd) LogTypeValidate() ([]string, error)

Verify LogType argument is valid.Return error, if it's not matching as describer in help

type ProgressBar

type ProgressBar struct {
	Start     int  // start int number
	Total     int  // end int number
	Steps     int  // number to be increased per step
	NoDisplay bool // Option to skip progress bar if Json output is enabled
}

func (*ProgressBar) Display

func (p *ProgressBar) Display() string

Print the progress while collect-log command is in progress

Jump to

Keyboard shortcuts

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