external

package
v0.0.0-...-b28dce8 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2017 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package external is a generated protocol buffer package.

It is generated from these files:

github.com/google/cloudprober/probes/external/config.proto

It has these top-level messages:

ProbeConf

Package external implements an external probe type for cloudprober.

External probe type executes an external process for actual probing. These probes can have two modes: "once" and "server". In "once" mode, the external process is started for each probe run cycle, while in "server" mode, external process is started only if it's not running already and Cloudprober communicates with it over stdin/stdout for each probe cycle.

TODO: Add a way to test this program. Write another program that implements the probe server protocol and use that for testing.

Index

Constants

View Source
const Default_ProbeConf_IpVersion int32 = 4
View Source
const Default_ProbeConf_OutputAsMetrics bool = true

Variables

View Source
var ProbeConf_MetricsKind_name = map[int32]string{
	0: "UNDEFINED",
	1: "GAUGE",
	2: "CUMULATIVE",
}
View Source
var ProbeConf_MetricsKind_value = map[string]int32{
	"UNDEFINED":  0,
	"GAUGE":      1,
	"CUMULATIVE": 2,
}
View Source
var ProbeConf_Mode_name = map[int32]string{
	0: "ONCE",
	1: "SERVER",
}
View Source
var ProbeConf_Mode_value = map[string]int32{
	"ONCE":   0,
	"SERVER": 1,
}

Functions

This section is empty.

Types

type Probe

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

Probe holds aggregate information about all probe runs, per-target.

func (*Probe) Init

func (p *Probe) Init(name string, tgts targets.Targets, interval, timeout time.Duration, l *logger.Logger, v interface{}) error

Init initializes the probe with the given params.

func (*Probe) Start

func (p *Probe) Start(ctx context.Context, dataChan chan *metrics.EventMetrics)

Start starts and runs the probe indefinitely.

type ProbeConf

type ProbeConf struct {
	Mode *ProbeConf_Mode `protobuf:"varint,1,opt,name=mode,enum=cloudprober.probes.external.ProbeConf_Mode,def=0" json:"mode,omitempty"`
	// Command.  For ONCE probes, arguments are processed for the following field
	// substitutions:
	// @probe@    Name of the probe
	// @target@   Hostname of the target
	// @address@  IP address of the target
	//
	// For example, for target ig-us-central1-a, /tools/recreate_vm -vm @target@
	// will get converted to: /tools/recreate_vm -vm ig-us-central1-a
	Command *string             `protobuf:"bytes,2,req,name=command" json:"command,omitempty"`
	Options []*ProbeConf_Option `protobuf:"bytes,3,rep,name=options" json:"options,omitempty"`
	// Export output as metrics, where output is the output returned by the
	// external probe process, over stdout for ONCE probes, and through ProbeReply
	// for SERVER probes. Cloudprober expects variables to be in the following
	// format in the output:
	// var1 value1 (for example: total_errors 589)
	OutputAsMetrics   *bool                  `protobuf:"varint,4,opt,name=output_as_metrics,json=outputAsMetrics,def=1" json:"output_as_metrics,omitempty"`
	OutputMetricsKind *ProbeConf_MetricsKind `` /* 163-byte string literal not displayed */
	// Additional labels (comma-separated) to attach to the output metrics, e.g.
	// "region=us-east1,zone=us-east1-d".
	OutputMetricsLabels *string `protobuf:"bytes,6,opt,name=output_metrics_labels,json=outputMetricsLabels" json:"output_metrics_labels,omitempty"`
	// IP version: For target resolution
	IpVersion        *int32 `protobuf:"varint,100,opt,name=ip_version,json=ipVersion,def=4" json:"ip_version,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*ProbeConf) Descriptor

func (*ProbeConf) Descriptor() ([]byte, []int)

func (*ProbeConf) GetCommand

func (m *ProbeConf) GetCommand() string

func (*ProbeConf) GetIpVersion

func (m *ProbeConf) GetIpVersion() int32

func (*ProbeConf) GetMode

func (m *ProbeConf) GetMode() ProbeConf_Mode

func (*ProbeConf) GetOptions

func (m *ProbeConf) GetOptions() []*ProbeConf_Option

func (*ProbeConf) GetOutputAsMetrics

func (m *ProbeConf) GetOutputAsMetrics() bool

func (*ProbeConf) GetOutputMetricsKind

func (m *ProbeConf) GetOutputMetricsKind() ProbeConf_MetricsKind

func (*ProbeConf) GetOutputMetricsLabels

func (m *ProbeConf) GetOutputMetricsLabels() string

func (*ProbeConf) ProtoMessage

func (*ProbeConf) ProtoMessage()

func (*ProbeConf) Reset

func (m *ProbeConf) Reset()

func (*ProbeConf) String

func (m *ProbeConf) String() string

type ProbeConf_MetricsKind

type ProbeConf_MetricsKind int32

MetricsKind specifies whether to treat output metrics as GAUGE or CUMULATIVE. If left unspecified, metrics from ONCE mode probes are treated as GAUGE and metrics from SERVER mode probes are treated as CUMULATIVE.

const (
	ProbeConf_UNDEFINED  ProbeConf_MetricsKind = 0
	ProbeConf_GAUGE      ProbeConf_MetricsKind = 1
	ProbeConf_CUMULATIVE ProbeConf_MetricsKind = 2
)

func (ProbeConf_MetricsKind) Enum

func (ProbeConf_MetricsKind) EnumDescriptor

func (ProbeConf_MetricsKind) EnumDescriptor() ([]byte, []int)

func (ProbeConf_MetricsKind) String

func (x ProbeConf_MetricsKind) String() string

func (*ProbeConf_MetricsKind) UnmarshalJSON

func (x *ProbeConf_MetricsKind) UnmarshalJSON(data []byte) error

type ProbeConf_Mode

type ProbeConf_Mode int32

External probes support two mode: ONCE and SERVER. In ONCE mode, external command is re-executed for each probe run, while in SERVER mode, command is run in server mode, re-executed only if not running already.

const (
	ProbeConf_ONCE   ProbeConf_Mode = 0
	ProbeConf_SERVER ProbeConf_Mode = 1
)
const Default_ProbeConf_Mode ProbeConf_Mode = ProbeConf_ONCE

func (ProbeConf_Mode) Enum

func (x ProbeConf_Mode) Enum() *ProbeConf_Mode

func (ProbeConf_Mode) EnumDescriptor

func (ProbeConf_Mode) EnumDescriptor() ([]byte, []int)

func (ProbeConf_Mode) String

func (x ProbeConf_Mode) String() string

func (*ProbeConf_Mode) UnmarshalJSON

func (x *ProbeConf_Mode) UnmarshalJSON(data []byte) error

type ProbeConf_Option

type ProbeConf_Option struct {
	Name             *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value            *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

Options for the SERVER mode probe requests. These options are passed on the external probe server as part of the ProbeRequest. Values are substituted similar to command arguments for the ONCE mode probes.

func (*ProbeConf_Option) Descriptor

func (*ProbeConf_Option) Descriptor() ([]byte, []int)

func (*ProbeConf_Option) GetName

func (m *ProbeConf_Option) GetName() string

func (*ProbeConf_Option) GetValue

func (m *ProbeConf_Option) GetValue() string

func (*ProbeConf_Option) ProtoMessage

func (*ProbeConf_Option) ProtoMessage()

func (*ProbeConf_Option) Reset

func (m *ProbeConf_Option) Reset()

func (*ProbeConf_Option) String

func (m *ProbeConf_Option) String() string

Directories

Path Synopsis
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
This program implements a stand-alone external prober binary using the cloudprober/probes/external package.
Package serverutils is a generated protocol buffer package.
Package serverutils is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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