collector

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ArpTableSubsystem   = "arp_table"
	GatewaysSubsystem   = "gateways"
	CronTableSubsystem  = "cron"
	WireguardSubsystem  = "wireguard"
	UnboundDNSSubsystem = "unbound_dns"
	InterfacesSubsystem = "interfaces"
	ProtocolSubsystem   = "protocol"
	OpenVPNSubsystem    = "openvpn"
	ServicesSubsystem   = "services"
	FirewallSubsystem   = "firewall"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	Client *opnsense.Client
	// contains filtered or unexported fields
}

func New

func New(client *opnsense.Client, log log.Logger, instanceName string, options ...Option) (*Collector, error)

New creates a new Collector instance.

func (*Collector) Collect

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

Collect implements the prometheus.Collector interface.

func (*Collector) Describe

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

Describe implements the prometheus.Collector interface.

type CollectorInstance

type CollectorInstance interface {
	Register(namespace, isntance string, log log.Logger)
	Name() string
	Describe(ch chan<- *prometheus.Desc)
	Update(client *opnsense.Client, ch chan<- prometheus.Metric) *opnsense.APICallError
}

CollectorInstance is the interface a service specific collectors must implement.

type Option

type Option func(*Collector) error

func WithoutArpTableCollector

func WithoutArpTableCollector() Option

WithoutArpTableCollector Option removes the arp_table collector from the list of collectors

func WithoutCronCollector

func WithoutCronCollector() Option

WithoutCronCollector Option removes the cron collector from the list of collectors

func WithoutFirewallCollector added in v0.0.6

func WithoutFirewallCollector() Option

WithoutFirewallCollector Option removes the firewall (pf) collector from the list of collectors

func WithoutOpenVPNCollector added in v0.0.6

func WithoutOpenVPNCollector() Option

WithoutOpenVPNCollector Option removes the openvpn collector from the list of collectors

func WithoutUnboundCollector added in v0.0.4

func WithoutUnboundCollector() Option

WithoutUnboundCollector Option removes the unbound_dns collector from the list of collectors

func WithoutWireguardCollector added in v0.0.2

func WithoutWireguardCollector() Option

WithoutWireguardCollector Option removes the wireguard collector from the list of collectors

type WireguardCollector added in v0.0.2

type WireguardCollector struct {
	TransferRx      *prometheus.Desc
	TransferTx      *prometheus.Desc
	LatestHandshake *prometheus.Desc
	// contains filtered or unexported fields
}

func (*WireguardCollector) Describe added in v0.0.2

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

func (*WireguardCollector) Name added in v0.0.2

func (c *WireguardCollector) Name() string

func (*WireguardCollector) Register added in v0.0.2

func (c *WireguardCollector) Register(namespace, instanceLabel string, log log.Logger)

func (*WireguardCollector) Update added in v0.0.2

func (c *WireguardCollector) Update(client *opnsense.Client, ch chan<- prometheus.Metric) *opnsense.APICallError

Jump to

Keyboard shortcuts

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