Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = &Config{ Apibase: getApibase(), Root: "/var/lib/mackerel-agent", Pidfile: "/var/run/mackerel-agent.pid", Conffile: fmt.Sprintf("/etc/%s/%s.conf", getAgentName(), getAgentName()), Roles: []string{}, Verbose: false, Diagnostic: false, Connection: ConnectionConfig{ PostMetricsDequeueDelaySeconds: 30, PostMetricsRetryDelaySeconds: 60, PostMetricsRetryMax: 60, PostMetricsBufferSize: 6 * 60, }, }
DefaultConfig The default configuration for linux
var PostMetricsInterval = 1 * time.Minute
PostMetricsInterval XXX
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Apibase string Apikey string Root string Pidfile string Conffile string Roles []string Verbose bool Silent bool Diagnostic bool `toml:"diagnostic"` Connection ConnectionConfig DisplayName string `toml:"display_name"` HostStatus HostStatus `toml:"host_status"` Filesystems Filesystems `toml:"filesystems"` HTTPProxy string `toml:"http_proxy"` // Corresponds to the set of [plugin.<kind>.<name>] sections // the key of the map is <kind>, which should be one of "metrics" or "checks". Plugin map[string]PluginConfigs Include string // Cannot exist in configuration files HostIDStorage HostIDStorage }
Config represents mackerel-agent's configuration file.
func (*Config) CheckNames ¶ added in v0.16.0
CheckNames return list of plugin.checks._name_
func (*Config) DeleteSavedHostID ¶ added in v0.26.0
DeleteSavedHostID deletes the host id saved by SaveHostID.
func (*Config) LoadHostID ¶ added in v0.26.0
LoadHostID loads the previously saved host id.
func (*Config) SaveHostID ¶ added in v0.26.0
SaveHostID saves the host id, which may be restored by LoadHostID.
type ConnectionConfig ¶ added in v0.9.0
type ConnectionConfig struct { PostMetricsDequeueDelaySeconds int `toml:"post_metrics_dequeue_delay_seconds"` // delay for dequeuing from buffer queue PostMetricsRetryDelaySeconds int `toml:"post_metrics_retry_delay_seconds"` // delay for retrying a request that caused errors PostMetricsRetryMax int `toml:"post_metrics_retry_max"` // max numbers of retries for a request that causes errors PostMetricsBufferSize int `toml:"post_metrics_buffer_size"` // max numbers of requests stored in buffer queue. }
ConnectionConfig XXX
type FileSystemHostIDStorage ¶ added in v0.26.0
type FileSystemHostIDStorage struct {
Root string
}
FileSystemHostIDStorage is the default HostIDStorage which saves/loads the host id using an id file on the local filesystem. The file will be located at /var/lib/mackerel-agent/id by default on linux.
func (FileSystemHostIDStorage) DeleteSavedHostID ¶ added in v0.26.0
func (s FileSystemHostIDStorage) DeleteSavedHostID() error
DeleteSavedHostID deletes the mackerel-agent's id file.
func (FileSystemHostIDStorage) HostIDFile ¶ added in v0.26.0
func (s FileSystemHostIDStorage) HostIDFile() string
HostIDFile is the location of the host id file.
func (FileSystemHostIDStorage) LoadHostID ¶ added in v0.26.0
func (s FileSystemHostIDStorage) LoadHostID() (string, error)
LoadHostID loads the current host ID from the mackerel-agent's id file.
func (FileSystemHostIDStorage) SaveHostID ¶ added in v0.26.0
func (s FileSystemHostIDStorage) SaveHostID(id string) error
SaveHostID saves the host ID to the mackerel-agent's id file.
type Filesystems ¶ added in v0.28.0
type Filesystems struct { Ignore Regexpwrapper `toml:"ignore"` UseMountpoint bool `toml:"use_mountpoint"` }
Filesystems configure filesystem related settings
type HostIDStorage ¶ added in v0.26.0
type HostIDStorage interface { LoadHostID() (string, error) SaveHostID(id string) error DeleteSavedHostID() error }
HostIDStorage is an interface which maintains persistency of the "Host ID" for the current host where the agent is running on. The ID is always generated and given by Mackerel (mackerel.io).
type HostStatus ¶ added in v0.17.0
HostStatus configure host status on agent start/stop
type PluginConfig ¶
type PluginConfig struct { Command string User string NotificationInterval *int32 `toml:"notification_interval"` CheckInterval *int32 `toml:"check_interval"` MaxCheckAttempts *int32 `toml:"max_check_attempts"` CustomIdentifier *string `toml:"custom_identifier"` }
PluginConfig represents a section of [plugin.*]. `MaxCheckAttempts`, `NotificationInterval` and `CheckInterval` options are used with check monitoring plugins. Custom metrics plugins ignore these options. `User` option is ignore in windows
type PluginConfigs ¶
type PluginConfigs map[string]PluginConfig
PluginConfigs represents a set of [plugin.<kind>.<name>] sections in the configuration file under a specific <kind>. The key of the map is <name>, for example "mysql" of "plugin.metrics.mysql".
type Regexpwrapper ¶ added in v0.28.0
Regexpwrapper is a wrapper type for marshalling string
func (*Regexpwrapper) UnmarshalText ¶ added in v0.28.0
func (r *Regexpwrapper) UnmarshalText(text []byte) error
UnmarshalText for compiling regexp string while loading toml