config

package
v0.0.0-...-888c057 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadS3Config

func LoadS3Config(p client.ConfigProvider, s3Bucket, s3Key string) (*mkconf.Config, error)

Types

type AgentConfig

type AgentConfig struct {
	*state.HostState
	Env
	CheckRules map[string]CheckRule
	*state.Manager

	APIKey string
	// contains filtered or unexported fields
}

AgentConfig is agent config struct.

func NewAgentConfig

func NewAgentConfig(s store.Store, p client.ConfigProvider) (*AgentConfig, error)

NewAgentConfig load config from env.

func (*AgentConfig) GetHost

func (a *AgentConfig) GetHost() error

func (*AgentConfig) LoadAgentConfig

func (a *AgentConfig) LoadAgentConfig(p client.ConfigProvider, s3Bucket, s3Key string) error

type Check

type Check struct {
	Name string `json:"name"`
	Memo string `json:"memo"`
}

Check mackerel check info.

type CheckPluginParams

type CheckPluginParams struct {
	Rule      CheckRule        `json:"rule"`
	HostState *state.HostState `json:"state"`
}

type CheckRule

type CheckRule struct {
	Name                  string        `json:"name"` // Primary key
	PluginType            string        `json:"pluginType"`
	Command               string        `json:"command"`
	Env                   []string      `json:"env"`
	Timeout               time.Duration `json:"timeout"`
	PreventAlertAutoClose bool          `json:"preventAlertAutoClose"`
	CheckInterval         int           `json:"checkInterval"`
	Memo                  string        `json:"memo"`
	CustomIdentifier      string        `json:"customIdentifier"`
	NotificationInterval  uint          `json:"notificationInterval"` // <- Post report
	MaxCheckAttempts      uint          `json:"maxCheckAttempts"`     // <- Post report
}

CheckRule rule of check Plugin.

type Env

type Env struct {
	StateTable   string `default:"mackerel-awslambda-state"`
	StateTTLDays int    `default:"90"`
	S3Key        string `default:"mackerel.toml"`
	S3Bucket     string
	Hostname     string `default:"hostname"`
	Organization string `default:"organization"`
	TempDir      string `default:""`
	CheckerFunc  string
}

Env config of mackerel-awslambda-agent.

type Host

type Host struct {
	ID            string  `json:"id" default:"hostname"` // Primary key
	Hostname      string  `json:"hostname"`
	SourceType    string  `json:"sourceType" default:"host"`
	TargetRegion  string  `json:"targetRegion"`
	AssumeRoleARN string  `json:"assumeRoleArn"`
	Checks        []Check `json:"checks" dynamodbav:"checks"` // '[{"name":"checkName","memo":""},...]'
}

Host mackerel check host info.

Jump to

Keyboard shortcuts

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