load

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WindowsPerfMetricFile      = "C:\\Program Files\\New Relic\\newrelic-infra\\integrations.d\\vsphere-performance.metrics"
	LinuxDefaultPerfMetricFile = "/etc/newrelic-infra/integrations.d/vsphere-performance.metrics"
)

Variables

View Source
var Now = time.Now()

Functions

This section is empty.

Types

type ArgumentList

type ArgumentList struct {
	sdkArgs.DefaultArgumentList
	Local              bool   `default:"true" help:"Collect local entity info"`
	Entity             string `default:"" help:"Manually set a remote entity name"`
	URL                string `default:"" help:"Required: ESXi or vCenter SDK URL eg. https://172.16.53.129/sdk"`
	User               string `default:"" help:"Required: Username"`
	Pass               string `default:"" help:"Required: Password"`
	DatacenterLocation string `default:"" help:"Datacenter Location of your vCenter or ESXi Host eg. sydney-ultimo"`

	EnableVsphereEvents bool   `default:"false" help:"Set to collect vSphere events"`
	EventsPageSize      string `default:"100" help:"Number of events fetched from the vCenter in each call"`

	EnableVspherePerfMetrics bool   `default:"false" help:"Set to collect vSphere performance metrics"`
	PerfLevel                int    `default:"1" help:"Performance counter level of performance metrics that will be collected"`
	LogAvailableCounters     bool   `default:"false" help:"Print available performance metrics"`
	PerfMetricFile           string `default:"" help:"Location of performance metrics configuration file"`

	//As a general rule, specify between 10 and 50 entities in a single call to the QueryPerf method.
	//This is a general recommendation because your system configuration may impose different
	//constraints.
	//https://vdc-download.vmware.com/vmwb-repository/dcr-public/cdbbd51c-4824-4a1b-ad43-45df55a76a76/8cb3ed93-cac2-46aa-b329-db5a096af5bc/vsphere-web-services-sdk-67-programming-guide.pdf
	BatchSizePerfEntities string `default:"50" help:"Number of entities requested at the same time when querying performance metrics"`
	BatchSizePerfMetrics  string `default:"50" help:"Number of metrics requested at the same time when querying performance metrics"`

	EnableVsphereTags      bool `default:"false" help:"Set to collect tags. Tags are available when connecting to vcenter"`
	EnableVsphereSnapshots bool `default:"false" help:"Set to collect and process VMs Snapshots data"`
	ValidateSSL            bool `default:"false" help:"Set to validates SSL when connecting to vCenter or Esxi Host"`
	Version                bool `default:"false" help:"Set to print vSphere integration version and exit"`
}

ArgumentList Available Arguments

type Config

type Config struct {
	Args                 ArgumentList
	StartTime            int64                    // StartTime time Flex starts in Nanoseconds
	Integration          *integration.Integration // Integration Infrastructure SDK Integration
	Entity               *integration.Entity      // Entity Infrastructure SDK Entity
	Hostname             string                   // Hostname current host
	Logrus               *logrus.Logger           // Logrus create instance of the logger
	IntegrationName      string                   // IntegrationName name of integration
	IntegrationNameShort string                   // IntegrationNameShort Short Name
	IntegrationVersion   string                   // IntegrationVersion Version
	VMWareClient         *govmomi.Client          // VMWareClient Client
	VMWareClientRest     *rest.Client             // VMWareClientRest Client
	ViewManager          *view.Manager            // ViewManager Client
	TagsManager          *tags.Manager            // TagsManager Client
	Datacenters          []*Datacenter            // Datacenters VMWare
	TagsByID             TagsByID                 // Lists of tags by id
	IsVcenterAPIType     bool                     // IsVcenterAPIType true if connecting to vcenter
}

func NewConfig

func NewConfig(buildVersion string) *Config

type Datacenter

type Datacenter struct {
	Datacenter      *mo.Datacenter
	EventDispacher  *events.EventDispacher
	PerfCollector   *performance.PerfCollector
	Hosts           map[mor]*mo.HostSystem
	Clusters        map[mor]*mo.ClusterComputeResource
	ResourcePools   map[mor]*mo.ResourcePool
	Datastores      map[mor]*mo.Datastore
	Networks        map[mor]*mo.Network
	VirtualMachines map[mor]*mo.VirtualMachine
	Tags            map[mor][]Tag
	PerfMetrics     map[mor][]performance.PerfMetric

	PerfMetricsMux sync.Mutex
	// contains filtered or unexported fields
}

Datacenter struct

func NewDatacenter

func NewDatacenter(datacenter *mo.Datacenter) *Datacenter

NewDatacenter Initialize datacenter struct

func (*Datacenter) AddPerfMetrics added in v1.0.0

func (dc *Datacenter) AddPerfMetrics(data map[types.ManagedObjectReference][]performance.PerfMetric)

AddPerfMetrics appends a perfMetric batch to dc Tags map

func (*Datacenter) AddTags added in v1.0.0

func (dc *Datacenter) AddTags(tagsByObject map[mor][]Tag)

AddTags appends a tag batch to dc Tags map

func (*Datacenter) FindHost

func (dc *Datacenter) FindHost(computeResourceReference mor) *mo.HostSystem

FindHost returns the child Host for a computeResource

func (*Datacenter) FindResourcePool

func (dc *Datacenter) FindResourcePool(clusterReference mor) (rp []*mo.ResourcePool)

FindResourcePool finds the ResourcePool associated to a Cluster except for the default resource pool

func (*Datacenter) GetPerfMetrics added in v1.0.0

func (dc *Datacenter) GetPerfMetrics(ref mor) []performance.PerfMetric

GetPerfMetrics returns the slice of Perf metrics for the given object reference

func (*Datacenter) GetResourcePoolName

func (dc *Datacenter) GetResourcePoolName(resourcePoolReference mor) string

GetResourcePoolName returns the name of the Resource Pool if is not the default

func (*Datacenter) GetTagsByCategories added in v1.0.0

func (dc *Datacenter) GetTagsByCategories(ref mor) map[string]string

GetTagsByCategories return a map of tags categories and the corresponding tags associated to the mor

func (*Datacenter) IsDefaultResourcePool

func (dc *Datacenter) IsDefaultResourcePool(resourcePoolReference mor) bool

IsDefaultResourcePool returns true if the resource pool is the default

type Tag added in v1.0.0

type Tag struct {
	Name     string
	Category string
}

type TagsByID added in v1.0.0

type TagsByID map[string]Tag

TagsByID maps the tag ID with the Tag

Jump to

Keyboard shortcuts

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