Documentation ¶
Overview ¶
Package unifiexporter provides the Exporter type used in the unifi_exporter Prometheus exporter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFunc ¶
A ClientFunc is a function which can return an authenticated UniFi client. A ClientFunc is invoked by an Exporter whenever authentication against a UniFi controller fails, such as when a user's privileges are revoked or the authenticated session times out.
type DeviceCollector ¶
type DeviceCollector struct { Devices *prometheus.Desc AdoptedDevices *prometheus.Desc UnadoptedDevices *prometheus.Desc UptimeSecondsTotal *prometheus.Desc WirelessReceivedBytesTotal *prometheus.Desc WirelessTransmittedBytesTotal *prometheus.Desc WirelessReceivedPacketsTotal *prometheus.Desc WirelessTransmittedPacketsTotal *prometheus.Desc WirelessTransmittedDroppedTotal *prometheus.Desc WiredReceivedBytesTotal *prometheus.Desc WiredTransmittedBytesTotal *prometheus.Desc WiredReceivedPacketsTotal *prometheus.Desc WiredTransmittedPacketsTotal *prometheus.Desc Stations *prometheus.Desc UserStations *prometheus.Desc GuestStations *prometheus.Desc // contains filtered or unexported fields }
A DeviceCollector is a Prometheus collector for metrics regarding Ubiquiti UniFi devices.
func NewDeviceCollector ¶
func NewDeviceCollector(c *unifi.Client, sites []*unifi.Site) *DeviceCollector
NewDeviceCollector creates a new DeviceCollector which collects metrics for a specified site.
func (*DeviceCollector) Collect ¶
func (c *DeviceCollector) Collect(ch chan<- prometheus.Metric)
Collect is the same as CollectError, but ignores any errors which occur. Collect exists to satisfy the prometheus.Collector interface.
func (*DeviceCollector) CollectError ¶
func (c *DeviceCollector) CollectError(ch chan<- prometheus.Metric) error
CollectError sends the metric values for each metric pertaining to the global cluster usage over to the provided prometheus Metric channel, returning any errors which occur.
func (*DeviceCollector) Describe ¶
func (c *DeviceCollector) Describe(ch chan<- *prometheus.Desc)
Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.
type Exporter ¶
type Exporter struct {
// contains filtered or unexported fields
}
An Exporter is a Prometheus exporter for Ubiquiti UniFi Controller API metrics. It wraps all UniFi metrics collectors and provides a single global exporter which can serve metrics. It also ensures that the collection is done in a thread-safe manner, the necessary requirement stated by Prometheus. It implements the prometheus.Collector interface in order to register with Prometheus.
func New ¶
func New(sites []*unifi.Site, fn ClientFunc) (*Exporter, error)
New creates a new Exporter which collects metrics from one or mote sites.
func (*Exporter) Collect ¶
func (e *Exporter) Collect(ch chan<- prometheus.Metric)
Collect sends the collected metrics from each of the collectors to prometheus. Collect could be called several times concurrently and thus its run is protected by a single mutex.
func (*Exporter) Describe ¶
func (e *Exporter) Describe(ch chan<- *prometheus.Desc)
Describe sends all the descriptors of the collectors included to the provided channel.
type StationCollector ¶
type StationCollector struct { Stations *prometheus.Desc ReceivedBytesTotal *prometheus.Desc TransmittedBytesTotal *prometheus.Desc ReceivedPacketsTotal *prometheus.Desc TransmittedPacketsTotal *prometheus.Desc RSSIDBM *prometheus.Desc NoiseDBM *prometheus.Desc // contains filtered or unexported fields }
A StationCollector is a Prometheus collector for metrics regarding Ubiquiti UniFi stations (clients).
func NewStationCollector ¶
func NewStationCollector(c *unifi.Client, sites []*unifi.Site) *StationCollector
NewStationCollector creates a new StationCollector which collects metrics for a specified site.
func (*StationCollector) Collect ¶
func (c *StationCollector) Collect(ch chan<- prometheus.Metric)
Collect is the same as Collect, but ignores any errors which occur. Collect exists to satisfy the prometheus.Collector interface.
func (*StationCollector) CollectError ¶
func (c *StationCollector) CollectError(ch chan<- prometheus.Metric) error
CollectError sends the metric values for each metric pertaining to the global cluster usage over to the provided prometheus Metric channel, returning any errors which occur.
func (*StationCollector) Describe ¶
func (c *StationCollector) Describe(ch chan<- *prometheus.Desc)
Describe sends the descriptors of each metric over to the provided channel. The corresponding metric values are sent separately.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
unifi_exporter
Command unifi_exporter provides a Prometheus exporter for a Ubiquiti UniFi Controller API and UniFi devices.
|
Command unifi_exporter provides a Prometheus exporter for a Ubiquiti UniFi Controller API and UniFi devices. |