collector

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	URI      string
	Timeout  time.Duration
	Password string
	// contains filtered or unexported fields
}

Collector implements prometheus.Collector (see below). it also contains the config of the exporter.

func New

func New(uri string, timeout time.Duration, password string, rtpEnable bool, logger log.Logger) (*Collector, error)

New processes uri, timeout and methods and returns a new Collector.

func (*Collector) Collect

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

Collect implements prometheus.Collector.

func (*Collector) Describe

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

Describe implements prometheus.Collector.

type Configuration

type Configuration struct {
	XMLName     xml.Name `xml:"configuration"`
	Text        string   `xml:",chardata"`
	Name        string   `xml:"name,attr"`
	Description string   `xml:"description,attr"`
	Modules     struct {
		Text string `xml:",chardata"`
		Load []struct {
			Text   string `xml:",chardata"`
			Module string `xml:"module,attr"`
		} `xml:"load"`
	} `xml:"modules"`
}

type Gateway

type Gateway struct {
	Name           string  `xml:"name"`
	Profile        string  `xml:"profile"`
	Scheme         string  `xml:"scheme"`
	Realm          string  `xml:"realm"`
	UserName       string  `xml:"username"`
	Password       string  `xml:"passowrd"`
	From           string  `xml:"from"`
	Contact        string  `xml:"contact"`
	Exten          string  `xml:"exten"`
	To             string  `xml:"to"`
	Proxy          string  `xml:"proxy"`
	Context        string  `xml:"context"`
	Expires        int     `xml:"expires"`
	FReq           int     `xml:"freq"`
	Ping           int     `xml:"ping"`
	PingFreq       int     `xml:"pingfreq"`
	PingMin        int     `xml:"pingmin"`
	PingCount      int     `xml:"pingcount"`
	PingMax        int     `xml:"pingmax"`
	PingTime       float64 `xml:"pingtime"`
	Pinging        int     `xml:"pinging"`
	State          string  `xml:"state"`
	Status         string  `xml:"status"`
	UptimeUsec     string  `xml:"uptime-usec"`
	CallsIn        int     `xml:"calls-in"`
	CallsOut       int     `xml:"calls-out"`
	FailedCallsIn  int     `xml:"failed-calls-in"`
	FailedCallsOut int     `xml:"failed-calls-out"`
}

type Gateways

type Gateways struct {
	XMLName xml.Name  `xml:"gateways"`
	Gateway []Gateway `xml:"gateway"`
}

type Metric

type Metric struct {
	Name       string
	Help       string
	Type       prometheus.ValueType
	Command    string
	RegexIndex int
}

Metric represents a prometheus metric. It is either fetched from an api command, or from "status" parsing (thus the RegexIndex)

type Result

type Result struct {
	XMLName  xml.Name `xml:"result"`
	Text     string   `xml:",chardata"`
	RowCount string   `xml:"row_count,attr"`
	Row      []struct {
		Text  string `xml:",chardata"`
		RowID string `xml:"row_id,attr"`
		Type  struct {
			Text string `xml:",chardata"`
		} `xml:"type"`
		Name struct {
			Text string `xml:",chardata"`
		} `xml:"name"`
		Ikey struct {
			Text string `xml:",chardata"`
		} `xml:"ikey"`
	} `xml:"row"`
}

type Verto

type Verto struct {
	XMLName xml.Name `xml:"profiles"`
	Text    string   `xml:",chardata"`
	Profile []struct {
		Text string `xml:",chardata"`
		Name struct {
			Text string `xml:",chardata"`
		} `xml:"name"`
		Type struct {
			Text string `xml:",chardata"`
		} `xml:"type"`
		Data struct {
			Text string `xml:",chardata"`
		} `xml:"data"`
		State struct {
			Text string `xml:",chardata"`
		} `xml:"state"`
	} `xml:"profile"`
}

Jump to

Keyboard shortcuts

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