Add upstream SNR
This commit is contained in:
parent
808564b940
commit
c6902be9eb
3 changed files with 7 additions and 3 deletions
|
|
@ -35,8 +35,6 @@ Usage of ./vodafone-station-exporter:
|
||||||
- Labels: `id`, `channel_id`, `fft`, `channel_type`
|
- Labels: `id`, `channel_id`, `fft`, `channel_type`
|
||||||
* `vodafone_station_downstream_snr_dB`: SNR in dB
|
* `vodafone_station_downstream_snr_dB`: SNR in dB
|
||||||
- Labels: `id`, `channel_id`, `fft`, `channel_type`
|
- Labels: `id`, `channel_id`, `fft`, `channel_type`
|
||||||
* `vodafone_station_downstream_snr_dB`: SNR in dB
|
|
||||||
- Labels: `id`, `channel_id`, `fft`, `channel_type`
|
|
||||||
* `vodafone_station_ofdm_downstream_start_frequency_hertz`: Start frequency
|
* `vodafone_station_ofdm_downstream_start_frequency_hertz`: Start frequency
|
||||||
- Labels: `id`, `channel_id_ofdm`, `fft`, `channel_type`
|
- Labels: `id`, `channel_id_ofdm`, `fft`, `channel_type`
|
||||||
* `vodafone_station_ofdm_downstream_end_frequency_hertz`: End frequency
|
* `vodafone_station_ofdm_downstream_end_frequency_hertz`: End frequency
|
||||||
|
|
@ -55,6 +53,8 @@ Usage of ./vodafone-station-exporter:
|
||||||
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`
|
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`
|
||||||
* `vodafone_station_upstream_power_dBmV`: Power
|
* `vodafone_station_upstream_power_dBmV`: Power
|
||||||
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`
|
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`
|
||||||
|
* `vodafone_station_upstream_snr_dB`: SNR in dB
|
||||||
|
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`
|
||||||
* `vodafone_station_upstream_ranging_status_info`: Ranging status
|
* `vodafone_station_upstream_ranging_status_info`: Ranging status
|
||||||
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`, `status`
|
- Labels: `id`, `channel_id_up`, `fft`, `channel_type`, `status`
|
||||||
* `vodafone_station_firewall_status_info`: Firewall status
|
* `vodafone_station_firewall_status_info`: Firewall status
|
||||||
|
|
|
||||||
|
|
@ -106,6 +106,7 @@ type DocsisUpstreamChannel struct {
|
||||||
ChannelIdUp string `json:"channelidup"`
|
ChannelIdUp string `json:"channelidup"`
|
||||||
CentralFrequency string `json:"CentralFrequency"`
|
CentralFrequency string `json:"CentralFrequency"`
|
||||||
Power string `json:"power"`
|
Power string `json:"power"`
|
||||||
|
Snr string `json:"SNR"`
|
||||||
ChannelType string `json:"ChannelType"`
|
ChannelType string `json:"ChannelType"`
|
||||||
Fft string `json:"FFT"`
|
Fft string `json:"FFT"`
|
||||||
RangingStatus string `json:"RangingStatus"`
|
RangingStatus string `json:"RangingStatus"`
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ var (
|
||||||
|
|
||||||
centralFrequencyUpstreamDesc *prometheus.Desc
|
centralFrequencyUpstreamDesc *prometheus.Desc
|
||||||
powerUpstreamDesc *prometheus.Desc
|
powerUpstreamDesc *prometheus.Desc
|
||||||
|
snrUpstreamDesc *prometheus.Desc
|
||||||
rangingStatusUpstreamDesc *prometheus.Desc
|
rangingStatusUpstreamDesc *prometheus.Desc
|
||||||
|
|
||||||
startFrequencyOfdmaUpstreamDesc *prometheus.Desc
|
startFrequencyOfdmaUpstreamDesc *prometheus.Desc
|
||||||
|
|
@ -121,6 +122,7 @@ func init() {
|
||||||
upstreamLabels := []string{"id", "channel_id_up", "fft", "channel_type"}
|
upstreamLabels := []string{"id", "channel_id_up", "fft", "channel_type"}
|
||||||
centralFrequencyUpstreamDesc = prometheus.NewDesc(prefix+"upstream_central_frequency_hertz", "Central frequency", upstreamLabels, nil)
|
centralFrequencyUpstreamDesc = prometheus.NewDesc(prefix+"upstream_central_frequency_hertz", "Central frequency", upstreamLabels, nil)
|
||||||
powerUpstreamDesc = prometheus.NewDesc(prefix+"upstream_power_dBmV", "Power", upstreamLabels, nil)
|
powerUpstreamDesc = prometheus.NewDesc(prefix+"upstream_power_dBmV", "Power", upstreamLabels, nil)
|
||||||
|
snrUpstreamDesc = prometheus.NewDesc(prefix+"upstream_snr_dB", "SNR in dB", upstreamLabels, nil)
|
||||||
rangingStatusUpstreamDesc = prometheus.NewDesc(prefix+"upstream_ranging_status_info", "Ranging status", append(upstreamLabels, "status"), nil)
|
rangingStatusUpstreamDesc = prometheus.NewDesc(prefix+"upstream_ranging_status_info", "Ranging status", append(upstreamLabels, "status"), nil)
|
||||||
|
|
||||||
ofdmaUpstreamLabels := []string{"id", "channel_id_up", "fft", "channel_type"}
|
ofdmaUpstreamLabels := []string{"id", "channel_id_up", "fft", "channel_type"}
|
||||||
|
|
@ -191,7 +193,6 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
|
||||||
ch <- centralFrequencyDownstreamDesc
|
ch <- centralFrequencyDownstreamDesc
|
||||||
ch <- powerDownstreamDesc
|
ch <- powerDownstreamDesc
|
||||||
ch <- snrDownstreamDesc
|
ch <- snrDownstreamDesc
|
||||||
ch <- snrDownstreamDesc
|
|
||||||
|
|
||||||
ch <- startFrequencyOfdmDownstreamDesc
|
ch <- startFrequencyOfdmDownstreamDesc
|
||||||
ch <- endFrequencyOfdmDownstreamDesc
|
ch <- endFrequencyOfdmDownstreamDesc
|
||||||
|
|
@ -203,6 +204,7 @@ func (c *Collector) Describe(ch chan<- *prometheus.Desc) {
|
||||||
|
|
||||||
ch <- centralFrequencyUpstreamDesc
|
ch <- centralFrequencyUpstreamDesc
|
||||||
ch <- powerUpstreamDesc
|
ch <- powerUpstreamDesc
|
||||||
|
ch <- snrUpstreamDesc
|
||||||
ch <- rangingStatusUpstreamDesc
|
ch <- rangingStatusUpstreamDesc
|
||||||
|
|
||||||
ch <- startFrequencyOfdmaUpstreamDesc
|
ch <- startFrequencyOfdmaUpstreamDesc
|
||||||
|
|
@ -303,6 +305,7 @@ func (c *Collector) Collect(ch chan<- prometheus.Metric) {
|
||||||
labels := []string{upstreamChannel.Id, upstreamChannel.ChannelIdUp, upstreamChannel.Fft, upstreamChannel.ChannelType}
|
labels := []string{upstreamChannel.Id, upstreamChannel.ChannelIdUp, upstreamChannel.Fft, upstreamChannel.ChannelType}
|
||||||
ch <- prometheus.MustNewConstMetric(centralFrequencyUpstreamDesc, prometheus.GaugeValue, parse2float(upstreamChannel.CentralFrequency)*10e9, labels...)
|
ch <- prometheus.MustNewConstMetric(centralFrequencyUpstreamDesc, prometheus.GaugeValue, parse2float(upstreamChannel.CentralFrequency)*10e9, labels...)
|
||||||
ch <- prometheus.MustNewConstMetric(powerUpstreamDesc, prometheus.GaugeValue, parse2float(upstreamChannel.Power), labels...)
|
ch <- prometheus.MustNewConstMetric(powerUpstreamDesc, prometheus.GaugeValue, parse2float(upstreamChannel.Power), labels...)
|
||||||
|
ch <- prometheus.MustNewConstMetric(snrUpstreamDesc, prometheus.GaugeValue, parse2float(upstreamChannel.Snr), labels...)
|
||||||
ch <- prometheus.MustNewConstMetric(rangingStatusUpstreamDesc, prometheus.GaugeValue, 1, append(labels, upstreamChannel.RangingStatus)...)
|
ch <- prometheus.MustNewConstMetric(rangingStatusUpstreamDesc, prometheus.GaugeValue, 1, append(labels, upstreamChannel.RangingStatus)...)
|
||||||
}
|
}
|
||||||
for _, ofdmaUpstreamChannel := range docsisStatusResponse.Data.OfdmaUpstreamData {
|
for _, ofdmaUpstreamChannel := range docsisStatusResponse.Data.OfdmaUpstreamData {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue