Closed olmo1501 closed 2 years ago
Hier noch die JSON-Ausgabe dazu:
{"pid":"docInfo","hide":{"wps":true,"liveTv":true,"tvsd":true,"wGuest":true,"dvbSet":true,"ssoSet":true,"mobile":true,"wKey":true,"wlanmesh":true,"tvhd":true,"chan":true,"dvbSig":true,"dvbradio":true},"time":[],"data":{"channelDs":{"docsis31":[{"powerLevel":"3.6","type":"4K","channel":1,"channelID":1,"frequency":"751 - 861"}],"docsis30":[{"type":"256QAM","corrErrors":999998,"mse":"-34.3","powerLevel":"1.7","channel":1,"nonCorrErrors":0,"latency":0.32,"channelID":2,"frequency":"482"},{"type":"256QAM","corrErrors":1298322,"mse":"-34.3","powerLevel":"1.7","channel":2,"nonCorrErrors":0,"latency":0.32,"channelID":1,"frequency":"474"},{"type":"256QAM","corrErrors":1628218,"mse":"-34.3","powerLevel":"1.5","channel":3,"nonCorrErrors":0,"latency":0.32,"channelID":3,"frequency":"490"},{"type":"256QAM","corrErrors":1674880,"mse":"-34.3","powerLevel":"1.6","channel":4,"nonCorrErrors":0,"latency":0.32,"channelID":4,"frequency":"498"},{"type":"256QAM","corrErrors":817768,"mse":"-34.3","powerLevel":"1.8","channel":5,"nonCorrErrors":0,"latency":0.32,"channelID":5,"frequency":"522"},{"type":"256QAM","corrErrors":214261,"mse":"-34.9","powerLevel":"2.2","channel":6,"nonCorrErrors":0,"latency":0.32,"channelID":6,"frequency":"530"},{"type":"256QAM","corrErrors":224018,"mse":"-34.9","powerLevel":"2.4","channel":7,"nonCorrErrors":0,"latency":0.32,"channelID":7,"frequency":"538"},{"type":"256QAM","corrErrors":164232,"mse":"-34.9","powerLevel":"2.6","channel":8,"nonCorrErrors":0,"latency":0.32,"channelID":8,"frequency":"546"},{"type":"256QAM","corrErrors":142901,"mse":"-35.1","powerLevel":"2.6","channel":9,"nonCorrErrors":0,"latency":0.32,"channelID":9,"frequency":"554"},{"type":"256QAM","corrErrors":175846,"mse":"-34.9","powerLevel":"2.6","channel":10,"nonCorrErrors":0,"latency":0.32,"channelID":10,"frequency":"562"},{"type":"256QAM","corrErrors":241859,"mse":"-34.9","powerLevel":"2.3","channel":11,"nonCorrErrors":0,"latency":0.32,"channelID":11,"frequency":"570"},{"type":"256QAM","corrErrors":211910,"mse":"-35.1","powerLevel":"2.4","channel":12,"nonCorrErrors":0,"latency":0.32,"channelID":12,"frequency":"578"},{"type":"256QAM","corrErrors":167286,"mse":"-34.9","powerLevel":"2.4","channel":13,"nonCorrErrors":0,"latency":0.32,"channelID":13,"frequency":"586"},{"type":"256QAM","corrErrors":104105,"mse":"-35.1","powerLevel":"2.8","channel":14,"nonCorrErrors":0,"latency":0.32,"channelID":14,"frequency":"594"},{"type":"256QAM","corrErrors":46159,"mse":"-35.6","powerLevel":"3.0","channel":15,"nonCorrErrors":0,"latency":0.32,"channelID":15,"frequency":"602"},{"type":"256QAM","corrErrors":31807,"mse":"-35.8","powerLevel":"2.8","channel":16,"nonCorrErrors":0,"latency":0.32,"channelID":16,"frequency":"618"},{"type":"256QAM","corrErrors":29508,"mse":"-35.1","powerLevel":"2.2","channel":17,"nonCorrErrors":0,"latency":0.32,"channelID":17,"frequency":"626"},{"type":"256QAM","corrErrors":21040,"mse":"-35.6","powerLevel":"2.8","channel":18,"nonCorrErrors":0,"latency":0.32,"channelID":18,"frequency":"634"},{"type":"256QAM","corrErrors":15928,"mse":"-35.6","powerLevel":"3.4","channel":19,"nonCorrErrors":0,"latency":0.32,"channelID":19,"frequency":"642"},{"type":"256QAM","corrErrors":9072,"mse":"-36.4","powerLevel":"4.1","channel":20,"nonCorrErrors":0,"latency":0.32,"channelID":20,"frequency":"650"},{"type":"256QAM","corrErrors":15040,"mse":"-35.6","powerLevel":"3.9","channel":21,"nonCorrErrors":0,"latency":0.32,"channelID":21,"frequency":"658"},{"type":"256QAM","corrErrors":20170,"mse":"-35.8","powerLevel":"3.9","channel":22,"nonCorrErrors":0,"latency":0.32,"channelID":22,"frequency":"666"},{"type":"256QAM","corrErrors":16224,"mse":"-35.8","powerLevel":"3.6","channel":23,"nonCorrErrors":0,"latency":0.32,"channelID":23,"frequency":"674"},{"type":"256QAM","corrErrors":33741,"mse":"-35.8","powerLevel":"3.3","channel":24,"nonCorrErrors":0,"latency":0.32,"channelID":24,"frequency":"682"},{"type":"256QAM","corrErrors":17958,"mse":"-35.8","powerLevel":"3.9","channel":25,"nonCorrErrors":0,"latency":0.32,"channelID":25,"frequency":"690"},{"type":"256QAM","corrErrors":14491,"mse":"-35.8","powerLevel":"4.2","channel":26,"nonCorrErrors":0,"latency":0.32,"channelID":26,"frequency":"698"},{"type":"256QAM","corrErrors":28400,"mse":"-35.8","powerLevel":"4.3","channel":27,"nonCorrErrors":0,"latency":0.32,"channelID":27,"frequency":"706"},{"type":"256QAM","corrErrors":37147,"mse":"-35.8","powerLevel":"4.4","channel":28,"nonCorrErrors":0,"latency":0.32,"channelID":28,"frequency":"730"},{"type":"256QAM","corrErrors":19036,"mse":"-36.4","powerLevel":"4.7","channel":29,"nonCorrErrors":0,"latency":0.32,"channelID":29,"frequency":"738"},{"type":"256QAM","corrErrors":16071,"mse":"-36.4","powerLevel":"5.3","channel":30,"nonCorrErrors":14,"latency":0.32,"channelID":30,"frequency":"746"}]},"oem":"lgi","readyState":"ready","channelUs":{"docsis31":[{"powerLevel":"38.2","type":"4K","channel":1,"multiplex":"OFDMA","channelID":0,"frequency":"54 - 65"}],"docsis30":[{"powerLevel":"44.8","type":"64QAM","channel":1,"multiplex":"ATDMA","channelID":1,"frequency":"31"},{"powerLevel":"42.8","type":"64QAM","channel":2,"multiplex":"ATDMA","channelID":4,"frequency":"51"},{"powerLevel":"43.0","type":"64QAM","channel":3,"multiplex":"ATDMA","channelID":3,"frequency":"45"},{"powerLevel":"44.0","type":"64QAM","channel":4,"multiplex":"ATDMA","channelID":2,"frequency":"37"}]}},"sid":"2967f9864072eb0c"}
I added a quick workaround to remove non numbers for them beginning of the value - I guess this should solve it
please test
hallo Oliver,
ich hab einen schnellen workaround gebastelt, in dem ich einfach die nicht zahlen aus dem value raus werfe.
leider kann ich es nicht testen, da ich nur DSL hab. kannst kurz feedback geben ob es so klappt.
gruss,
Andreas
olmo1501 ***@***.***> hat am 14.02.2022 07:57 geschrieben:
Hier noch die JSON-Ausgabe dazu: {"pid":"docInfo","hide":{"wps":true,"liveTv":true,"tvsd":true,"wGuest":true,"dvbSet":true,"ssoSet":true,"mobile":true,"wKey":true,"wlanmesh":true,"tvhd":true,"chan":true,"dvbSig":true,"dvbradio":true},"time":[],"data":{"channelDs":{"docsis31":[{"powerLevel":"3.6","type":"4K","channel":1,"channelID":1,"frequency":"751 - 861"}],"docsis30":[{"type":"256QAM","corrErrors":999998,"mse":"-34.3","powerLevel":"1.7","channel":1,"nonCorrErrors":0,"latency":0.32,"channelID":2,"frequency":"482"},{"type":"256QAM","corrErrors":1298322,"mse":"-34.3","powerLevel":"1.7","channel":2,"nonCorrErrors":0,"latency":0.32,"channelID":1,"frequency":"474"},{"type":"256QAM","corrErrors":1628218,"mse":"-34.3","powerLevel":"1.5","channel":3,"nonCorrErrors":0,"latency":0.32,"channelID":3,"frequency":"490"},{"type":"256QAM","corrErrors":1674880,"mse":"-34.3","powerLevel":"1.6","channel":4,"nonCorrErrors":0,"latency":0.32,"channelID":4,"frequency":"498"},{"type":"256QAM","corrErrors":817768,"mse":"-34.3","powerLevel":"1.8","channel":5,"nonCorrErrors":0,"latency":0.32,"channelID":5,"frequency":"522"},{"type":"256QAM","corrErrors":214261,"mse":"-34.9","powerLevel":"2.2","channel":6,"nonCorrErrors":0,"latency":0.32,"channelID":6,"frequency":"530"},{"type":"256QAM","corrErrors":224018,"mse":"-34.9","powerLevel":"2.4","channel":7,"nonCorrErrors":0,"latency":0.32,"channelID":7,"frequency":"538"},{"type":"256QAM","corrErrors":164232,"mse":"-34.9","powerLevel":"2.6","channel":8,"nonCorrErrors":0,"latency":0.32,"channelID":8,"frequency":"546"},{"type":"256QAM","corrErrors":142901,"mse":"-35.1","powerLevel":"2.6","channel":9,"nonCorrErrors":0,"latency":0.32,"channelID":9,"frequency":"554"},{"type":"256QAM","corrErrors":175846,"mse":"-34.9","powerLevel":"2.6","channel":10,"nonCorrErrors":0,"latency":0.32,"channelID":10,"frequency":"562"},{"type":"256QAM","corrErrors":241859,"mse":"-34.9","powerLevel":"2.3","channel":11,"nonCorrErrors":0,"latency":0.32,"channelID":11,"frequency":"570"},{"type":"256QAM","corrErrors":211910,"mse":"-35.1","powerLevel":"2.4","channel":12,"nonCorrErrors":0,"latency":0.32,"channelID":12,"frequency":"578"},{"type":"256QAM","corrErrors":167286,"mse":"-34.9","powerLevel":"2.4","channel":13,"nonCorrErrors":0,"latency":0.32,"channelID":13,"frequency":"586"},{"type":"256QAM","corrErrors":104105,"mse":"-35.1","powerLevel":"2.8","channel":14,"nonCorrErrors":0,"latency":0.32,"channelID":14,"frequency":"594"},{"type":"256QAM","corrErrors":46159,"mse":"-35.6","powerLevel":"3.0","channel":15,"nonCorrErrors":0,"latency":0.32,"channelID":15,"frequency":"602"},{"type":"256QAM","corrErrors":31807,"mse":"-35.8","powerLevel":"2.8","channel":16,"nonCorrErrors":0,"latency":0.32,"channelID":16,"frequency":"618"},{"type":"256QAM","corrErrors":29508,"mse":"-35.1","powerLevel":"2.2","channel":17,"nonCorrErrors":0,"latency":0.32,"channelID":17,"frequency":"626"},{"type":"256QAM","corrErrors":21040,"mse":"-35.6","powerLevel":"2.8","channel":18,"nonCorrErrors":0,"latency":0.32,"channelID":18,"frequency":"634"},{"type":"256QAM","corrErrors":15928,"mse":"-35.6","powerLevel":"3.4","channel":19,"nonCorrErrors":0,"latency":0.32,"channelID":19,"frequency":"642"},{"type":"256QAM","corrErrors":9072,"mse":"-36.4","powerLevel":"4.1","channel":20,"nonCorrErrors":0,"latency":0.32,"channelID":20,"frequency":"650"},{"type":"256QAM","corrErrors":15040,"mse":"-35.6","powerLevel":"3.9","channel":21,"nonCorrErrors":0,"latency":0.32,"channelID":21,"frequency":"658"},{"type":"256QAM","corrErrors":20170,"mse":"-35.8","powerLevel":"3.9","channel":22,"nonCorrErrors":0,"latency":0.32,"channelID":22,"frequency":"666"},{"type":"256QAM","corrErrors":16224,"mse":"-35.8","powerLevel":"3.6","channel":23,"nonCorrErrors":0,"latency":0.32,"channelID":23,"frequency":"674"},{"type":"256QAM","corrErrors":33741,"mse":"-35.8","powerLevel":"3.3","channel":24,"nonCorrErrors":0,"latency":0.32,"channelID":24,"frequency":"682"},{"type":"256QAM","corrErrors":17958,"mse":"-35.8","powerLevel":"3.9","channel":25,"nonCorrErrors":0,"latency":0.32,"channelID":25,"frequency":"690"},{"type":"256QAM","corrErrors":14491,"mse":"-35.8","powerLevel":"4.2","channel":26,"nonCorrErrors":0,"latency":0.32,"channelID":26,"frequency":"698"},{"type":"256QAM","corrErrors":28400,"mse":"-35.8","powerLevel":"4.3","channel":27,"nonCorrErrors":0,"latency":0.32,"channelID":27,"frequency":"706"},{"type":"256QAM","corrErrors":37147,"mse":"-35.8","powerLevel":"4.4","channel":28,"nonCorrErrors":0,"latency":0.32,"channelID":28,"frequency":"730"},{"type":"256QAM","corrErrors":19036,"mse":"-36.4","powerLevel":"4.7","channel":29,"nonCorrErrors":0,"latency":0.32,"channelID":29,"frequency":"738"},{"type":"256QAM","corrErrors":16071,"mse":"-36.4","powerLevel":"5.3","channel":30,"nonCorrErrors":14,"latency":0.32,"channelID":30,"frequency":"746"}]},"oem":"lgi","readyState":"ready","channelUs":{"docsis31":[{"powerLevel":"38.2","type":"4K","channel":1,"multiplex":"OFDMA","channelID":0,"frequency":"54 - 65"}],"docsis30":[{"powerLevel":"44.8","type":"64QAM","channel":1,"multiplex":"ATDMA","channelID":1,"frequency":"31"},{"powerLevel":"42.8","type":"64QAM","channel":2,"multiplex":"ATDMA","channelID":4,"frequency":"51"},{"powerLevel":"43.0","type":"64QAM","channel":3,"multiplex":"ATDMA","channelID":3,"frequency":"45"},{"powerLevel":"44.0","type":"64QAM","channel":4,"multiplex":"ATDMA","channelID":2,"frequency":"37"}]}},"sid":"2967f9864072eb0c"} —Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.Message ID: @.***>
Works as desired :-D
Sorry, it doesn't, my bad. It also removes the preceding "-" from MSE values which should always be a negative number.
I would suggest changing line 321 from
sNum := regexNonNumberEnd.ReplaceAllString(regexNonNumberBegin.ReplaceAllString(sVal, ""), "")
to
sNum := regexNonNumberEnd.ReplaceAllString(sVal, "")
After that line 81
regexNonNumberBegin = regexp.MustCompile("^\\D+")
will be obsolete and can be removed.
After these changes everything is working as expected.
Zunächst danke für dieses tolle Stück Software. Endlich ein variabler Exporter, der so ziemlich alles liefert, das per TR64 oder LUA zugänglich ist. Danach hatte ich schon ewig gesucht.
Ich bin aktuell dabei, die LUA-Konfiguration für eine 6591 Cable hinzubiegen, die über data.lua viele Informationen zur DOCSIS-Verbindung liefert. Die passende JSON-Datei kann ich auf Wunsch gerne zur Verfügung stellen. Leider scheitere ich an der Modulation der DOCSIS3.0 Upstream-Kanäle, denn AVM liefert hier leider statt beispielsweise einer 64 eben 64QAM.
Meine Konfiguration sieht so aus:
Das führt dann zum Fehler "Can not get metric values for data.channelUs.docsis30.*.type: strconv.ParseFloat: parsing "64QAM": invalid syntax". Klar, ist ja eben auch ein String und kein Float.
Mache ich sowas
steht die Modulation sauber als Label in der Metrik. Und zwar nur als Integer ohne "QAM". Hilft nur leider nicht, da Grafana keine Label-Values als Graphen darstellen kann. Umschreiben per Regex geht auch nicht, da das wohl nur für Labels aber nicht für Keys möglich ist.
Ich bin ein recht passabler Admin, aber meine GO-Skills gehen gegen Null, deshalb bin ich hier wirklich aufgeschmissen, denn dieser Wert ist tatsächlich ein wichtiger Indikator für die Qualität der DOCSIS-Verbindung. Bekommt man das irgendwie hin?
Auf Wunsch kann ich gerne alle relevanten Daten zur Verfügung stellen.