diagnosticsutil

package
v0.0.0-...-955c50f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DiagnosticsStatusSuccess = "Success"
	DiagnosticsStatusSkipped = "Skipped"
	DiagnosticsStatusFailed  = "Failed"
)
View Source
const (
	// ExpectedServiceRunningUser is the user we expect the agent to be running as
	ExpectedServiceRunningUser = "root"
)

Variables

View Source
var DiagnosticQueries []DiagnosticQuery

Functions

func AssumeAgentEnvironmentProxy

func AssumeAgentEnvironmentProxy()

AssumeAgentEnvironmentProxy reads the amazon-ssm-agent environment variables and assumes the same proxy settings

func ExecuteCommandWithTimeout

func ExecuteCommandWithTimeout(timeout time.Duration, cmd string, args ...string) (string, error)

func GetAwsSession

func GetAwsSession(agentIdentity identity.IAgentIdentity, service string) (*session.Session, error)

GetAwsSession create a single session and shares the session cross diagnostics queries

func GetSSMAgentVersion

func GetSSMAgentVersion() (string, error)

func GetUserRunningAgentProcess

func GetUserRunningAgentProcess() (string, error)

func IsAgentInstalledSnap

func IsAgentInstalledSnap() bool

func IsOnPremRegistration

func IsOnPremRegistration() bool

func IsRunningElevatedPermissions

func IsRunningElevatedPermissions() error

IsRunningElevatedPermissions checks if the ssm-cli is being executed as administrator

func RegisterDiagnosticQuery

func RegisterDiagnosticQuery(diagnosticQuery DiagnosticQuery)

RegisterDiagnosticQuery registers a new diagnostics query to be used by get-diagnostics

Types

type DiagnosticOutput

type DiagnosticOutput struct {
	Check  string
	Status string
	Note   string
}

type DiagnosticQuery

type DiagnosticQuery interface {
	Execute() DiagnosticOutput
	GetName() string
	GetPriority() int
}

type TableFormatter

type TableFormatter struct {
	// contains filtered or unexported fields
}

func NewTableFormatter

func NewTableFormatter(maxWidth int, executions []DiagnosticOutput) TableFormatter

func (*TableFormatter) String

func (t *TableFormatter) String() string

Jump to

Keyboard shortcuts

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