Hi Florian,
On 09/03/2021 13:05, Florian Eckert wrote:
With the old ubus dsl API, the numbers for the individual line_states and
power_states were also returned. These were not ported to the new DSL
C-API. This commit changes the following JSON output.
* current JSON output for state:
"state": "Showtime with TC-Layer sync"
* new JSON output for state:
"line_state": {
"number": 2049,
"string": "Showtime with TC-Layer sync"
},
this one is used by the prometheus node collector, so needs to be
adapted to this change if this goes in.
* current JSON output for power_state:
"power_state": "L0 - Synchronized"
new JSON outpug for power_state:
"power_state": {
"number": 0,
"string": "L0 - Synchronized"
}
We already talked about it, but once again for the list:
I skipped both of these numeric state values when porting this to
ubus/C, because those are internal and lantiq implementation specific.
I'd like to avoid exposing those if possible.
Looking at the various values [0], which ones are of interest here? I've
only seen very few of all of those actually happening.
Can we not expose new metrics instead of these internal numbers?
Like there's already "up":
m_bool("up", out.data.nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC);
If you care e.g. about showtime you could just add:
m_bool("showtime", out.data.nLineState == DSL_LINESTATE_SHOWTIME_NO_SYNC
|| out.data.nLineState == DSL_LINESTATE_SHOWTIME_TC_SYNC);
And so on.
Thanks,
Andre
[0]
https://github.com/openwrt/openwrt/blob/master/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c#L311-L348
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel