collect

package
v0.13.14 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: Apache-2.0 Imports: 77 Imported by: 15

Documentation

Index

Constants

View Source
const (
	NetworkStatusAddressInUse         = "address-in-use"
	NetworkStatusConnectionRefused    = "connection-refused"
	NetworkStatusConnectionTimeout    = "connection-timeout"
	NetworkStatusConnected            = "connected"
	NetworkStatusErrorOther           = "error"
	NetworkStatusBindPermissionDenied = "bind-permission-denied"
	NetworkStatusInvalidAddress       = "invalid-address"
)
View Source
const (
	DefaultCephNamespace = "rook-ceph"
)
View Source
const (
	DefaultLonghornNamespace = "longhorn-system"
)
View Source
const HostServicesPath = `system/systemctl_services.json`
View Source
const KeyPairEncrypted = "key-pair-encrypted"
View Source
const KeyPairInvalid = "key-pair-invalid"
View Source
const KeyPairMismatch = "key-pair-mismatch"
View Source
const KeyPairMissing = "key-pair-missing"
View Source
const KeyPairSwitched = "key-pair-switched"
View Source
const KeyPairValid = "key-pair-valid"

Variables

View Source
var CephCommands = []CephCommand{
	{
		ID:      "status",
		Command: []string{"ceph", "status"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "fs",
		Command: []string{"ceph", "fs", "status"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "fs-ls",
		Command: []string{"ceph", "fs", "ls"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "osd-status",
		Command: []string{"ceph", "osd", "status"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "txt",
	},
	{
		ID:      "osd-tree",
		Command: []string{"ceph", "osd", "tree"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "osd-pool",
		Command: []string{"ceph", "osd", "pool", "ls", "detail"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "health",
		Command: []string{"ceph", "health", "detail"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:      "auth",
		Command: []string{"ceph", "auth", "ls"},
		Args:    []string{"-f", "json-pretty"},
		Format:  "json",
	},
	{
		ID:             "rgw-stats",
		Command:        []string{"radosgw-admin", "bucket", "stats"},
		Args:           []string{"--rgw-cache-enabled=false"},
		Format:         "txt",
		DefaultTimeout: "30s",
	},
	{
		ID:      "rbd-du",
		Command: []string{"rbd", "du"},
		Args:    []string{"--pool=replicapool"},
		Format:  "txt",
	},
}

Functions

func Ceph added in v0.9.50

func Ceph(c *Collector, cephCollector *troubleshootv1beta2.Ceph) (map[string][]byte, error)

func ClusterInfo

func ClusterInfo(c *Collector) (map[string][]byte, error)

func ClusterResources

func ClusterResources(c *Collector, clusterResourcesCollector *troubleshootv1beta2.ClusterResources) (map[string][]byte, error)

func Collectd added in v0.9.49

func Collectd(ctx context.Context, namespace string, clientConfig *restclient.Config, client kubernetes.Interface, collector *troubleshootv1beta2.Collectd) (map[string][]byte, error)

func ConfigMap added in v0.13.3

func ConfigMap(ctx context.Context, client kubernetes.Interface, configMapCollector *troubleshootv1beta2.ConfigMap) (map[string][]byte, error)

func Copy

func Copy(c *Collector, copyCollector *troubleshootv1beta2.Copy) (map[string][]byte, error)

Copy function gets a file or folder from a container specified in the specs.

func CopyFromHost added in v0.13.4

func CopyFromHost(ctx context.Context, namespace string, clientConfig *restclient.Config, client kubernetes.Interface, collector *troubleshootv1beta2.CopyFromHost) (map[string][]byte, error)

CopyFromHost is a function that copies a file or directory from a host or hosts to include in the bundle.

func CreateCollector

func CreateCollector(client client.Client, scheme *runtime.Scheme, ownerRef metav1.Object, jobName string, jobNamespace string, serviceAccountName string, jobType string, collect *troubleshootv1beta2.Collect, image string, pullPolicy string) (*corev1.ConfigMap, *corev1.Pod, error)

func Data added in v0.9.14

func Data(c *Collector, dataCollector *troubleshootv1beta2.Data) (map[string][]byte, error)

func DeterministicIDForCollector

func DeterministicIDForCollector(collector *troubleshootv1beta2.Collect) string

func Exec

func Exec(c *Collector, execCollector *troubleshootv1beta2.Exec) (map[string][]byte, error)

func GetCephCollectorFilepath added in v0.9.50

func GetCephCollectorFilepath(name, namespace string) string

func GetConfigMapErrorsFileName added in v0.13.3

func GetConfigMapErrorsFileName(configMapCollector *troubleshootv1beta2.ConfigMap) string

func GetConfigMapFileName added in v0.13.3

func GetConfigMapFileName(configMapCollector *troubleshootv1beta2.ConfigMap, name string) string

func GetLonghornBackingImageManagersDirectory added in v0.11.0

func GetLonghornBackingImageManagersDirectory(namespace string) string

func GetLonghornBackingImagesDirectory added in v0.11.0

func GetLonghornBackingImagesDirectory(namespace string) string

func GetLonghornEngineImagesDirectory added in v0.11.0

func GetLonghornEngineImagesDirectory(namespace string) string

func GetLonghornEnginesDirectory added in v0.11.0

func GetLonghornEnginesDirectory(namespace string) string

func GetLonghornInstanceManagersDirectory added in v0.11.0

func GetLonghornInstanceManagersDirectory(namespace string) string

func GetLonghornLogsDirectory added in v0.11.0

func GetLonghornLogsDirectory(namespace string) string

func GetLonghornNodesDirectory added in v0.11.0

func GetLonghornNodesDirectory(namespace string) string

func GetLonghornReplicaChecksum added in v0.12.0

func GetLonghornReplicaChecksum(clientConfig *rest.Config, replica longhornv1beta1types.Replica, podName string) (string, error)

func GetLonghornReplicasDirectory added in v0.11.0

func GetLonghornReplicasDirectory(namespace string) string

func GetLonghornSettingsFile added in v0.11.0

func GetLonghornSettingsFile(namespace string) string

func GetLonghornShareManagersDirectory added in v0.11.0

func GetLonghornShareManagersDirectory(namespace string) string

func GetLonghornVolumesDirectory added in v0.11.0

func GetLonghornVolumesDirectory(namespace string) string

func GetSecretErrorsFileName added in v0.13.3

func GetSecretErrorsFileName(secretCollector *troubleshootv1beta2.Secret) string

func GetSecretFileName added in v0.13.3

func GetSecretFileName(secretCollector *troubleshootv1beta2.Secret, name string) string

func HTTP

func HTTP(c *Collector, httpCollector *troubleshootv1beta2.HTTP) (map[string][]byte, error)

func HostDiskUsageKey added in v0.10.0

func HostDiskUsageKey(name string) string

func IsRBACError added in v0.9.15

func IsRBACError(err error) bool

func ListInstanceManagerReplicaPods added in v0.12.0

func ListInstanceManagerReplicaPods(ctx context.Context, clientConfig *rest.Config, namespace string) (map[string]string, error)

Returns a map of nodeName:podName

func Logs

func Logs(c *Collector, logsCollector *troubleshootv1beta2.Logs) (map[string][]byte, error)

func Longhorn added in v0.11.0

func Longhorn(c *Collector, longhornCollector *troubleshootv1beta2.Longhorn) (map[string][]byte, error)

func Mysql added in v0.9.27

func Mysql(c *Collector, databaseCollector *troubleshootv1beta2.Database) (map[string][]byte, error)

func ParseReplicaChecksum added in v0.12.0

func ParseReplicaChecksum(data []byte) (map[string]string, error)

func Postgres added in v0.9.27

func Postgres(c *Collector, databaseCollector *troubleshootv1beta2.Database) (map[string][]byte, error)

func Redis added in v0.9.27

func Redis(c *Collector, databaseCollector *troubleshootv1beta2.Database) (map[string][]byte, error)

func Registry added in v0.10.16

func Registry(c *Collector, registryCollector *troubleshootv1beta2.RegistryImages) (map[string][]byte, error)

func Run

func Run(c *Collector, runCollector *troubleshootv1beta2.Run) (map[string][]byte, error)

func Secret

func Secret(ctx context.Context, client kubernetes.Interface, secretCollector *troubleshootv1beta2.Secret) (map[string][]byte, error)

Types

type BlockDeviceInfo added in v0.10.2

type BlockDeviceInfo struct {
	Name             string `json:"name"`
	KernelName       string `json:"kernel_name"`
	ParentKernelName string `json:"parent_kernel_name"`
	Type             string `json:"type"`
	Major            int    `json:"major"`
	Minor            int    `json:"minor"`
	Size             uint64 `json:"size"`
	FilesystemType   string `json:"filesystem_type"`
	Mountpoint       string `json:"mountpoint"`
	Serial           string `json:"serial"`
	ReadOnly         bool   `json:"read_only"`
	Removable        bool   `json:"removable"`
}

type CPUInfo added in v0.10.0

type CPUInfo struct {
	LogicalCount  int `json:"logicalCount"`
	PhysicalCount int `json:"physicalCount"`
}

type CephCommand added in v0.9.50

type CephCommand struct {
	ID             string
	Command        []string
	Args           []string
	Format         string
	DefaultTimeout string
}

type ClusterVersion

type ClusterVersion struct {
	Info   *version.Info `json:"info"`
	String string        `json:"string"`
}

type CollectHostBlockDevices added in v0.10.8

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

func (*CollectHostBlockDevices) Collect added in v0.10.8

func (c *CollectHostBlockDevices) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostBlockDevices) IsExcluded added in v0.10.8

func (c *CollectHostBlockDevices) IsExcluded() (bool, error)

func (*CollectHostBlockDevices) Title added in v0.10.8

func (c *CollectHostBlockDevices) Title() string

type CollectHostCPU added in v0.10.8

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

func (*CollectHostCPU) Collect added in v0.10.8

func (c *CollectHostCPU) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostCPU) IsExcluded added in v0.10.8

func (c *CollectHostCPU) IsExcluded() (bool, error)

func (*CollectHostCPU) Title added in v0.10.8

func (c *CollectHostCPU) Title() string

type CollectHostCertificate added in v0.10.8

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

func (*CollectHostCertificate) Collect added in v0.10.8

func (c *CollectHostCertificate) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostCertificate) IsExcluded added in v0.10.8

func (c *CollectHostCertificate) IsExcluded() (bool, error)

func (*CollectHostCertificate) Title added in v0.10.8

func (c *CollectHostCertificate) Title() string

type CollectHostDiskUsage added in v0.10.8

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

func (*CollectHostDiskUsage) Collect added in v0.10.8

func (c *CollectHostDiskUsage) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostDiskUsage) IsExcluded added in v0.10.8

func (c *CollectHostDiskUsage) IsExcluded() (bool, error)

func (*CollectHostDiskUsage) Title added in v0.10.8

func (c *CollectHostDiskUsage) Title() string

type CollectHostFilesystemPerformance added in v0.10.8

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

func (*CollectHostFilesystemPerformance) Collect added in v0.10.8

func (c *CollectHostFilesystemPerformance) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostFilesystemPerformance) IsExcluded added in v0.10.8

func (c *CollectHostFilesystemPerformance) IsExcluded() (bool, error)

func (*CollectHostFilesystemPerformance) Title added in v0.10.8

type CollectHostHTTP added in v0.10.8

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

func (*CollectHostHTTP) Collect added in v0.10.8

func (c *CollectHostHTTP) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostHTTP) IsExcluded added in v0.10.8

func (c *CollectHostHTTP) IsExcluded() (bool, error)

func (*CollectHostHTTP) Title added in v0.10.8

func (c *CollectHostHTTP) Title() string

type CollectHostHTTPLoadBalancer added in v0.10.8

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

func (*CollectHostHTTPLoadBalancer) Collect added in v0.10.8

func (c *CollectHostHTTPLoadBalancer) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostHTTPLoadBalancer) IsExcluded added in v0.10.8

func (c *CollectHostHTTPLoadBalancer) IsExcluded() (bool, error)

func (*CollectHostHTTPLoadBalancer) Title added in v0.10.8

type CollectHostIPV4Interfaces added in v0.10.8

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

func (*CollectHostIPV4Interfaces) Collect added in v0.10.8

func (c *CollectHostIPV4Interfaces) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostIPV4Interfaces) IsExcluded added in v0.10.8

func (c *CollectHostIPV4Interfaces) IsExcluded() (bool, error)

func (*CollectHostIPV4Interfaces) Title added in v0.10.8

func (c *CollectHostIPV4Interfaces) Title() string

type CollectHostMemory added in v0.10.8

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

func (*CollectHostMemory) Collect added in v0.10.8

func (c *CollectHostMemory) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostMemory) IsExcluded added in v0.10.8

func (c *CollectHostMemory) IsExcluded() (bool, error)

func (*CollectHostMemory) Title added in v0.10.8

func (c *CollectHostMemory) Title() string

type CollectHostServices added in v0.10.15

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

func (*CollectHostServices) Collect added in v0.10.15

func (c *CollectHostServices) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostServices) IsExcluded added in v0.10.15

func (c *CollectHostServices) IsExcluded() (bool, error)

func (*CollectHostServices) Title added in v0.10.15

func (c *CollectHostServices) Title() string

type CollectHostTCPConnect added in v0.10.8

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

func (*CollectHostTCPConnect) Collect added in v0.10.8

func (c *CollectHostTCPConnect) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostTCPConnect) IsExcluded added in v0.10.8

func (c *CollectHostTCPConnect) IsExcluded() (bool, error)

func (*CollectHostTCPConnect) Title added in v0.10.8

func (c *CollectHostTCPConnect) Title() string

type CollectHostTCPLoadBalancer added in v0.10.8

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

func (*CollectHostTCPLoadBalancer) Collect added in v0.10.8

func (c *CollectHostTCPLoadBalancer) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostTCPLoadBalancer) IsExcluded added in v0.10.8

func (c *CollectHostTCPLoadBalancer) IsExcluded() (bool, error)

func (*CollectHostTCPLoadBalancer) Title added in v0.10.8

type CollectHostTCPPortStatus added in v0.10.8

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

func (*CollectHostTCPPortStatus) Collect added in v0.10.8

func (c *CollectHostTCPPortStatus) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostTCPPortStatus) IsExcluded added in v0.10.8

func (c *CollectHostTCPPortStatus) IsExcluded() (bool, error)

func (*CollectHostTCPPortStatus) Title added in v0.10.8

func (c *CollectHostTCPPortStatus) Title() string

type CollectHostTime added in v0.10.8

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

func (*CollectHostTime) Collect added in v0.10.8

func (c *CollectHostTime) Collect(progressChan chan<- interface{}) (map[string][]byte, error)

func (*CollectHostTime) IsExcluded added in v0.10.8

func (c *CollectHostTime) IsExcluded() (bool, error)

func (*CollectHostTime) Title added in v0.10.8

func (c *CollectHostTime) Title() string

type Collector

type Collector struct {
	Collect      *troubleshootv1beta2.Collect
	Redact       bool
	RBACErrors   []error
	ClientConfig *rest.Config
	Namespace    string
}

func (*Collector) CheckRBAC added in v0.9.15

func (c *Collector) CheckRBAC(ctx context.Context) error

func (*Collector) GetDisplayName added in v0.9.5

func (c *Collector) GetDisplayName() string

func (*Collector) IsExcluded added in v0.9.52

func (c *Collector) IsExcluded() bool

checks if a given collector has a spec with 'exclude' that evaluates to true.

func (*Collector) RunCollectorSync

func (c *Collector) RunCollectorSync(clientConfig *rest.Config, client kubernetes.Interface, globalRedactors []*troubleshootv1beta2.Redact) (result map[string][]byte, err error)

type Collectors added in v0.9.15

type Collectors []*Collector

func (Collectors) CheckRBAC added in v0.9.15

func (cs Collectors) CheckRBAC(ctx context.Context) error

type ConfigMapOutput added in v0.13.3

type ConfigMapOutput struct {
	Namespace       string            `json:"namespace"`
	Name            string            `json:"name"`
	Key             string            `json:"key"`
	ConfigMapExists bool              `json:"configMapExists"`
	KeyExists       bool              `json:"keyExists"`
	Value           string            `json:"value,omitempty"`
	Data            map[string]string `json:"data,omitonempty"`
}

type DatabaseConnection added in v0.9.27

type DatabaseConnection struct {
	IsConnected bool   `json:"isConnected"`
	Error       string `json:"error,omitempty"`
	Version     string `json:"version,omitempty"`
}

type DiskUsageInfo added in v0.10.0

type DiskUsageInfo struct {
	TotalBytes uint64 `json:"total_bytes"`
	UsedBytes  uint64 `json:"used_bytes"`
}

type Durations added in v0.10.4

type Durations []time.Duration

func (Durations) Len added in v0.10.4

func (d Durations) Len() int

func (Durations) Less added in v0.10.4

func (d Durations) Less(i, j int) bool

func (Durations) Swap added in v0.10.4

func (d Durations) Swap(i, j int)

type FSPerfResults added in v0.10.4

func (FSPerfResults) String added in v0.10.18

func (f FSPerfResults) String() string

type HTTPError added in v0.10.2

type HTTPError struct {
	Message string `json:"message"`
}

type HTTPResponse added in v0.10.2

type HTTPResponse struct {
	Status  int               `json:"status"`
	Body    string            `json:"body"`
	Headers map[string]string `json:"headers"`
}

type HostCollector added in v0.10.0

type HostCollector interface {
	Title() string
	IsExcluded() (bool, error)
	Collect(progressChan chan<- interface{}) (map[string][]byte, error)
}

func GetHostCollector added in v0.10.8

func GetHostCollector(collector *troubleshootv1beta2.HostCollect) (HostCollector, bool)

type MemoryInfo added in v0.10.0

type MemoryInfo struct {
	Total uint64 `json:"total"`
}

type NTPStatus added in v0.10.2

type NTPStatus string

type NetworkStatus added in v0.10.0

type NetworkStatus string

type NetworkStatusResult added in v0.10.0

type NetworkStatusResult struct {
	Status  NetworkStatus `json:"status"`
	Message string        `json:"message"`
}

type RBACError added in v0.9.15

type RBACError struct {
	DisplayName string
	Namespace   string
	Resource    string
	Verb        string
}

func (RBACError) Error added in v0.9.15

func (e RBACError) Error() string

type RegistryImage added in v0.10.16

type RegistryImage struct {
	Exists bool   `json:"exists"`
	Error  string `json:"error,omitempty"`
}

type RegistryInfo added in v0.10.16

type RegistryInfo struct {
	Images map[string]RegistryImage `json:"images"`
}

type SecretOutput

type SecretOutput struct {
	Namespace    string `json:"namespace"`
	Name         string `json:"name"`
	Key          string `json:"key"`
	SecretExists bool   `json:"secretExists"`
	KeyExists    bool   `json:"keyExists"`
	Value        string `json:"value,omitempty"`
}

type ServiceInfo added in v0.10.15

type ServiceInfo struct {
	Unit   string `json:"Unit"`
	Load   string `json:"Load"`
	Active string `json:"Active"`
	Sub    string `json:"Sub"`
}

type TimeInfo added in v0.10.2

type TimeInfo struct {
	Timezone        string `json:"timezone"`
	NTPSynchronized bool   `json:"ntp_synchronized"`
	NTPActive       bool   `json:"ntp_active"`
}

Jump to

Keyboard shortcuts

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