aboutsummaryrefslogtreecommitdiff
path: root/utils/prometheus-node-exporter-ucode/files/extra/ltq-dsl.uc
blob: 164449722edabc1e71b4e7b56371e3b489e2e89b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const x = ubus.call("dsl", "metrics");

if (!x)
	return false;

gauge("dsl_info")({
	atuc_vendor:		x.atu_c.vendor,
	atuc_system_vendor:	x.atu_c.system_vendor,
	chipset:		x.chipset,
	firmware_version:	x.firmware_version,
	api_version:		x.api_version,
	driver_version:		x.driver_version,
}, 1);

gauge("dsl_line_info")({
	annex:		x.annex,
	standard:	x.standard,
	mode:		x.mode,
	profile:	x.profile,
}, 1);

gauge("dsl_up")({ detail: x.state }, x.up);
gauge("dsl_uptime_seconds")(null, x.uptime);

gauge("dsl_line_attenuation_db")
	({ direction: "down" }, x.downstream.latn)
	({ direction: "up" }, x.upstream.latn);
gauge("dsl_signal_attenuation_db")
	({ direction: "down" }, x.downstream.satn)
	({ direction: "up" }, x.upstream.satn);
gauge("dsl_signal_to_noise_margin_db")
	({ direction: "down" }, x.downstream.snr)
	({ direction: "up" }, x.upstream.snr);
gauge("dsl_aggregated_transmit_power_db")
	({ direction: "down" }, x.downstream.actatp)
	({ direction: "up" }, x.upstream.actatp);

if (x.downstream.interleave_delay)
	gauge("dsl_latency_seconds")
		({ direction: "down" }, x.downstream.interleave_delay / 1000000.0)
		({ direction: "up" }, x.upstream.interleave_delay / 1000000.0);
gauge("dsl_datarate")
	({ direction: "down" }, x.downstream.data_rate)
	({ direction: "up" }, x.upstream.data_rate);
gauge("dsl_max_datarate")
	({ direction: "down" }, x.downstream.attndr)
	({ direction: "up" }, x.upstream.attndr);

counter("dsl_error_seconds_total")
	({ err: "forward error correction", loc: "near" }, x.errors.near.fecs)
	({ err: "forward error correction", loc: "far" }, x.errors.far.fecs)
	({ err: "errored", loc: "near" }, x.errors.near.es)
	({ err: "errored", loc: "far" }, x.errors.far.es)
	({ err: "severely errored", loc: "near" }, x.errors.near.ses)
	({ err: "severely errored", loc: "far" }, x.errors.far.ses)
	({ err: "loss of signal", loc: "near" }, x.errors.near.loss)
	({ err: "loss of signal", loc: "far" }, x.errors.far.loss)
	({ err: "unavailable", loc: "near" }, x.errors.near.uas)
	({ err: "unavailable", loc: "far" }, x.errors.far.uas);

counter("dsl_errors_total")
	({ err: "header error code error", loc: "near" }, x.errors.near.hec)
	({ err: "header error code error", loc: "far" }, x.errors.far.hec)
	({ err: "non pre-emptive crc error", loc: "near" }, x.errors.near.crc_p)
	({ err: "non pre-emptive crc error", loc: "far" }, x.errors.far.crc_p)
	({ err: "pre-emptive crc error", loc: "near" }, x.errors.near.crcp_p)
	({ err: "pre-emptive crc error", loc: "far" }, x.errors.far.crcp_p);

if (x.erb)
	counter("dsl_erb_total")
		({ counter: "sent" }, x.erb.sent)
		({ counter: "discarded" }, x.erb.discarded);