app

package
v0.0.0-...-1587814 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(data []byte, passphrase string) ([]byte, error)

Decrypt decrypts data using the passphrase.

func Encrypt

func Encrypt(data []byte, passphrase string) ([]byte, error)

Encrypt encrypts data using the passphrase.

func GenTemplate

func GenTemplate(tags []string, Age time.Duration, tplate string) error

GenTemplate creates a template for use with single time ingestion / manual reset

func SensorWarn

func SensorWarn(inErr error, er bool)

SensorWarn is used to return an error via PRTG message

Types

type Check

type Check struct {
	ID          string     `xml:"id,attr,omitempty"`
	Kind        string     `xml:"kind,attr,omitempty"`
	Meta        string     `xml:"meta,attr,omitempty"`
	Requires    string     `xml:"requires,attr,omitempty"`
	Metadata    Metadata   `xml:"metadata,omitempty"`
	Createdata  Createdata `xml:"createdata,omitempty"`
	Displayname string     `xml:"displayname,attr,omitempty"`
}

Check xml template

type Client

type Client struct {
	Cached bool
	// contains filtered or unexported fields
}

Client holds the connections we need to query the remote system

func NewClient

func NewClient(u *url.URL, user, pw string, cache bool) (c Client, err error)

NewClient returns a logged in client

func (*Client) DsSummary

func (c *Client) DsSummary(name, moid string, lim *LimitsStruct, js bool) (err error)

DsSummary stats for a datastore

func (*Client) DynTemplate

func (c *Client) DynTemplate(tags []string, Age time.Duration, tplate string) error

DynTemplate creates a template for regular ingestion by PRTG

func (*Client) HostSummary

func (c *Client) HostSummary(name, moid string, js bool) (err error)

HostSummary stats for a host system

func (*Client) Logout

func (c *Client) Logout() error

Logout of remote system

func (*Client) Metascan

func (c *Client) Metascan(tags []string, tm *TagMap, Age time.Duration) (err error)

Metascan returns template data to PRTG for given tags

func (*Client) Metrics

func (c *Client) Metrics(mor types.ManagedObjectReference, pr *prtgData, str []string, interval int32) (err error)

Metrics returns metrics for a given object

func (*Client) SnapShotsOlderThan

func (c *Client) SnapShotsOlderThan(f property.Filter, tagIds []string, lim *LimitsStruct, age time.Duration, txt bool) (err error)

SnapShotsOlderThan tag focused snapshot reporting

func (*Client) VMSummary

func (c *Client) VMSummary(name, moid string, lim *LimitsStruct, age time.Duration, txt bool, sensors []string) error

VMSummary stats for a VM

func (*Client) VdsSummary

func (c *Client) VdsSummary(name, moid string, js bool) (err error)

VdsSummary stats for a VDS

type Createdata

type Createdata struct {
	Priority           string `xml:"priority,omitempty"`
	Position           string `xml:"position,omitempty"`
	Interval           string `xml:"interval,omitempty"`
	Count              string `xml:"count,omitempty"`
	Errorintervalsdown string `xml:"errorintervalsdown,omitempty"`
	Autoacknowledge    string `xml:"autoacknowledge,omitempty"`
	Tags               string `xml:"tags,omitempty"`
	Timeout            string `xml:"timeout,omitempty"`
	Exefile            string `xml:"exefile,omitempty"`
	Exeparams          string `xml:"exeparams,omitempty"`
	Name               string `xml:"name,omitempty"`
	Mutex              string `xml:"mutexname,omitempty"`
	Decimaldigits      string `xml:"decimaldigits,omitempty"`
}

Createdata xml template

type Devicetemplate

type Devicetemplate struct {
	XMLName  xml.Name `xml:"devicetemplate"`
	Text     string   `xml:",chardata"`
	ID       string   `xml:"id,attr"`
	Name     string   `xml:"name,attr"`
	Priority string   `xml:"priority,attr"`
	Check    Check    `xml:"check,omitempty"`
	Create   []Check  `xml:"create,omitempty"`
}

Devicetemplate xml template

func NewDeviceTemplate

func NewDeviceTemplate(Age time.Duration, Tags string) *Devicetemplate

NewDeviceTemplate creates a new base template

type Item

type Item struct {
	Name            string `xml:"name,omitempty"`
	ID              string `xml:"id,omitempty"`
	Exefile         string `xml:"exefile"`
	Params          string `xml:"params"`
	Displayname     string `xml:"displayname,attr,omitempty"`
	Autoacknowledge string `xml:"autoacknowledge,attr,omitempty"`
}

Item is used in templates

type LimitsStruct

type LimitsStruct struct {
	MinWarn, MaxWarn, MinErr, MaxErr, WarnMsg, ErrMsg string
}

LimitsStruct is used to set error and warning levels

type Metadata

type Metadata struct {
	Exefile   string `xml:"exefile,omitempty"`
	Exeparams string `xml:"exeparams,omitempty"`
}

Metadata xml template

type TagMap

type TagMap struct {
	Data map[string]objData
	// contains filtered or unexported fields
}

TagMap holds a map of tag to object data

func NewTagMap

func NewTagMap() *TagMap

NewTagMap instantiates a new map to sore tag info

Jump to

Keyboard shortcuts

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