mackerel

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2014 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = &Config{
	Apibase: "https://mackerel.io",
	Root:    "/var/lib/mackerel-agent",
	Pidfile: "/var/run/mackerel-agent.pid",
	Roles:   []string{},
	Verbose: false,
}

Functions

func IdFilePath

func IdFilePath(root string) string

func LoadHostId

func LoadHostId(root string) (string, error)

func SaveHostId

func SaveHostId(root string, id string) error

Types

type API

type API struct {
	BaseUrl *url.URL
	ApiKey  string
	Verbose bool
}

func NewApi

func NewApi(rawurl string, apiKey string, verbose bool) (*API, error)

func (*API) CreateHost

func (api *API) CreateHost(name string, meta map[string]interface{}, interfaces []map[string]interface{}, roleFullnames []string) (string, error)

func (*API) Do

func (api *API) Do(req *http.Request) (resp *http.Response, err error)

func (*API) FindHost

func (api *API) FindHost(id string) (*Host, error)

func (*API) PostMetricsValues

func (api *API) PostMetricsValues(metricsValues [](*CreatingMetricsValue)) error

func (*API) UpdateHost

func (api *API) UpdateHost(hostId string, name string, meta map[string]interface{}, interfaces []map[string]interface{}, roleFullnames []string) error

type Config

type Config struct {
	Apibase         string
	Apikey          string
	Root            string
	Pidfile         string
	Roles           []string
	Verbose         bool
	Plugin          map[string]PluginConfigs
	DeprecatedSensu map[string]PluginConfigs `toml:"sensu"` // DEPRECATED this is for backward compatibility
}

func LoadConfig

func LoadConfig(conffile string) (Config, error)

func LoadConfigFile

func LoadConfigFile(file string) (Config, error)

type CreatingMetricsValue

type CreatingMetricsValue struct {
	HostId string      `json:"hostId"`
	Name   string      `json:"name"`
	Time   float64     `json:"time"`
	Value  interface{} `json:"value"`
}

type Host

type Host struct {
	Id     string `json:"id"`
	Name   string `json:"name"`
	Type   string `json:"type"` // TODO ENUM
	Status string `json:"status"`
}

type Metrics

type Metrics struct {
	Id     string `json:"id"`
	HostId string `json:"hostId"`
	Name   string `json:"name"`
}

type PluginConfig

type PluginConfig struct {
	Command string
}

type PluginConfigs

type PluginConfigs map[string]PluginConfig

Jump to

Keyboard shortcuts

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