collector

package
v0.0.0-...-9c96582 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Metric
}

func NewCounter

func NewCounter(desc *prometheus.Desc) *Counter

func (*Counter) Set

func (c *Counter) Set(ch chan<- prometheus.Metric, value float64, labels ...string)

type Gauge

type Gauge struct {
	Metric
}

func NewGauge

func NewGauge(desc *prometheus.Desc) *Gauge

func (*Gauge) Set

func (g *Gauge) Set(ch chan<- prometheus.Metric, value float64, labels ...string)

type GetOrganizationDevicesStatuses200Response

type GetOrganizationDevicesStatuses200Response struct {
	// Device Name
	Name *string `json:"name,omitempty"`
	// Device Serial Number
	Serial *string `json:"serial,omitempty"`
	// MAC Address
	Mac *string `json:"mac,omitempty"`
	// Public IP Address
	PublicIp *string `json:"publicIp,omitempty"`
	// Network ID
	NetworkId *string `json:"networkId,omitempty"`
	// Device Status
	Status *string `json:"status,omitempty"`
	// Device Last Reported Location
	LastReportedAt *string `json:"lastReportedAt,omitempty"`
	// LAN IP Address
	LanIp *string `json:"lanIp,omitempty"`
	// IP Gateway
	Gateway *string `json:"gateway,omitempty"`
	// IP Type
	IpType *string `json:"ipType,omitempty"`
	// Primary DNS
	PrimaryDns *string `json:"primaryDns,omitempty"`
	// Secondary DNS
	SecondaryDns *string `json:"secondaryDns,omitempty"`
	// Product Type
	ProductType *string                `json:"productType,omitempty"`
	Components  map[string]interface{} `json:"components,omitempty"`
	// Model
	Model *string `json:"model,omitempty"`
	// Tags
	Tags []string `json:"tags,omitempty"`
}

GetOrganizationDevicesStatuses200Response struct for GetOrganizationDevicesStatuses200Response

func (*GetOrganizationDevicesStatuses200Response) GetGateway

GetGateway returns the Gateway field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetGatewayOk

GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetIpType

GetIpType returns the IpType field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetIpTypeOk

GetIpTypeOk returns a tuple with the IpType field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetLanIp

GetLanIp returns the LanIp field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetLanIpOk

GetLanIpOk returns a tuple with the LanIp field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetLastReportedAt

func (o *GetOrganizationDevicesStatuses200Response) GetLastReportedAt() string

GetLastReportedAt returns the LastReportedAt field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetLastReportedAtOk

func (o *GetOrganizationDevicesStatuses200Response) GetLastReportedAtOk() (*string, bool)

GetLastReportedAtOk returns a tuple with the LastReportedAt field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetMac

GetMac returns the Mac field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetMacOk

GetMacOk returns a tuple with the Mac field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetModel

GetModel returns the Model field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetModelOk

GetModelOk returns a tuple with the Model field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetName

GetName returns the Name field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetNameOk

GetNameOk returns a tuple with the Name field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetNetworkId

GetNetworkId returns the NetworkId field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetNetworkIdOk

func (o *GetOrganizationDevicesStatuses200Response) GetNetworkIdOk() (*string, bool)

GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetPrimaryDns

GetPrimaryDns returns the PrimaryDns field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetPrimaryDnsOk

func (o *GetOrganizationDevicesStatuses200Response) GetPrimaryDnsOk() (*string, bool)

GetPrimaryDnsOk returns a tuple with the PrimaryDns field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetProductType

GetProductType returns the ProductType field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetProductTypeOk

func (o *GetOrganizationDevicesStatuses200Response) GetProductTypeOk() (*string, bool)

GetProductTypeOk returns a tuple with the ProductType field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetPublicIp

GetPublicIp returns the PublicIp field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetPublicIpOk

func (o *GetOrganizationDevicesStatuses200Response) GetPublicIpOk() (*string, bool)

GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetSecondaryDns

GetSecondaryDns returns the SecondaryDns field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetSecondaryDnsOk

func (o *GetOrganizationDevicesStatuses200Response) GetSecondaryDnsOk() (*string, bool)

GetSecondaryDnsOk returns a tuple with the SecondaryDns field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetSerial

GetSerial returns the Serial field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetSerialOk

GetSerialOk returns a tuple with the Serial field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetStatus

GetStatus returns the Status field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetStatusOk

GetStatusOk returns a tuple with the Status field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) GetTags

GetTags returns the Tags field value if set, zero value otherwise.

func (*GetOrganizationDevicesStatuses200Response) GetTagsOk

GetTagsOk returns a tuple with the Tags field value if set, nil otherwise and a boolean to check if the value has been set.

func (*GetOrganizationDevicesStatuses200Response) HasComponents

HasComponents returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasGateway

HasGateway returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasIpType

HasIpType returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasLanIp

HasLanIp returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasLastReportedAt

func (o *GetOrganizationDevicesStatuses200Response) HasLastReportedAt() bool

HasLastReportedAt returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasMac

HasMac returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasModel

HasModel returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasName

HasName returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasNetworkId

HasNetworkId returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasPrimaryDns

HasPrimaryDns returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasProductType

func (o *GetOrganizationDevicesStatuses200Response) HasProductType() bool

HasProductType returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasPublicIp

HasPublicIp returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasSecondaryDns

func (o *GetOrganizationDevicesStatuses200Response) HasSecondaryDns() bool

HasSecondaryDns returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasSerial

HasSerial returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasStatus

HasStatus returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) HasTags

HasTags returns a boolean if a field has been set.

func (*GetOrganizationDevicesStatuses200Response) SetGateway

SetGateway gets a reference to the given string and assigns it to the Gateway field.

func (*GetOrganizationDevicesStatuses200Response) SetIpType

SetIpType gets a reference to the given string and assigns it to the IpType field.

func (*GetOrganizationDevicesStatuses200Response) SetLanIp

SetLanIp gets a reference to the given string and assigns it to the LanIp field.

func (*GetOrganizationDevicesStatuses200Response) SetLastReportedAt

func (o *GetOrganizationDevicesStatuses200Response) SetLastReportedAt(v string)

SetLastReportedAt gets a reference to the given string and assigns it to the LastReportedAt field.

func (*GetOrganizationDevicesStatuses200Response) SetMac

SetMac gets a reference to the given string and assigns it to the Mac field.

func (*GetOrganizationDevicesStatuses200Response) SetModel

SetModel gets a reference to the given string and assigns it to the Model field.

func (*GetOrganizationDevicesStatuses200Response) SetName

SetName gets a reference to the given string and assigns it to the Name field.

func (*GetOrganizationDevicesStatuses200Response) SetNetworkId

SetNetworkId gets a reference to the given string and assigns it to the NetworkId field.

func (*GetOrganizationDevicesStatuses200Response) SetPrimaryDns

SetPrimaryDns gets a reference to the given string and assigns it to the PrimaryDns field.

func (*GetOrganizationDevicesStatuses200Response) SetProductType

SetProductType gets a reference to the given string and assigns it to the ProductType field.

func (*GetOrganizationDevicesStatuses200Response) SetPublicIp

SetPublicIp gets a reference to the given string and assigns it to the PublicIp field.

func (*GetOrganizationDevicesStatuses200Response) SetSecondaryDns

func (o *GetOrganizationDevicesStatuses200Response) SetSecondaryDns(v string)

SetSecondaryDns gets a reference to the given string and assigns it to the SecondaryDns field.

func (*GetOrganizationDevicesStatuses200Response) SetSerial

SetSerial gets a reference to the given string and assigns it to the Serial field.

func (*GetOrganizationDevicesStatuses200Response) SetStatus

SetStatus gets a reference to the given string and assigns it to the Status field.

func (*GetOrganizationDevicesStatuses200Response) SetTags

SetTags gets a reference to the given []string and assigns it to the Tags field.

type MerakiCollector

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

func NewMerakiCollector

func NewMerakiCollector(config ...func(*MerakiCollectorConfig)) *MerakiCollector

Declare your exporter metrics here. Referred to as "collectors"

func (*MerakiCollector) Collect

func (m *MerakiCollector) Collect(ch chan<- prometheus.Metric)

This fuction runs when Prometheus scrapes the exporter. It will set a new value for the metric(s) I have no idea how it works, but it does.

func (*MerakiCollector) Describe

func (m *MerakiCollector) Describe(ch chan<- *prometheus.Desc)

func (*MerakiCollector) GetDevices

func (m *MerakiCollector) GetDevices(ctx context.Context, network meraki.UnbindNetwork200Response) ([]map[string]interface{}, error)

Get all devices for a network

func (*MerakiCollector) GetDevicesStatus

GetDevicesStatus will return the status of all devices for an organization

func (*MerakiCollector) GetNetworks

GetNetworks will return all networks for the given organization

func (*MerakiCollector) GetOrganizations

Fetch all organizations

func (*MerakiCollector) GetSwitchPorts

func (m *MerakiCollector) GetSwitchPorts(ctx context.Context, serial string) ([]map[string]interface{}, error)

GetSwitchPorts will return switch ports https://developer.cisco.com/meraki/api-latest/#!get-device-switch-ports

func (*MerakiCollector) GetSwitchPortsStatus

func (m *MerakiCollector) GetSwitchPortsStatus(ctx context.Context, serial string) ([]map[string]interface{}, error)

GetSwitchPortsStatus will return switch port statuses

type MerakiCollectorConfig

type MerakiCollectorConfig struct {
	Host   string
	ApiKey string
	Debug  bool
	Scheme string
}

MerakiCollectorConfig defines configuration options for the Meraki Collector

type Metric

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

func NewMetric

func NewMetric(desc *prometheus.Desc) *Metric

type Settable

type Settable interface {
	Set(ch chan<- prometheus.Metric, value float64, labels ...string)
}

Jump to

Keyboard shortcuts

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