exporter

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BandAC      = Band("5")
	BandBGN     = Band("2.4")
	BandUnknown = Band("unknown")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APGroupAPIResponse

type APGroupAPIResponse struct {
	Name             string `json:"name"`
	DevicesCount     int    `json:"deviceCount"`
	DevicesOffline   int    `json:"offlineCount"`
	DevicesOutOfSync int    `json:"outOfSyncCount"`
	ClientCount      int    `json:"clientCount"`
	ClientCount24H   int    `json:"clientCount24h"`
}

type Band

type Band string

type Client

type Client struct {
	Username string
	Password string
	Instance string
	// contains filtered or unexported fields
}

func LoadClientConfig

func LoadClientConfig(file string, verbose bool) (*Client, error)

LoadClientConfig loads the configuration from a file and initializes the client.

func (*Client) Start

func (c *Client) Start(listenAddress, version string) error

type Collector

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

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

func (*Collector) Describe

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

type Device

type Device struct {
	Model           string
	MAC             string
	Serial          string
	SiteName        string
	Hostname        string
	FirmwareVersion string
	Uptime          *time.Time
	Downtime        *time.Time
	LastRebootAt    *time.Time
	RebootReason    string
	Radios          []Radio
}

Device holds basic metrics for a single WiFi AP. It is constructed from a DeviceAPIResponse.

type DeviceAPIResponse

type DeviceAPIResponse struct {
	Model    string `json:"model"`
	MAC      string `json:"mac"`
	Serial   string `json:"sn"`
	SiteName string `json:"tid"`

	Config struct {
		Name string `json:"name"`
	} `json:"cfg"`

	System struct {
		Online   bool             `json:"online"`
		UpTime   int64            `json:"upTime"`
		DownTime int64            `json:"dnTime"`
		Reboots  []rebootResponse `json:"lastRbt"`
	} `json:"sys"`

	Management struct {
		FirmwareVersion string `json:"actSw"`
	} `json:"mgmt"`

	Radios []radioResponse `json:"radios"`
}

DeviceAPIResponse holds the data returned from the controller's device endpoint.

func (*DeviceAPIResponse) Normalize

func (api *DeviceAPIResponse) Normalize() *Device

type PortalAPIResponse added in v0.4.0

type PortalAPIResponse struct {
	Name string `json:"name"`
}

PortalAPIResponse is returned when asking the API for a list of "Guest Access Portals". It also contains a JSON-encoded config string (yes, double JSON). We've elected to omit this it here.

type PortalCollector added in v0.4.0

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

func (*PortalCollector) Collect added in v0.4.0

func (c *PortalCollector) Collect(ch chan<- prometheus.Metric)

func (*PortalCollector) Describe added in v0.4.0

func (p *PortalCollector) Describe(ch chan<- *prometheus.Desc)

type PortalSession added in v0.4.0

type PortalSession struct {
	DeviceMAC  string
	PortalName string
	Sessions   int
}

type Radio

type Radio struct {
	Band         Band
	Channel      int // channel number
	ChannelWidth int // in MHz
	Power        int
	Quality      int // 0..100
	Rx           int // average rate in kbps
	Tx           int // average rate in kbps
}

type SessionsAPIResponse added in v0.4.0

type SessionsAPIResponse struct {
	Meta struct {
		Limit  int `json:"limit"`
		Offset int `json:"offset"`
		Total  int `json:"totalCount"`
	} `json:"_metadata"`

	Sessions []struct {
		DeviceMAC string `json:"apMAC"`
	} `json:"result"`
}

Jump to

Keyboard shortcuts

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