exporter

package
v0.0.0-...-800ad7e Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthentication = errors.New("authentication failed")

ErrAuthentication is returned on HTTP status 401

Functions

This section is empty.

Types

type API

type API struct {
	Hostname string
	Username string
	Password string
	// contains filtered or unexported fields
}

API is the interface to 3CX

func (*API) Login

func (api *API) Login() error

Login creates a user session

func (*API) ServiceList

func (api *API) ServiceList() (ServiceList, error)

ServiceList fetches the service list

func (*API) SystemStatus

func (api *API) SystemStatus() (SystemStatus, error)

SystemStatus fetches the system status

func (*API) TrunkList

func (api *API) TrunkList() ([]Trunk, error)

TrunkList fetches the trunk list

type Exporter

type Exporter struct {
	API
}

Exporter represents a prometheus exporter

func (*Exporter) Collect

func (ex *Exporter) Collect(ch chan<- prometheus.Metric)

Collect collects the metrics

func (*Exporter) Describe

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

Describe describes the metrics

type Service

type Service struct {
	Name       string
	Status     int
	MemoryUsed int
	CPUUsage   int
}

Service represents an item of the ServiceList response

type ServiceList

type ServiceList []Service

ServiceList represents the ServiceList response

type SystemStatus

type SystemStatus struct {
	FQDN                      string
	Version                   string
	Activated                 bool
	MaxSimCalls               int
	MaxSimMeetingParticipants int
	CallHistoryCount          int
	ChatMessagesCount         int
	ExtensionsRegistered      int
	OwnPush                   bool
	ExtensionsTotal           int
	TrunksRegistered          int
	TrunksTotal               int
	CallsActive               int
	BlacklistedIPCount        int
	MemoryUsage               int
	PhysicalMemoryUsage       int
	FreeFirtualMemory         int64
	TotalVirtualMemory        int64
	FreePhysicalMemory        int64
	TotalPhysicalMemory       int64
	DiskUsage                 int
	FreeDiskSpace             int64
	TotalDiskSpace            int64
	CPUUsage                  int
	MaintenanceExpiresAt      *time.Time
	Support                   bool
	ExpirationDate            interface{}
	OutboundRules             int
	BackupScheduled           bool
	LastBackupDateTime        *time.Time
	ResellerName              string
	LicenseKey                string
	ProductCode               string
}

SystemStatus represents the SystemStatus response

type Trunk

type Trunk struct {
	Name         string
	IsRegistered bool
}

Trunk represents a SIP trunk

Jump to

Keyboard shortcuts

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