collectdvsphere

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2019 License: MIT Imports: 14 Imported by: 0

README

collectd-vsphere Build Status

Collects metrics from vSphere and sends them to collectd.

Metrics

  • host/vsphere/operations-power_on_success: number of successful VM power on events
  • host/vsphere/operations-power_on_failure: number of failed VM power on events
  • host/vsphere/operations-power_off_success: number of successful VM power off events
  • host/vsphere/operations-power_off_failure: number of failed VM power off events
  • base-vm/vsphere/operations-clone_success: number of successful VM clone events
  • base-vm/vsphere/operations-clone_failure: number of failed VM clone events

Config

Make sure to set up the network plugin in collectd.

export VSPHERE_URL="https://user:password@vsphere/sdk"
export VSPHERE_INSECURE="false" # or "true" if you need
export VSPHERE_CLUSTER="/MyDC/host/MyCluster/"
export COLLECTD_HOSTPORT="127.0.0.1:12345"
export COLLECTD_USERNAME="some-username"
export COLLECTD_PASSWORD="some-password"

License

See LICENSE file.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StatsCollector

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

A StatsCollector stores various stats that are sent to it and allows you to fetch metrics based on them.

func NewStatsCollector

func NewStatsCollector(writer api.Writer, interval time.Duration, logger logrus.FieldLogger, collectdPluginInstance string) *StatsCollector

NewStatsCollector returns a new StatsCollector with no stats, which writes its stats to the given api.Writer every interval.

func (*StatsCollector) MarkCloneFailure

func (c *StatsCollector) MarkCloneFailure(baseVMName string)

MarkCloneFailure increases the number of failed clones of a base VM with a given name.

func (*StatsCollector) MarkCloneSuccess

func (c *StatsCollector) MarkCloneSuccess(baseVMName string)

MarkCloneSuccess increases the number of successful clones of a base VM with a given name.

func (*StatsCollector) MarkPowerOffFailure

func (c *StatsCollector) MarkPowerOffFailure(hostname string)

MarkPowerOffFailure increases the number of failed VM power-off events on a host with a given hostname.

func (*StatsCollector) MarkPowerOffSuccess

func (c *StatsCollector) MarkPowerOffSuccess(hostname string)

MarkPowerOffSuccess increases the number of successful VM power-off events on a host with a given hostname.

func (*StatsCollector) MarkPowerOnFailure

func (c *StatsCollector) MarkPowerOnFailure(hostname string)

MarkPowerOnFailure increases the number of failed VM power-on events on a host with a given hostname.

func (*StatsCollector) MarkPowerOnSuccess

func (c *StatsCollector) MarkPowerOnSuccess(hostname string)

MarkPowerOnSuccess increases the number of successful VM power-on events on a host with a given hostname.

type VSphereConfig

type VSphereConfig struct {
	URL          *url.URL
	Insecure     bool
	ClusterPaths []string
	BaseVMPaths  []string
}

A VSphereConfig provides configuration for a VSphereEventListener

type VSphereEventListener

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

VSphereEventListener connects to a vSphere API and listens for certain events, reporting them to a StatsCollector

func NewVSphereEventListener

func NewVSphereEventListener(config VSphereConfig, statsCollector *StatsCollector, logger logrus.FieldLogger) *VSphereEventListener

NewVSphereEventListener creates a VSphereEventListener with a given configuration. Call Start on the event listener to start listening and reporting to the given stats collector.

func (*VSphereEventListener) Start

func (l *VSphereEventListener) Start(ctx context.Context) error

Start starts the event listener and begins reporting stats to the StatsCollector.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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