From 77eaa353782f75ae3226163990dcbe60af2faf95 Mon Sep 17 00:00:00 2001 From: waluwaz <51720125+waluwaz@users.noreply.github.com> Date: Thu, 17 Mar 2022 21:57:58 +0100 Subject: [PATCH 01/19] Matching indices for vectors in changeChart Same as proposal to Jack --- modmonstats_www.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmonstats_www.js b/modmonstats_www.js index 9b03057..3678af8 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -444,7 +444,7 @@ function changeChart(e) { Draw_Chart('RxPstRs',titlelist[2],measureunitlist[2]); } else if(name == 'TxPwr'){ - Draw_Chart('TxPwr',titlelist[2],measureunitlist[3]); + Draw_Chart('TxPwr',titlelist[3],measureunitlist[3]); } else if(name == 'TxT3Out'){ Draw_Chart('TxT3Out',titlelist[4],measureunitlist[4]); From c3196b00e2aa81702124a4b5c444427d94a3dc49 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Thu, 17 Mar 2022 23:41:18 +0100 Subject: [PATCH 02/19] Commit 01 - First with new 7 metric list (6 Rx + 1 Tx) --- README.md | 2 +- modmon.sh | 49 +++++++++++++++++++++++++++------------------ modmonstats_www.asp | 2 +- modmonstats_www.js | 26 ++++++++++++++---------- 4 files changed, 46 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index df25daf..c58c078 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Codacy Badge](https://api.codacy.com/project/badge/Grade/91af8db9cd354643a8ef6a7117be90fb)](https://www.codacy.com/app/jackyaz/modmon?utm_source=github.com&utm_medium=referral&utm_content=jackyaz/modmon&utm_campaign=Badge_Grade) ![Shellcheck](https://github.com/jackyaz/modmon/actions/workflows/shellcheck.yml/badge.svg) -## v0.1.0-alpha +## v0.2.0-alpha ### Updated on 2022-03-16 ## About modmon is a tool that tracks your cable modem's stats (such as signal power levels) for AsusWRT Merlin with charts for daily, weekly and monthly summaries. It was created by JackYaz. This repository has a derivative work based on modmon and customized to work with another modem, the Technicolor CGA4233 from VOO in Belgium. It doesn't have a specific name, because I'm not sure how to change the name without breaking it; also because it probably couldn't coexist with the original modmon, and finally because I can't imagine a scenario where someone would concurrently need the original modmon and my hack. diff --git a/modmon.sh b/modmon.sh index e0e4dad..c2214f4 100644 --- a/modmon.sh +++ b/modmon.sh @@ -8,7 +8,7 @@ ## | | | | | || (_) || (_| || | | | | || (_) || | | | ## ## |_| |_| |_| \___/ \__,_||_| |_| |_| \___/ |_| |_| ## ## ## -## https://github.com/jackyaz/modmon ## +## https://github.com/waluwaz/modmon ## ## ## ############################################################ @@ -24,7 +24,7 @@ ### Start of script variables ### readonly SCRIPT_NAME="modmon" -readonly SCRIPT_VERSION="v1.1.8" +readonly SCRIPT_VERSION="v0.0.2" SCRIPT_BRANCH="master" SCRIPT_REPO="https://raw.githubusercontent.com/jackyaz/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" @@ -772,19 +772,21 @@ Get_Modem_Stats(){ - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" -# It appears that those very metric's name are expected by other parts of the solution: +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" + +# It appears that those very metric's name might be expected by other parts of the solution: # for instance: SELECT [Timestamp] FROM modstats_RxPwr -# As a start, I will keep those metric name, even though they might store values with different meanings -# The 6 metrics could be mapped as follows (Jack(s metrics left, VOO metrics right. Note that some VOO names are not unique (i.e. shared netween Tx and Rx) +# In this branch, I will try to fully adapt the code to metrics for VOO +# The metrics could be mapped as follows (modmon's metrics left, VOO metrics right. Note that some VOO names are not unique (i.e. shared netween Tx and Rx) # "ChannelID": "10", -# TxT4Out "Frequency": "522 MHz", +# Frequency "Frequency": "522 MHz", # RxPwr & TxPwr OK: "PowerLevel": "-4.8 dBmV", # RxSnr "SNRLevel": "38.3 dB", # "Modulation": "256-QAM", -# "Octets": "772717700", -# TxT3Out "Correcteds": "248675", -# RxPstRs "Uncorrectables": "9629", +# Octets "Octets": "772717700", +# Correcteds "Correcteds": "248675", +# Uncorrectables "Uncorrectables": "9629", # "LockStatus": "Locked", # "ChannelType": "SC-QAM" @@ -814,14 +816,14 @@ Get_Modem_Stats(){ /usr/sbin/curl -fs --retry 3 --connect-timeout 15 'http://192.168.100.1/api/v1/modem/exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'X-CSRF-TOKEN: 7d298d27f7ede0df78c9292cdca2cd57' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=fr; PHPSESSID=9csugaomqu52rqc6vgul600b91; auth=7d298d27f7ede0df78c9292cdca2cd57' > "$shstatsfile_curl" -# Processing the TX, UpStream -cat "$shstatsfile_curl" | jq '.data.USTbl' | sed s/PowerLevel/TxPwr/ | sed s/ChannelID/TxChannelID/ | sed s/__id/01Discard/ | sed s/Frequency/02Discard/ | sed s/ChannelType/03Discard/ | sed s/SymbolRate/04Discard/ | sed s/Modulation/05Discard/ | sed s/LockStatus/06Discard/ > "$shstatsfile_ust" # Processing the Rx, DownStream -cat "$shstatsfile_curl" | jq '.data.DSTbl' | sed s/PowerLevel/RxPwr/ | sed s/ChannelID/RxChannelID/ | sed s/Correcteds/TxT3Out/ | sed s/Frequency/TxT4Out/ | sed s/Uncorrectables/RxPstRs/ | sed s/SNRLevel/RxSnr/ | sed s/__id/01Discard/ | sed s/Frequency/02Discard/ | sed s/Modulation/03Discard/ | sed s/Octets/04Discard/ | sed s/LockStatus/05Discard/ | sed s/ChannelType/06Discard/ > "$shstatsfile_dst" +cat "$shstatsfile_curl" | jq '.data.DSTbl' | sed s/ChannelID/RxChannelID/ | sed s/PowerLevel/RxPwr/ | sed s/SNRLevel/RxSnr/ | sed s/Frequency/RxFreq/ | sed s/Octets/RxOctets/ | sed s/Correcteds/RxCorr/ | sed s/Uncorrectables/RxUncor/ | sed s/__id/01Discard/ | sed s/Modulation/03Discard/ | sed s/Octets/04Discard/ | sed s/LockStatus/05Discard/ | sed s/ChannelType/06Discard/ > "$shstatsfile_dst" # Note that the filtering above with grep, that ensures that only target measures stay in the file will work # because I artificially renamed lines with 0x prefix and the Discard keyword +# Processing the TX, UpStream +cat "$shstatsfile_curl" | jq '.data.USTbl' | sed s/ChannelID/TxChannelID/ | sed s/PowerLevel/TxPwr/ | sed s/__id/01Discard/ | sed s/Frequency/02Discard/ | sed s/ChannelType/03Discard/ | sed s/SymbolRate/04Discard/ | sed s/Modulation/05Discard/ | sed s/LockStatus/06Discard/ > "$shstatsfile_ust" # testing: See documentation subtree, with 05_test_script_to_prepare_data.sh @@ -904,7 +906,8 @@ Generate_CSVs(){ timenow="$(date '+%s')" timenowfriendly="$(date +"%c")" - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" for metric in $metriclist; do { @@ -991,7 +994,8 @@ Generate_CSVs(){ } > /tmp/modmon-complete.sql "$SQLITE3_PATH" "$SCRIPT_STORAGE_DIR/modstats.db" < /tmp/modmon-complete.sql - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" for metric in $metriclist; do { echo ".mode csv" @@ -1010,8 +1014,10 @@ Generate_CSVs(){ opkg update opkg install coreutils-paste fi - paste -d ',' /tmp/CompleteResults_RxTimes.htm /tmp/CompleteResults_RxChannels.htm /tmp/CompleteResults_RxPwr.htm /tmp/CompleteResults_RxSnr.htm /tmp/CompleteResults_RxPstRs.htm > "$CSV_OUTPUT_DIR/CompleteResults_Rx.htm" - paste -d ',' /tmp/CompleteResults_TxTimes.htm /tmp/CompleteResults_TxChannels.htm /tmp/CompleteResults_TxPwr.htm /tmp/CompleteResults_TxT3Out.htm /tmp/CompleteResults_TxT4Out.htm > "$CSV_OUTPUT_DIR/CompleteResults_Tx.htm" + #paste -d ',' /tmp/CompleteResults_RxTimes.htm /tmp/CompleteResults_RxChannels.htm /tmp/CompleteResults_RxPwr.htm /tmp/CompleteResults_RxSnr.htm /tmp/CompleteResults_RxPstRs.htm > "$CSV_OUTPUT_DIR/CompleteResults_Rx.htm" + paste -d ',' /tmp/CompleteResults_RxTimes.htm /tmp/CompleteResults_RxChannels.htm /tmp/CompleteResults_RxPwr.htm /tmp/CompleteResults_RxSnr.htm /tmp/CompleteResults_RxFreq.htm /tmp/CompleteResults_RxOctets.htm /tmp/CompleteResults_RxCorr.htm /tmp/CompleteResults_RxUncor.htm > "$CSV_OUTPUT_DIR/CompleteResults_Rx.htm" + #paste -d ',' /tmp/CompleteResults_TxTimes.htm /tmp/CompleteResults_TxChannels.htm /tmp/CompleteResults_TxPwr.htm > "$CSV_OUTPUT_DIR/CompleteResults_Tx.htm" + paste -d ',' /tmp/CompleteResults_TxTimes.htm /tmp/CompleteResults_TxChannels.htm /tmp/CompleteResults_TxPwr.htm > "$CSV_OUTPUT_DIR/CompleteResults_Tx.htm" rm -f /tmp/CompleteResults*.htm @@ -1071,7 +1077,8 @@ Reset_DB(){ Print_Output true "Database backup failed, please check storage device" "$WARN" fi - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" for metric in $metriclist; do echo "DELETE FROM [modstats_$metric];" > /tmp/modmon-stats.sql "$SQLITE3_PATH" "$SCRIPT_STORAGE_DIR/modstats.db" < /tmp/modmon-stats.sql @@ -1087,7 +1094,8 @@ Process_Upgrade(){ renice 15 $$ Print_Output true "Creating database table indexes..." "$PASS" - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" for metric in $metriclist; do echo "CREATE INDEX IF NOT EXISTS idx_${metric}_time_measurement ON [modstats_$metric] (Timestamp,Measurement);" > /tmp/modmon-upgrade.sql while ! "$SQLITE3_PATH" "$SCRIPT_STORAGE_DIR/modstats.db" < /tmp/modmon-upgrade.sql >/dev/null 2>&1; do @@ -1359,7 +1367,8 @@ Menu_Install(){ Auto_ServiceEvent create 2>/dev/null Shortcut_Script create - metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" +# metriclist="RxPwr RxSnr RxPstRs TxPwr TxT3Out TxT4Out" + metriclist="RxPwr RxSnr RxFreq RxOctets RxCorr RxUncor TxPwr" for metric in $metriclist; do echo "CREATE TABLE IF NOT EXISTS [modstats_$metric] ([StatID] INTEGER PRIMARY KEY NOT NULL,[Timestamp] NUMERIC NOT NULL,[ChannelNum] INTEGER NOT NULL,[Measurement] REAL NOT NULL);" > /tmp/modmon-stats.sql diff --git a/modmonstats_www.asp b/modmonstats_www.asp index d5be8fe..3052e6a 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var RxCount,TxCount,RxColours,TxColours,$j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxPstRs","TxPwr","TxT3Out","TxT4Out"],titlelist=["Downstream Power","Downstream SNR","Post-RS Errors","Upstream Power","T3 Timeouts","T4 Timeouts"],measureunitlist=["dBmV","dB","","dBmV","",""],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];Chart.defaults.global.defaultFontColor="#CCC",Chart.Tooltip.positioners.cursor=function(a,b){return b};function keyHandler(a){82==a.keyCode?($j(document).off("keydown"),ResetZoom()):68==a.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==a.keyCode&&($j(document).off("keydown"),ToggleLines())}$j(document).keydown(function(a){keyHandler(a)}),$j(document).keyup(function(){$j(document).keydown(function(a){keyHandler(a)})});function Draw_Chart_NoData(a,b){document.getElementById("divLineChart_"+a).width="730",document.getElementById("divLineChart_"+a).height="500",document.getElementById("divLineChart_"+a).style.width="730px",document.getElementById("divLineChart_"+a).style.height="500px";var c=document.getElementById("divLineChart_"+a).getContext("2d");c.save(),c.textAlign="center",c.textBaseline="middle",c.font="normal normal bolder 48px Arial",c.fillStyle="white",c.fillText(b,365,250),c.restore()}function Draw_Chart(a,b,c){var d=getChartPeriod($j("#"+a+"_Period option:selected").val()),e=timeunitlist[$j("#"+a+"_Period option:selected").val()],f=intervallist[$j("#"+a+"_Period option:selected").val()],g=window[a+"_"+d];if("undefined"==typeof g||null===g)return void Draw_Chart_NoData(a,"No data to display");if(0==g.length)return void Draw_Chart_NoData(a,"No data to display");var h=[],j=[];for(let d=0;db;b++)window["LineChart_"+metriclist[a]].options.annotation.annotations[b].type=ShowLines;window["LineChart_"+metriclist[a]].update()}}function changeChart(a){value=1*a.value,name=a.id.substring(0,a.id.indexOf("_")),SetCookie(a.id,value),"RxPwr"==name?Draw_Chart("RxPwr",titlelist[0],measureunitlist[0]):"RxSnr"==name?Draw_Chart("RxSnr",titlelist[1],measureunitlist[1]):"RxPstRs"==name?Draw_Chart("RxPstRs",titlelist[2],measureunitlist[2]):"TxPwr"==name?Draw_Chart("TxPwr",titlelist[2],measureunitlist[3]):"TxT3Out"==name?Draw_Chart("TxT3Out",titlelist[4],measureunitlist[4]):"TxT4Out"==name&&Draw_Chart("TxT4Out",titlelist[5],measureunitlist[5])}function RedrawAllCharts(){for(var a=0;ab||e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):"number"==sorttype?-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\")));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+".replace(\"m\",\"000\")) - parseFloat(a."+sortfield+".replace(\"m\",\"000\")));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\"))); "),sortdir="asc"):"date"==sorttype&&(-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(a,b){b.innerHTML==sortname&&("asc"==sortdir?b.innerHTML+=" \u2191":b.innerHTML+=" \u2193")})}function BuildModemLogsTableNoData(){var a="";return a+="",a+="",a+="",a+="
",a+="Data loading...",a+="
",a}function BuildModemLogsTable(){var a="";a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="";for(var b=0;b",a+="",a+="",a+="",a+="";return a+="",a+="
TimePriorityMessage
"+arraysortlistlines[b].Time+""+arraysortlistlines[b].Priority+""+arraysortlistlines[b].Message+"
",a}function BuildMetricTable(a,b,c){var d="
 
";return 0==c&&(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Charts (click to expand/collapse)
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",d+="",d+="
",d+="",d+="     ",d+="",d+="     ",d+="",d+="
",d+="
 
"),d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+" (click to expand/collapse)
Period to display",d+="",d+="
",d+="
",d+="
",c==metriclist.length-1&&(d+="
"),d}function BuildChannelFilterTable(){var a="
 
";return a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="
Chart Filters (click to expand/collapse)
",a+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),a+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),a+="
",a}function BuildChannelFilterRow(a,b,c){var d="
 
";for(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+"
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",channelno=1;channelno",0==channelno%12&&(d+="");return d+="",d+="
",d+="",d+="
",d+="",d+="     ",d+="",d+="
",d}function ToggleDataset(a){for(var b=0;bb;b++)window["LineChart_"+metriclist[a]].options.annotation.annotations[b].type=ShowLines;window["LineChart_"+metriclist[a]].update()}}function changeChart(a){value=1*a.value,name=a.id.substring(0,a.id.indexOf("_")),SetCookie(a.id,value),metriclist[0]==name?Draw_Chart(metriclist[0],titlelist[0],measureunitlist[0]):metriclist[1]==name?Draw_Chart(metriclist[1],titlelist[1],measureunitlist[1]):metriclist[2]==name?Draw_Chart(metriclist[2],titlelist[2],measureunitlist[2]):metriclist[3]==name?Draw_Chart(metriclist[3],titlelist[3],measureunitlist[3]):metriclist[4]==name?Draw_Chart(metriclist[4],titlelist[4],measureunitlist[4]):metriclist[5]==name?Draw_Chart(metriclist[5],titlelist[5],measureunitlist[5]):metriclist[6]==name?Draw_Chart(metriclist[6],titlelist[6],measureunitlist[6])}function RedrawAllCharts(){for(var a=0;ab||e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):"number"==sorttype?-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\")));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+".replace(\"m\",\"000\")) - parseFloat(a."+sortfield+".replace(\"m\",\"000\")));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\"))); "),sortdir="asc"):"date"==sorttype&&(-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(a,b){b.innerHTML==sortname&&("asc"==sortdir?b.innerHTML+=" \u2191":b.innerHTML+=" \u2193")})}function BuildModemLogsTableNoData(){var a="";return a+="",a+="",a+="",a+="
",a+="Data loading...",a+="
",a}function BuildModemLogsTable(){var a="";a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="";for(var b=0;b",a+="",a+="",a+="",a+="";return a+="",a+="
TimePriorityMessage
"+arraysortlistlines[b].Time+""+arraysortlistlines[b].Priority+""+arraysortlistlines[b].Message+"
",a}function BuildMetricTable(a,b,c){var d="
 
";return 0==c&&(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Charts (click to expand/collapse)
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",d+="",d+="
",d+="",d+="     ",d+="",d+="     ",d+="",d+="
",d+="
 
"),d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+" (click to expand/collapse)
Period to display",d+="",d+="
",d+="
",d+="
",c==metriclist.length-1&&(d+="
"),d}function BuildChannelFilterTable(){var a="
 
";return a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="
Chart Filters (click to expand/collapse)
",a+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),a+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),a+="
",a}function BuildChannelFilterRow(a,b,c){var d="
 
";for(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+"
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",channelno=1;channelno",0==channelno%12&&(d+="");return d+="",d+="
",d+="",d+="
",d+="",d+="     ",d+="",d+="
",d}function ToggleDataset(a){for(var b=0;b diff --git a/modmonstats_www.js b/modmonstats_www.js index 3678af8..c4beee5 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -9,9 +9,10 @@ var ShowLines = GetCookie('ShowLines','string'); var DragZoom = true; var ChartPan = false; -var metriclist = ['RxPwr','RxSnr','RxPstRs','TxPwr','TxT3Out','TxT4Out']; -var titlelist = ['Downstream Power','Downstream SNR','Post-RS Errors','Upstream Power','T3 Timeouts','T4 Timeouts']; -var measureunitlist = ['dBmV','dB','','dBmV','','']; +// var metriclist = ['RxPwr','RxSnr','RxPstRs','TxPwr','TxT3Out','TxT4Out']; +var metriclist = ['RxPwr','RxSnr','RxFreq','RxOctets','RxCorr','RxUncor','TxPwr']; +var titlelist = ['Downstream Power','Downstream SNR','Frequency','Octets','Corrected','Uncorrectable','Upstream Power']; +var measureunitlist = ['dBmV','dB','MHz','','','','dBmV']; var chartlist = ['daily','weekly','monthly']; var timeunitlist = ['hour','day','day']; var intervallist = [24,7,30]; @@ -440,17 +441,20 @@ function changeChart(e) { else if(name == 'RxSnr'){ Draw_Chart('RxSnr',titlelist[1],measureunitlist[1]); } - else if(name == 'RxPstRs'){ - Draw_Chart('RxPstRs',titlelist[2],measureunitlist[2]); + else if(name == 'RxFreq'){ + Draw_Chart('RxFreq',titlelist[2],measureunitlist[2]); } - else if(name == 'TxPwr'){ - Draw_Chart('TxPwr',titlelist[3],measureunitlist[3]); + else if(name == 'RxOctets'){ + Draw_Chart('RxOctets',titlelist[3],measureunitlist[3]); + } + else if(name == 'RxCorr'){ + Draw_Chart('RxCorr',titlelist[4],measureunitlist[4]); } - else if(name == 'TxT3Out'){ - Draw_Chart('TxT3Out',titlelist[4],measureunitlist[4]); + else if(name == 'RxUncor'){ + Draw_Chart('RxUncor',titlelist[5],measureunitlist[5]); } - else if(name == 'TxT4Out'){ - Draw_Chart('TxT4Out',titlelist[5],measureunitlist[5]); + else if(name == 'TxPwr'){ + Draw_Chart('TxPwr',titlelist[6],measureunitlist[6]); } } From 04cde6fcc2e212f92df120ce921dbb409875e6e3 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Fri, 18 Mar 2022 16:21:44 +0100 Subject: [PATCH 03/19] 7 metrics list, .asp updated with minified js --- modmonstats_www.asp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index 3052e6a..e1b8c5a 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var RxCount,TxCount,RxColours,TxColours,$j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxFreq","RxOctets","RxCorr","RxUncor","TxPwr"],titlelist=["DownstrRx Power","DownstrRx SNR","Frequency","Octets","Corrected","Uncorrectable","UpstrTx Power"],measureunitlist=["dBmV","dB","MHz","","","","dBmV"],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];Chart.defaults.global.defaultFontColor="#CCC",Chart.Tooltip.positioners.cursor=function(a,b){return b};function keyHandler(a){82==a.keyCode?($j(document).off("keydown"),ResetZoom()):68==a.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==a.keyCode&&($j(document).off("keydown"),ToggleLines())}$j(document).keydown(function(a){keyHandler(a)}),$j(document).keyup(function(){$j(document).keydown(function(a){keyHandler(a)})});function Draw_Chart_NoData(a,b){document.getElementById("divLineChart_"+a).width="730",document.getElementById("divLineChart_"+a).height="500",document.getElementById("divLineChart_"+a).style.width="730px",document.getElementById("divLineChart_"+a).style.height="500px";var c=document.getElementById("divLineChart_"+a).getContext("2d");c.save(),c.textAlign="center",c.textBaseline="middle",c.font="normal normal bolder 48px Arial",c.fillStyle="white",c.fillText(b,365,250),c.restore()}function Draw_Chart(a,b,c){var d=getChartPeriod($j("#"+a+"_Period option:selected").val()),e=timeunitlist[$j("#"+a+"_Period option:selected").val()],f=intervallist[$j("#"+a+"_Period option:selected").val()],g=window[a+"_"+d];if("undefined"==typeof g||null===g)return void Draw_Chart_NoData(a,"No data to display");if(0==g.length)return void Draw_Chart_NoData(a,"No data to display");var h=[],j=[];for(let d=0;db;b++)window["LineChart_"+metriclist[a]].options.annotation.annotations[b].type=ShowLines;window["LineChart_"+metriclist[a]].update()}}function changeChart(a){value=1*a.value,name=a.id.substring(0,a.id.indexOf("_")),SetCookie(a.id,value),metriclist[0]==name?Draw_Chart(metriclist[0],titlelist[0],measureunitlist[0]):metriclist[1]==name?Draw_Chart(metriclist[1],titlelist[1],measureunitlist[1]):metriclist[2]==name?Draw_Chart(metriclist[2],titlelist[2],measureunitlist[2]):metriclist[3]==name?Draw_Chart(metriclist[3],titlelist[3],measureunitlist[3]):metriclist[4]==name?Draw_Chart(metriclist[4],titlelist[4],measureunitlist[4]):metriclist[5]==name?Draw_Chart(metriclist[5],titlelist[5],measureunitlist[5]):metriclist[6]==name?Draw_Chart(metriclist[6],titlelist[6],measureunitlist[6])}function RedrawAllCharts(){for(var a=0;ab||e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),sortdir="asc"):"number"==sorttype?-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\")));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+".replace(\"m\",\"000\")) - parseFloat(a."+sortfield+".replace(\"m\",\"000\")));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+".replace(\"m\",\"000\")) - parseFloat(b."+sortfield+".replace(\"m\",\"000\"))); "),sortdir="asc"):"date"==sorttype&&(-1==sorttext.indexOf("\u2193")&&-1==sorttext.indexOf("\u2191")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc"):-1==sorttext.indexOf("\u2193")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),sortdir="desc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),sortdir="asc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(a,b){b.innerHTML==sortname&&("asc"==sortdir?b.innerHTML+=" \u2191":b.innerHTML+=" \u2193")})}function BuildModemLogsTableNoData(){var a="";return a+="",a+="",a+="",a+="
",a+="Data loading...",a+="
",a}function BuildModemLogsTable(){var a="";a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="";for(var b=0;b",a+="",a+="",a+="",a+="";return a+="",a+="
TimePriorityMessage
"+arraysortlistlines[b].Time+""+arraysortlistlines[b].Priority+""+arraysortlistlines[b].Message+"
",a}function BuildMetricTable(a,b,c){var d="
 
";return 0==c&&(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Charts (click to expand/collapse)
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",d+="",d+="
",d+="",d+="     ",d+="",d+="     ",d+="",d+="
",d+="
 
"),d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+" (click to expand/collapse)
Period to display",d+="",d+="
",d+="
",d+="
",c==metriclist.length-1&&(d+="
"),d}function BuildChannelFilterTable(){var a="
 
";return a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="",a+="
Chart Filters (click to expand/collapse)
",a+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),a+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),a+="
",a}function BuildChannelFilterRow(a,b,c){var d="
 
";for(d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="
"+b+"
",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",d+="",channelno=1;channelno",0==channelno%12&&(d+="");return d+="",d+="
",d+="",d+="
",d+="",d+="     ",d+="",d+="
",d}function ToggleDataset(a){for(var b=0;b (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e From a07f5053c49cdf18a0cdb20108b14a8f350842c2 Mon Sep 17 00:00:00 2001 From: waluwaz <51720125+waluwaz@users.noreply.github.com> Date: Fri, 18 Mar 2022 16:43:12 +0100 Subject: [PATCH 04/19] After making sure I clicked the Compress button on jscompress.com... Not kidding, at some point, I thought that switching tabs on jscompress.com triggered the compression... --- modmonstats_www.asp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index e1b8c5a..0ad90c4 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxPstRs","TxPwr","TxT3Out","TxT4Out"],titlelist=["Downstream Power","Downstream SNR","Post-RS Errors","Upstream Power","T3 Timeouts","T4 Timeouts"],measureunitlist=["dBmV","dB","","dBmV","",""],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e From f80306001fcb460b460b124fc974aef3aecf9ea4 Mon Sep 17 00:00:00 2001 From: waluwaz <51720125+waluwaz@users.noreply.github.com> Date: Fri, 18 Mar 2022 16:50:56 +0100 Subject: [PATCH 05/19] With correct js... --- modmonstats_www.asp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index 0ad90c4..ab5e894 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxPstRs","TxPwr","TxT3Out","TxT4Out"],titlelist=["Downstream Power","Downstream SNR","Post-RS Errors","Upstream Power","T3 Timeouts","T4 Timeouts"],measureunitlist=["dBmV","dB","","dBmV","",""],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e From 019fe33947bdcc030800e4dabb6047a3a94c382e Mon Sep 17 00:00:00 2001 From: waluwaz Date: Fri, 18 Mar 2022 22:01:52 +0100 Subject: [PATCH 06/19] Upstream and filtering not working --- modmon.sh | 2 +- modmonstats_www.asp | 10 +++++++--- modmonstats_www.js | 5 ++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modmon.sh b/modmon.sh index c2214f4..63658e5 100644 --- a/modmon.sh +++ b/modmon.sh @@ -818,7 +818,7 @@ Get_Modem_Stats(){ # Processing the Rx, DownStream -cat "$shstatsfile_curl" | jq '.data.DSTbl' | sed s/ChannelID/RxChannelID/ | sed s/PowerLevel/RxPwr/ | sed s/SNRLevel/RxSnr/ | sed s/Frequency/RxFreq/ | sed s/Octets/RxOctets/ | sed s/Correcteds/RxCorr/ | sed s/Uncorrectables/RxUncor/ | sed s/__id/01Discard/ | sed s/Modulation/03Discard/ | sed s/Octets/04Discard/ | sed s/LockStatus/05Discard/ | sed s/ChannelType/06Discard/ > "$shstatsfile_dst" +cat "$shstatsfile_curl" | jq '.data.DSTbl' | sed s/ChannelID/RxChannelID/ | sed s/PowerLevel/RxPwr/ | sed s/SNRLevel/RxSnr/ | sed s/Frequency/RxFreq/ | sed s/Octets/RxOctets/ | sed s/Correcteds/RxCorr/ | sed s/Uncorrectables/RxUncor/ | sed s/__id/01Discard/ | sed s/Modulation/03Discard/ | sed s/LockStatus/05Discard/ | sed s/ChannelType/06Discard/ > "$shstatsfile_dst" # Note that the filtering above with grep, that ensures that only target measures stay in the file will work # because I artificially renamed lines with 0x prefix and the Discard keyword diff --git a/modmonstats_www.asp b/modmonstats_www.asp index e1b8c5a..946aecd 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxPstRs","TxPwr","TxT3Out","TxT4Out"],titlelist=["Downstream Power","Downstream SNR","Post-RS Errors","Upstream Power","T3 Timeouts","T4 Timeouts"],measureunitlist=["dBmV","dB","","dBmV","",""],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e @@ -76,14 +76,15 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
 
-
modmon
+
modmon for VOO
Stats last updated:
-
modmon is a tool that tracks your cable modem's stats (such as signal power levels) for AsusWRT Merlin with charts for daily, weekly and monthly summaries.
+
modmon for VOO is a fork of modmon. It's nowhere near as polished as modmon.
+ +
Utilities (click to expand/collapse)
Update stats @@ -152,6 +154,7 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
diff --git a/modmonstats_www.js b/modmonstats_www.js index c4beee5..7bdaeb7 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -366,7 +366,7 @@ function getAverage(datasetname){ function startAtZero(datasetname){ var starty = false; - if(datasetname.indexOf('PstRS') != -1 || datasetname.indexOf('T3Out') != -1 || datasetname.indexOf('T4Out') != -1){ + if(datasetname.indexOf('RxOctets') != -1 || datasetname.indexOf('RxCorr') != -1 || datasetname.indexOf('RxUncor') != -1){ starty = true; } return starty; @@ -401,6 +401,9 @@ function GetMaxChannels(){ var TxCountArray = []; for(var i = 0; i < metriclist.length; i++){ var varname='LineChart_'+metriclist[i]; + /* For e.g. Rx, we have a filtering option to select channels. Different metric might cover different number of channels. + The code assumes that the channels are always 1..n, with no gaps. + This is how, for 16 channels scattered across 11..22, the UI shows filters for 1..16 */ var channelcount=window[varname].data.datasets.length; if(varname.indexOf('Rx') != -1){ RxCountArray.push(channelcount); From 55eca5cae8f906a826506f381c7f10817ed6d63a Mon Sep 17 00:00:00 2001 From: waluwaz <51720125+waluwaz@users.noreply.github.com> Date: Fri, 18 Mar 2022 23:09:38 +0100 Subject: [PATCH 07/19] From local version, injected through web ui in browser --- modmonstats_www.asp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index ab5e894..946aecd 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxFreq","RxOctets","RxCorr","RxUncor","TxPwr"],titlelist=["Downstream Power","Downstream SNR","Frequency","Octets","Corrected","Uncorrectable","Upstream Power"],measureunitlist=["dBmV","dB","MHz","","","","dBmV"],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e @@ -76,14 +76,15 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
 
-
modmon
+
modmon for VOO
Stats last updated:
-
modmon is a tool that tracks your cable modem's stats (such as signal power levels) for AsusWRT Merlin with charts for daily, weekly and monthly summaries.
+
modmon for VOO is a fork of modmon. It's nowhere near as polished as modmon.
+ + - -
Utilities (click to expand/collapse)
Update stats @@ -152,6 +154,7 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
From 6b5befd93a90b8e006929d7a92ae700a1be2e7a7 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Fri, 18 Mar 2022 23:41:25 +0100 Subject: [PATCH 08/19] Update to comments and labels --- modmonstats_www.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modmonstats_www.js b/modmonstats_www.js index 7bdaeb7..980d35e 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -403,7 +403,7 @@ function GetMaxChannels(){ var varname='LineChart_'+metriclist[i]; /* For e.g. Rx, we have a filtering option to select channels. Different metric might cover different number of channels. The code assumes that the channels are always 1..n, with no gaps. - This is how, for 16 channels scattered across 11..22, the UI shows filters for 1..16 */ + This is how, for 16 channels scattered across 1..22, the UI shows filters for 1..16 */ var channelcount=window[varname].data.datasets.length; if(varname.indexOf('Rx') != -1){ RxCountArray.push(channelcount); @@ -820,7 +820,7 @@ function UpdateStats(){ showhide('btnUpdateStats',false); document.formScriptActions.action_script.value = 'start_modmon'; document.formScriptActions.submit(); - document.getElementById('modupdate_text').innerHTML = 'Retrieving VOO Technicolor stats'; + document.getElementById('modupdate_text').innerHTML = 'Retrieving VOO stats'; showhide('imgModUpdate',true); showhide('modupdate_text',true); setTimeout(update_modtest,5000); From 99a9ee1a603525eb0d51df697179181fda5f4b01 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Fri, 18 Mar 2022 23:48:14 +0100 Subject: [PATCH 09/19] Reincluded info on page (e.g. version, e.g. factor fix) --- modmonstats_www.asp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index 946aecd..431e6de 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -84,7 +84,6 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
Utilities (click to expand/collapse)
Update stats @@ -154,7 +152,6 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
From 291b307e2aadea8fda57d16509d991a3024dae9a Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 15:11:30 +0100 Subject: [PATCH 10/19] Axis for Octets graph starts at zero. Useless parts not requested from curl. --- modmon.sh | 13 ++++++------- modmonstats_www.js | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modmon.sh b/modmon.sh index 63658e5..280fd0e 100644 --- a/modmon.sh +++ b/modmon.sh @@ -803,24 +803,23 @@ Get_Modem_Stats(){ # The processing also does additional processing to globally prepare the text # Ultimately, this produces a file, $shstatsfile # -# Note that the lines from my modem exhibit a few differences (on top of being one long line being structured as json, but this can be solved by jq ) +# Note that the lines from the VOO modem exhibit a few differences (on top of being one long line being structured as json, but this can be solved by jq ) # Note the leading "blanks", note the blank after the colonn, note the minus sign, the decimal part and the unit. -# Jacks's solution must also deal with decimal parts for power level, so the code must be OK with it. -# I guess the code that can deal with decimals can deal with negative figures. -# "PowerLevel": "-4.6 dBmV", # /usr/sbin/curl -fs --retry 3 --connect-timeout 15 "http://192.168.100.1/getRouterStatus" | sed s/1.3.6.1.2.1.10.127.1.1.1.1.6/RxPwr/ | sed s/1.3.6.1.4.1.4491.2.1.20.1.2.1.1/TxPwr/ | sed s/1.3.6.1.4.1.4491.2.1.20.1.2.1.2/TxT3Out/ | sed s/1.3.6.1.4.1.4491.2.1.20.1.2.1.3/TxT4Out/ | sed s/1.3.6.1.4.1.4491.2.1.20.1.24.1.1/RxMer/ | sed s/1.3.6.1.2.1.10.127.1.1.4.1.4/RxPstRs/ | sed s/1.3.6.1.2.1.10.127.1.1.4.1.5/RxSnr/ | sed s/1.3.6.1.2.1.69.1.5.8.1.2/DevEvFirstTimeOid/ | sed s/1.3.6.1.2.1.69.1.5.8.1.5/DevEvId/ | sed s/1.3.6.1.2.1.69.1.5.8.1.7/DevEvText/ | sed 's/"//g' | sed 's/,$//g' | sed 's/\./,/' | sed 's/:/,/' | grep "^[A-Za-z]" > "$shstatsfile" # curl 'http://192.168.100.1/api/v1/modem/exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl?_=1647373319922' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-CSRF-TOKEN: 2d39f236c2776485efc99f15d411b5f5' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: http://192.168.100.1/' -H 'Cookie: lang=fr; PHPSESSID=42degahqbb8u5kikpbfiid5s6n; auth=2d39f236c2776485efc99f15d411b5f5' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' - - /usr/sbin/curl -fs --retry 3 --connect-timeout 15 'http://192.168.100.1/api/v1/modem/exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'X-CSRF-TOKEN: 7d298d27f7ede0df78c9292cdca2cd57' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=fr; PHPSESSID=9csugaomqu52rqc6vgul600b91; auth=7d298d27f7ede0df78c9292cdca2cd57' > "$shstatsfile_curl" +# The API call to feed the standard webpage in the standard admin UI, requests 5 items (exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl). +# The curl call o nly request the 2 items from which data gets really extracted. Note that exUSTbl and exDSTbl are seemingly always empty. +# Note that ErrTbl seems to have data that is also available in another item. + /usr/sbin/curl -fs --retry 3 --connect-timeout 15 'http://192.168.100.1/api/v1/modem/USTbl,DSTbl' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'X-CSRF-TOKEN: 7d298d27f7ede0df78c9292cdca2cd57' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=fr; PHPSESSID=9csugaomqu52rqc6vgul600b91; auth=7d298d27f7ede0df78c9292cdca2cd57' > "$shstatsfile_curl" # Processing the Rx, DownStream cat "$shstatsfile_curl" | jq '.data.DSTbl' | sed s/ChannelID/RxChannelID/ | sed s/PowerLevel/RxPwr/ | sed s/SNRLevel/RxSnr/ | sed s/Frequency/RxFreq/ | sed s/Octets/RxOctets/ | sed s/Correcteds/RxCorr/ | sed s/Uncorrectables/RxUncor/ | sed s/__id/01Discard/ | sed s/Modulation/03Discard/ | sed s/LockStatus/05Discard/ | sed s/ChannelType/06Discard/ > "$shstatsfile_dst" # Note that the filtering above with grep, that ensures that only target measures stay in the file will work -# because I artificially renamed lines with 0x prefix and the Discard keyword +# because I artificially renamed lines with 0x prefix (and the Discard keyword for clarity's sake) # Processing the TX, UpStream cat "$shstatsfile_curl" | jq '.data.USTbl' | sed s/ChannelID/TxChannelID/ | sed s/PowerLevel/TxPwr/ | sed s/__id/01Discard/ | sed s/Frequency/02Discard/ | sed s/ChannelType/03Discard/ | sed s/SymbolRate/04Discard/ | sed s/Modulation/05Discard/ | sed s/LockStatus/06Discard/ > "$shstatsfile_ust" diff --git a/modmonstats_www.js b/modmonstats_www.js index 980d35e..b68b71f 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -366,7 +366,7 @@ function getAverage(datasetname){ function startAtZero(datasetname){ var starty = false; - if(datasetname.indexOf('RxOctets') != -1 || datasetname.indexOf('RxCorr') != -1 || datasetname.indexOf('RxUncor') != -1){ + if(datasetname.indexOf('RxFreq') != -1 || datasetname.indexOf('RxOctets') != -1 || datasetname.indexOf('RxCorr') != -1 || datasetname.indexOf('RxUncor') != -1){ starty = true; } return starty; From 3f206ae9269053f75f59722638bb8fe8e6a55153 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 18:30:14 +0100 Subject: [PATCH 11/19] TxCount hardcoded to 4 in GetMaxChannels --- modmonstats_www.asp | 4 ++-- modmonstats_www.js | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modmonstats_www.asp b/modmonstats_www.asp index 431e6de..39eddd9 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,7 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxFreq","RxOctets","RxCorr","RxUncor","TxPwr"],titlelist=["Downstream Power","Downstream SNR","Frequency","Octets","Corrected","Uncorrectable","Upstream Power"],measureunitlist=["dBmV","dB","MHz","","","","dBmV"],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e @@ -76,7 +76,7 @@ var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",
 
-
modmon for VOO
+
modmon
Stats last updated:
modmon for VOO is a fork of modmon. It's nowhere near as polished as modmon.
diff --git a/modmonstats_www.js b/modmonstats_www.js index b68b71f..d948293 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -401,9 +401,6 @@ function GetMaxChannels(){ var TxCountArray = []; for(var i = 0; i < metriclist.length; i++){ var varname='LineChart_'+metriclist[i]; - /* For e.g. Rx, we have a filtering option to select channels. Different metric might cover different number of channels. - The code assumes that the channels are always 1..n, with no gaps. - This is how, for 16 channels scattered across 1..22, the UI shows filters for 1..16 */ var channelcount=window[varname].data.datasets.length; if(varname.indexOf('Rx') != -1){ RxCountArray.push(channelcount); @@ -413,7 +410,8 @@ function GetMaxChannels(){ } } RxCount = Math.max.apply(Math,RxCountArray); - TxCount = Math.max.apply(Math,TxCountArray); +/* TxCount = Math.max.apply(Math,TxCountArray); */ + TxCount = 4; } function ToggleLines(){ From 9cafb8dee708859b7543651085e726a9724b1ae7 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 22:47:55 +0100 Subject: [PATCH 12/19] 0.3 with logs - log timestamp broken - channel filtering still broken --- .../01_curl_sample_full.sh | 6 +- .../08_curl_log_sample_thin.sh | 1 + .../09_json_log_raw.json | 1 + .../10_json_log_nice.json | 232 ++++++++++++++++++ .../11_prepared_log_sample | 226 +++++++++++++++++ modmon.sh | 43 ++-- modmonstats_www.js | 2 +- 7 files changed, 491 insertions(+), 20 deletions(-) create mode 100644 documentation/Technicolor_CGA4233_VOO/08_curl_log_sample_thin.sh create mode 100644 documentation/Technicolor_CGA4233_VOO/09_json_log_raw.json create mode 100644 documentation/Technicolor_CGA4233_VOO/10_json_log_nice.json create mode 100644 documentation/Technicolor_CGA4233_VOO/11_prepared_log_sample diff --git a/documentation/Technicolor_CGA4233_VOO/01_curl_sample_full.sh b/documentation/Technicolor_CGA4233_VOO/01_curl_sample_full.sh index 27163ab..fa42902 100644 --- a/documentation/Technicolor_CGA4233_VOO/01_curl_sample_full.sh +++ b/documentation/Technicolor_CGA4233_VOO/01_curl_sample_full.sh @@ -1 +1,5 @@ -curl 'http://192.168.100.1/api/v1/modem/exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl?_=1647091502526' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-CSRF-TOKEN: e2e17093a9d053ef75f634b21b7918a0' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: http://192.168.100.1/' -H 'Cookie: lang=fr; PHPSESSID=mhtal0ckajf2hsjsec5ch4m76a; auth=e2e17093a9d053ef75f634b21b7918a0' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' \ No newline at end of file +curl 'http://192.168.100.1/api/v1/modem/exUSTbl,exDSTbl,USTbl,DSTbl,ErrTbl?_=1647091502526' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-CSRF-TOKEN: e2e17093a9d053ef75f634b21b7918a0' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: http://192.168.100.1/' -H 'Cookie: lang=fr; PHPSESSID=mhtal0ckajf2hsjsec5ch4m76a; auth=e2e17093a9d053ef75f634b21b7918a0' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' + + + +curl 'http://192.168.100.1/api/v1/modem/LogTbl?_=1647800130683' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'Accept-Language: en-US,en;q=0.5' -H 'Accept-Encoding: gzip, deflate' -H 'X-CSRF-TOKEN: 85e9e2137f59ed1caa27cafd40f6657f' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Referer: http://192.168.100.1/' -H 'Cookie: PHPSESSID=chqblofn34v2rsqju5ajodrs0v; lang=fr; auth=85e9e2137f59ed1caa27cafd40f6657f' -H 'DNT: 1' -H 'Sec-GPC: 1' -H 'Pragma: no-cache' -H 'Cache-Control: no-cache' \ No newline at end of file diff --git a/documentation/Technicolor_CGA4233_VOO/08_curl_log_sample_thin.sh b/documentation/Technicolor_CGA4233_VOO/08_curl_log_sample_thin.sh new file mode 100644 index 0000000..fb839e8 --- /dev/null +++ b/documentation/Technicolor_CGA4233_VOO/08_curl_log_sample_thin.sh @@ -0,0 +1 @@ +curl -fs --retry 3 --connect-timeout 15 'http://192.168.100.1/api/v1/modem/LogTbl' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'X-CSRF-TOKEN: 7d298d27f7ede0df78c9292cdca2cd57' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=fr; PHPSESSID=9csugaomqu52rqc6vgul600b91; auth=7d298d27f7ede0df78c9292cdca2cd57' > "$shstatsfile_curl" diff --git a/documentation/Technicolor_CGA4233_VOO/09_json_log_raw.json b/documentation/Technicolor_CGA4233_VOO/09_json_log_raw.json new file mode 100644 index 0000000..e07c186 --- /dev/null +++ b/documentation/Technicolor_CGA4233_VOO/09_json_log_raw.json @@ -0,0 +1 @@ +{"error":"ok","message":"all values retrieved","data":{"LogTbl":[{"__id":"1","time":"Mon Mar 14 09:57:05 2022\n","id":"2436694066","level":"6","text":"Honoring MDD; IP provisioning mode = IPv4"},{"__id":"2","time":"Mon Mar 14 09:57:07 2022\n","id":"68000300","level":"5","text":"DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"3","time":"Mon Mar 14 09:57:07 2022\n","id":"73040100","level":"6","text":"TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"4","time":"Mon Mar 14 09:57:22 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"5","time":"Mon Mar 14 09:57:26 2022\n","id":"84020300","level":"5","text":"MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"6","time":"Mon Mar 14 09:57:27 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"7","time":"Mon Mar 14 09:57:33 2022\n","id":"82000400","level":"3","text":"Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"8","time":"Mon Mar 14 09:57:34 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"9","time":"Mon Mar 14 09:59:15 2022\n","id":"82000400","level":"3","text":"Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"10","time":"Mon Mar 14 09:59:20 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:00:00:00:00:00;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"11","time":"Mon Mar 14 09:59:58 2022\n","id":"2436694066","level":"6","text":"Honoring MDD; IP provisioning mode = IPv4"},{"__id":"12","time":"Mon Mar 14 10:00:01 2022\n","id":"68000300","level":"5","text":"DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"13","time":"Mon Mar 14 10:00:02 2022\n","id":"73040100","level":"6","text":"TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"14","time":"Mon Mar 14 10:00:33 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"15","time":"Mon Mar 14 10:00:36 2022\n","id":"84020300","level":"5","text":"MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"16","time":"Mon Mar 14 10:00:36 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"17","time":"Mon Mar 14 10:00:42 2022\n","id":"84020300","level":"5","text":"MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"18","time":"Mon Mar 14 10:00:42 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"19","time":"Mon Mar 14 10:01:22 2022\n","id":"82000700","level":"3","text":"Unicast Ranging Received Abort Response - Re-initializing MAC;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"20","time":"Mon Mar 14 10:01:36 2022\n","id":"2436694066","level":"6","text":"Honoring MDD; IP provisioning mode = IPv4"},{"__id":"21","time":"Mon Mar 14 10:01:39 2022\n","id":"68000300","level":"5","text":"DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"22","time":"Mon Mar 14 10:01:39 2022\n","id":"73040100","level":"6","text":"TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"23","time":"Mon Mar 14 20:02:24 2022\n","id":"84000500","level":"3","text":"SYNC Timing Synchronization failure - Loss of Sync;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"24","time":"Mon Mar 14 20:02:27 2022\n","id":"82001100","level":"5","text":"RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"25","time":"Mon Mar 14 20:02:27 2022\n","id":"2436694061","level":"5","text":"Dynamic Range Window violation"},{"__id":"26","time":"Tue Mar 15 03:27:35 2022\n","id":"68010300","level":"4","text":"DHCP RENEW WARNING - Field invalid in response v4 option;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"27","time":"Sun Mar 20 11:18:56 2022\n","id":"84000100","level":"3","text":"SYNC Timing Synchronization failure - Failed to acquire QAM\/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"28","time":"Sun Mar 20 11:19:03 2022\n","id":"82000200","level":"3","text":"No Ranging Response received - T3 time-out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"29","time":"Sun Mar 20 11:20:11 2022\n","id":"82001100","level":"5","text":"RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"30","time":"Sun Mar 20 11:20:11 2022\n","id":"2436694061","level":"5","text":"Dynamic Range Window violation"},{"__id":"31","time":"Sun Mar 20 11:20:11 2022\n","id":"82001100","level":"5","text":"RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;"},{"__id":"32","time":"Sun Mar 20 11:20:11 2022\n","id":"2436694061","level":"5","text":"Dynamic Range Window violation"}]}} \ No newline at end of file diff --git a/documentation/Technicolor_CGA4233_VOO/10_json_log_nice.json b/documentation/Technicolor_CGA4233_VOO/10_json_log_nice.json new file mode 100644 index 0000000..303d2c7 --- /dev/null +++ b/documentation/Technicolor_CGA4233_VOO/10_json_log_nice.json @@ -0,0 +1,232 @@ +{ + "error": "ok", + "message": "all values retrieved", + "data": { + "LogTbl": [ + { + "__id": "1", + "time": "Mon Mar 14 09:57:05 2022\n", + "id": "2436694066", + "level": "6", + "text": "Honoring MDD; IP provisioning mode = IPv4" + }, + { + "__id": "2", + "time": "Mon Mar 14 09:57:07 2022\n", + "id": "68000300", + "level": "5", + "text": "DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "3", + "time": "Mon Mar 14 09:57:07 2022\n", + "id": "73040100", + "level": "6", + "text": "TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "4", + "time": "Mon Mar 14 09:57:22 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "5", + "time": "Mon Mar 14 09:57:26 2022\n", + "id": "84020300", + "level": "5", + "text": "MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "6", + "time": "Mon Mar 14 09:57:27 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "7", + "time": "Mon Mar 14 09:57:33 2022\n", + "id": "82000400", + "level": "3", + "text": "Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "8", + "time": "Mon Mar 14 09:57:34 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "9", + "time": "Mon Mar 14 09:59:15 2022\n", + "id": "82000400", + "level": "3", + "text": "Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "10", + "time": "Mon Mar 14 09:59:20 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:00:00:00:00:00;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "11", + "time": "Mon Mar 14 09:59:58 2022\n", + "id": "2436694066", + "level": "6", + "text": "Honoring MDD; IP provisioning mode = IPv4" + }, + { + "__id": "12", + "time": "Mon Mar 14 10:00:01 2022\n", + "id": "68000300", + "level": "5", + "text": "DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "13", + "time": "Mon Mar 14 10:00:02 2022\n", + "id": "73040100", + "level": "6", + "text": "TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "14", + "time": "Mon Mar 14 10:00:33 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "15", + "time": "Mon Mar 14 10:00:36 2022\n", + "id": "84020300", + "level": "5", + "text": "MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "16", + "time": "Mon Mar 14 10:00:36 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "17", + "time": "Mon Mar 14 10:00:42 2022\n", + "id": "84020300", + "level": "5", + "text": "MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "18", + "time": "Mon Mar 14 10:00:42 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "19", + "time": "Mon Mar 14 10:01:22 2022\n", + "id": "82000700", + "level": "3", + "text": "Unicast Ranging Received Abort Response - Re-initializing MAC;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "20", + "time": "Mon Mar 14 10:01:36 2022\n", + "id": "2436694066", + "level": "6", + "text": "Honoring MDD; IP provisioning mode = IPv4" + }, + { + "__id": "21", + "time": "Mon Mar 14 10:01:39 2022\n", + "id": "68000300", + "level": "5", + "text": "DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "22", + "time": "Mon Mar 14 10:01:39 2022\n", + "id": "73040100", + "level": "6", + "text": "TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "23", + "time": "Mon Mar 14 20:02:24 2022\n", + "id": "84000500", + "level": "3", + "text": "SYNC Timing Synchronization failure - Loss of Sync;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "24", + "time": "Mon Mar 14 20:02:27 2022\n", + "id": "82001100", + "level": "5", + "text": "RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "25", + "time": "Mon Mar 14 20:02:27 2022\n", + "id": "2436694061", + "level": "5", + "text": "Dynamic Range Window violation" + }, + { + "__id": "26", + "time": "Tue Mar 15 03:27:35 2022\n", + "id": "68010300", + "level": "4", + "text": "DHCP RENEW WARNING - Field invalid in response v4 option;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "27", + "time": "Sun Mar 20 11:18:56 2022\n", + "id": "84000100", + "level": "3", + "text": "SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "28", + "time": "Sun Mar 20 11:19:03 2022\n", + "id": "82000200", + "level": "3", + "text": "No Ranging Response received - T3 time-out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "29", + "time": "Sun Mar 20 11:20:11 2022\n", + "id": "82001100", + "level": "5", + "text": "RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "30", + "time": "Sun Mar 20 11:20:11 2022\n", + "id": "2436694061", + "level": "5", + "text": "Dynamic Range Window violation" + }, + { + "__id": "31", + "time": "Sun Mar 20 11:20:11 2022\n", + "id": "82001100", + "level": "5", + "text": "RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1;" + }, + { + "__id": "32", + "time": "Sun Mar 20 11:20:11 2022\n", + "id": "2436694061", + "level": "5", + "text": "Dynamic Range Window violation" + } + ] + } + } \ No newline at end of file diff --git a/documentation/Technicolor_CGA4233_VOO/11_prepared_log_sample b/documentation/Technicolor_CGA4233_VOO/11_prepared_log_sample new file mode 100644 index 0000000..1b09ef4 --- /dev/null +++ b/documentation/Technicolor_CGA4233_VOO/11_prepared_log_sample @@ -0,0 +1,226 @@ +[ + { + A__id,,1, + time,,Mon Mar 14 09:57:05 2022\n, + id,,2436694066, + level,,6, + text,,Honoring MDD; IP provisioning mode = IPv4 + }, + { + A__id,,2, + time,,Mon Mar 14 09:57:07 2022\n, + id,,68000300, + level,,5, + text,,DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,3, + time,,Mon Mar 14 09:57:07 2022\n, + id,,73040100, + level,,6, + text,,TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,4, + time,,Mon Mar 14 09:57:22 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,5, + time,,Mon Mar 14 09:57:26 2022\n, + id,,84020300, + level,,5, + text,,MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,6, + time,,Mon Mar 14 09:57:27 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,7, + time,,Mon Mar 14 09:57:33 2022\n, + id,,82000400, + level,,3, + text,,Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,8, + time,,Mon Mar 14 09:57:34 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,9, + time,,Mon Mar 14 09:59:15 2022\n, + id,,82000400, + level,,3, + text,,Received Response to Broadcast Maintenance Request, But no Unicast Maintenance opportunities received - T4 time out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,10, + time,,Mon Mar 14 09:59:20 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:00:00:00:00:00;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,11, + time,,Mon Mar 14 09:59:58 2022\n, + id,,2436694066, + level,,6, + text,,Honoring MDD; IP provisioning mode = IPv4 + }, + { + A__id,,12, + time,,Mon Mar 14 10:00:01 2022\n, + id,,68000300, + level,,5, + text,,DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,13, + time,,Mon Mar 14 10:00:02 2022\n, + id,,73040100, + level,,6, + text,,TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,14, + time,,Mon Mar 14 10:00:33 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,15, + time,,Mon Mar 14 10:00:36 2022\n, + id,,84020300, + level,,5, + text,,MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,16, + time,,Mon Mar 14 10:00:36 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,17, + time,,Mon Mar 14 10:00:42 2022\n, + id,,84020300, + level,,5, + text,,MDD message timeout;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,18, + time,,Mon Mar 14 10:00:42 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,19, + time,,Mon Mar 14 10:01:22 2022\n, + id,,82000700, + level,,3, + text,,Unicast Ranging Received Abort Response - Re-initializing MAC;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,20, + time,,Mon Mar 14 10:01:36 2022\n, + id,,2436694066, + level,,6, + text,,Honoring MDD; IP provisioning mode = IPv4 + }, + { + A__id,,21, + time,,Mon Mar 14 10:01:39 2022\n, + id,,68000300, + level,,5, + text,,DHCP WARNING - Non-critical field invalid in response ;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,22, + time,,Mon Mar 14 10:01:39 2022\n, + id,,73040100, + level,,6, + text,,TLV-11 - unrecognized OID;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,23, + time,,Mon Mar 14 20:02:24 2022\n, + id,,84000500, + level,,3, + text,,SYNC Timing Synchronization failure - Loss of Sync;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,24, + time,,Mon Mar 14 20:02:27 2022\n, + id,,82001100, + level,,5, + text,,RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,25, + time,,Mon Mar 14 20:02:27 2022\n, + id,,2436694061, + level,,5, + text,,Dynamic Range Window violation + }, + { + A__id,,26, + time,,Tue Mar 15 03:27:35 2022\n, + id,,68010300, + level,,4, + text,,DHCP RENEW WARNING - Field invalid in response v4 option;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,27, + time,,Sun Mar 20 11:18:56 2022\n, + id,,84000100, + level,,3, + text,,SYNC Timing Synchronization failure - Failed to acquire QAM/QPSK symbol timing;;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,28, + time,,Sun Mar 20 11:19:03 2022\n, + id,,82000200, + level,,3, + text,,No Ranging Response received - T3 time-out;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,29, + time,,Sun Mar 20 11:20:11 2022\n, + id,,82001100, + level,,5, + text,,RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,30, + time,,Sun Mar 20 11:20:11 2022\n, + id,,2436694061, + level,,5, + text,,Dynamic Range Window violation + }, + { + A__id,,31, + time,,Sun Mar 20 11:20:11 2022\n, + id,,82001100, + level,,5, + text,,RNG-RSP CCAP Commanded Power Exceeds Value Corresponding to the Top of the DRW;CM-MAC=e4:bf:fa:25:01:63;CMTS-MAC=00:af:1f:1e:7d:ce;CM-QOS=1.1;CM-VER=3.1; + }, + { + A__id,,32, + time,,Sun Mar 20 11:20:11 2022\n, + id,,2436694061, + level,,5, + text,,Dynamic Range Window violation + } +] diff --git a/modmon.sh b/modmon.sh index 280fd0e..2153fba 100644 --- a/modmon.sh +++ b/modmon.sh @@ -1051,17 +1051,24 @@ Generate_Modem_Logs(){ rm -f "$SCRIPT_STORAGE_DIR/modlogs.js" rm -f "$SCRIPT_STORAGE_DIR/modlogs.htm" rm -f /tmp/modlogs.csv - logcount="$(grep -c "DevEv" $shstatsfile)" + + shstatsfile_logtbl="/tmp/shstats_logtbl.csv" + + /usr/sbin/curl -fs --retry 3 --connect-timeout 15 'http://192.168.100.1/api/v1/modem/LogTbl' -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0' -H 'Accept: */*' -H 'X-CSRF-TOKEN: 7d298d27f7ede0df78c9292cdca2cd57' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' -H 'Cookie: lang=fr; PHPSESSID=9csugaomqu52rqc6vgul600b91; auth=7d298d27f7ede0df78c9292cdca2cd57' | jq '.data.LogTbl' | sed 's/__id/A__id/' | sed 's/"//g' | sed 's/: /,,/' > "$shstatsfile_logtbl" + + logcount="$(grep -c "A__id" $shstatsfile_logtbl)" counter=1 until [ $counter -gt "$logcount" ]; do - logtime="$(grep "DevEv" $shstatsfile | sed "$counter!d" | cut -d',' -f3)" - logprio="$(grep "DevEv" $shstatsfile | sed "$((counter+1))!d" | cut -d',' -f3 | sed 's/3/Critical/;s/4/Error/;s/5/Warning/;s/6/Notice/')" - logmessage="$(grep "DevEv" $shstatsfile | sed "$((counter+2))!d" | cut -d',' -f3)" + logtime="$(grep "time,," $shstatsfile_logtbl | sed "$counter!d" | cut -d',' -f3)" + logprio="$(grep "level,," $shstatsfile_logtbl | sed "$counter!d" | cut -d',' -f3 | sed 's/3/Critical/;s/4/Error/;s/5/Warning/;s/6/Notice/')" + logmessage="$(grep "text,," $shstatsfile_logtbl | sed "$counter!d" | cut -d',' -f3)" echo "$logtime,$logprio,$logmessage" >> /tmp/modlogs.csv - counter=$((counter + 3)) + counter=$((counter + 1)) done mv /tmp/modlogs.csv "$SCRIPT_STORAGE_DIR/modlogs.csv" + + rm -f "$shstatsfile_logtbl" } Reset_DB(){ @@ -1155,10 +1162,10 @@ ScriptHeader(){ printf "${BOLD}## | _ \` _ \ / _ \ / _\` || _ \` _ \ / _ \ | _ \ ##${CLEARFORMAT}\\n" printf "${BOLD}## | | | | | || (_) || (_| || | | | | || (_) || | | | ##${CLEARFORMAT}\\n" printf "${BOLD}## |_| |_| |_| \___/ \__,_||_| |_| |_| \___/ |_| |_| ##${CLEARFORMAT}\\n" - printf "${BOLD}## ##${CLEARFORMAT}\\n" + printf "${BOLD}## VOO ##${CLEARFORMAT}\\n" printf "${BOLD}## %s on %-11s ##${CLEARFORMAT}\\n" "$SCRIPT_VERSION" "$ROUTER_MODEL" printf "${BOLD}## ##${CLEARFORMAT}\\n" - printf "${BOLD}## https://github.com/jackyaz/modmon ##${CLEARFORMAT}\\n" + printf "${BOLD}## https://github.com/waluwaz/modmon ##${CLEARFORMAT}\\n" printf "${BOLD}## ##${CLEARFORMAT}\\n" printf "${BOLD}############################################################${CLEARFORMAT}\\n" printf "\\n" @@ -1171,13 +1178,13 @@ MainMenu(){ else FIXTXPWR_MENU="Disabled" fi - printf "WebUI for %s is available at:\\n${SETTING}%s${CLEARFORMAT}\\n\\n" "$SCRIPT_NAME" "$(Get_WebUI_URL)" + printf "WebUI for %s VOO is available at:\\n${SETTING}%s${CLEARFORMAT}\\n\\n" "$SCRIPT_NAME" "$(Get_WebUI_URL)" printf "1. Check stats now\\n\\n" printf "2. Toggle data output mode\\n Currently ${SETTING}%s${CLEARFORMAT} values will be used for weekly and monthly charts\\n\\n" "$(OutputDataMode check)" printf "3. Toggle time output mode\\n Currently ${SETTING}%s${CLEARFORMAT} time values will be used for CSV exports\\n\\n" "$(OutputTimeMode check)" printf "4. Set number of days data to keep in database\\n Currently: ${SETTING}%s days data will be kept${CLEARFORMAT}\\n\\n" "$(DaysToKeep check)" printf "s. Toggle storage location for stats and config\\n Current location is ${SETTING}%s${CLEARFORMAT} \\n\\n" "$(ScriptStorageLocation check)" - printf "f. Fix Upstream Power level reporting (reduce by 10x, needed in newer Hub 3 firmware)\\n Currently: ${SETTING}%s${CLEARFORMAT} \\n\\n" "$FIXTXPWR_MENU" +# printf "f. Fix Upstream Power level reporting (reduce by 10x, needed in newer Hub 3 firmware)\\n Currently: ${SETTING}%s${CLEARFORMAT} \\n\\n" "$FIXTXPWR_MENU" printf "u. Check for updates\\n" printf "uf. Update %s with latest version (force update)\\n\\n" "$SCRIPT_NAME" printf "r. Reset %s database / delete all data\\n\\n" "$SCRIPT_NAME" @@ -1235,15 +1242,15 @@ MainMenu(){ fi break ;; - f) - printf "\\n" - if [ "$(FixTxPwr check)" = "true" ]; then - FixTxPwr false - elif [ "$(FixTxPwr check)" = "false" ]; then - FixTxPwr true - fi - break - ;; +# f) +# printf "\\n" +# if [ "$(FixTxPwr check)" = "true" ]; then +# FixTxPwr false +# elif [ "$(FixTxPwr check)" = "false" ]; then +# FixTxPwr true +# fi +# break +# ;; u) printf "\\n" if Check_Lock menu; then diff --git a/modmonstats_www.js b/modmonstats_www.js index d948293..882cd18 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -782,7 +782,7 @@ function update_modtest(){ } else if(modmonstatus == 'LOCKED'){ showhide('imgModUpdate',false); - document.getElementById('modupdate_text').innerHTML = 'Scheduled Hub 3 stat update already running!'; + document.getElementById('modupdate_text').innerHTML = 'Scheduled stat update already running!'; showhide('btnUpdateStats',true); } else if(modmonstatus == 'Done'){ From 80939478a97af0da3b8e17ba3558c46594e5b276 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 23:05:39 +0100 Subject: [PATCH 13/19] cron every 15 minutes --- modmon.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modmon.sh b/modmon.sh index 2153fba..57e2b46 100644 --- a/modmon.sh +++ b/modmon.sh @@ -449,7 +449,7 @@ Auto_Cron(){ STARTUPLINECOUNT=$(cru l | grep -c "$SCRIPT_NAME") if [ "$STARTUPLINECOUNT" -eq 0 ]; then - cru a "$SCRIPT_NAME" "*/3 * * * * /jffs/scripts/$SCRIPT_NAME generate" + cru a "$SCRIPT_NAME" "1,16,31,46 * * * * /jffs/scripts/$SCRIPT_NAME generate" fi ;; delete) From 8e1acbf517b14600e0bf597ddd4a2f4d0a3e27a0 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 23:23:51 +0100 Subject: [PATCH 14/19] RxCount hardcoded and code commented out --- modmonstats_www.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modmonstats_www.js b/modmonstats_www.js index 882cd18..f7ece70 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -399,7 +399,7 @@ function SetRxTxColours(){ function GetMaxChannels(){ var RxCountArray = []; var TxCountArray = []; - for(var i = 0; i < metriclist.length; i++){ +/* for(var i = 0; i < metriclist.length; i++){ var varname='LineChart_'+metriclist[i]; var channelcount=window[varname].data.datasets.length; if(varname.indexOf('Rx') != -1){ @@ -410,7 +410,9 @@ function GetMaxChannels(){ } } RxCount = Math.max.apply(Math,RxCountArray); -/* TxCount = Math.max.apply(Math,TxCountArray); */ + TxCount = Math.max.apply(Math,TxCountArray); +*/ + RxCount = 22; TxCount = 4; } From 1752cc3d23f71169a2c110c0faf2ffe81998115d Mon Sep 17 00:00:00 2001 From: waluwaz Date: Sun, 20 Mar 2022 23:40:40 +0100 Subject: [PATCH 15/19] GetMaxChannels modified % exception on LineChart_TxPwr --- modmonstats_www.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modmonstats_www.js b/modmonstats_www.js index f7ece70..92fb471 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -399,20 +399,23 @@ function SetRxTxColours(){ function GetMaxChannels(){ var RxCountArray = []; var TxCountArray = []; -/* for(var i = 0; i < metriclist.length; i++){ + for(var i = 0; i < metriclist.length; i++){ var varname='LineChart_'+metriclist[i]; - var channelcount=window[varname].data.datasets.length; if(varname.indexOf('Rx') != -1){ + var channelcount=window[varname].data.datasets.length; RxCountArray.push(channelcount); } else{ +/* var channelcount=window[varname].data.datasets.length; TxCountArray.push(channelcount); +*/ + TxCount = 4; } } RxCount = Math.max.apply(Math,RxCountArray); - TxCount = Math.max.apply(Math,TxCountArray); +/* TxCount = Math.max.apply(Math,TxCountArray); + "LineChart_TxPwr" results in exception */ - RxCount = 22; TxCount = 4; } From 2eeaa68d1b4e9e4b5ff6dcbbdf149b5d83e78c4f Mon Sep 17 00:00:00 2001 From: waluwaz Date: Mon, 21 Mar 2022 00:39:06 +0100 Subject: [PATCH 16/19] Update of README with some known issues --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index c58c078..b052f50 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,10 @@ You can post about any issues and problems here: [Asuswrt-Merlin AddOns on SNBFo but I don't get there often, and I probably won't be available to help. I guess you already understood, this is not a well-rounded solution for a large audience. This is proof that it could work for me; and if your setup is similar; and you have a similar skillset, you will probably be able to get there with less effort than I did originally. Use it if you like, if you are interested in experimenting, not if you need a reliable solution. + +Known issues: +The timestamps in the log table are wrong. The order is probably wrong too. +Legend is so dynamic that channel 22 in chart A may have a different colour than 22 in chart B. +Count of "lines" in charts is somewhat buggy. The filtering is usually not display, even though it shoud be displayed. +The choice of timeslice (daily, weekly, monthly) should apply to all graphs. +The choice of timeslice in zoom (e.g. from 19:00 'til 22:00) should apply to all graphs. \ No newline at end of file From 2a0ec6fe62772fc4ff3614b3cb9a0e014763b583 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Mon, 21 Mar 2022 21:19:49 +0100 Subject: [PATCH 17/19] protection against weird info from modem about channel zero --- README.md | 19 +++++++++++-------- modmonstats_www.js | 6 ++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index b052f50..df50f18 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ ## v0.2.0-alpha ### Updated on 2022-03-16 ## About -modmon is a tool that tracks your cable modem's stats (such as signal power levels) for AsusWRT Merlin with charts for daily, weekly and monthly summaries. It was created by JackYaz. This repository has a derivative work based on modmon and customized to work with another modem, the Technicolor CGA4233 from VOO in Belgium. It doesn't have a specific name, because I'm not sure how to change the name without breaking it; also because it probably couldn't coexist with the original modmon, and finally because I can't imagine a scenario where someone would concurrently need the original modmon and my hack. +modmon is a tool that tracks your cable modem's stats (such as signal power levels) for AsusWRT Merlin with charts for daily, weekly and monthly summaries. It was created by JackYaz. This repository has a derivative work based on modmon and customized to work with another modem, the Technicolor CGA4233 from VOO in Belgium. It doesn't have a specific name, because I'm not sure how to change the name without breaking it ;-) ; also because it probably couldn't coexist with the original modmon, and finally because I can't imagine a scenario where someone would concurrently need the original modmon and my hack. -So, my work tries to support the Technicolor CGA4233 from VOO in Belgium. Compared to the version of Jack, it hammers the modem every 3 minutes (in order to keep the session alive). It needs you to update the curl command around line 815 of modmon.sh, and paste the tokens for PHP session and authentication (also in CSRF). I got them with F12 (Developer tools)/Network/Reload/Copy as curl. And you need to either start modmon fast, or keep the session alive until it starts. You have 5 minutes at most... I usually have a ssh session active, cd /jffs/scripts, rm modmon, vi modmon, ESC-i, copy/paste the text with the center mouse button, ESC-:wq, chmod a+x (or something similar, or whatever works with your favourite editor) +So, my work tries to support the Technicolor CGA4233 from VOO in Belgium. Compared to the version of Jack, it hammers the modem every 15 minutes. It probably needs you to update the curl command around line 815 of modmon.sh, and paste the tokens for PHP session and authentication (also in CSRF). I got them with F12 (Developer tools)/Network/Reload/Copy as curl. -modmon is free to use under the [GNU General Public License version 3](https://opensource.org/licenses/GPL-3.0) (GPL 3.0). +modmon voo is free to use under the [GNU General Public License version 3](https://opensource.org/licenses/GPL-3.0) (GPL 3.0). ### Supporting development Love the script ? Any and all donations gratefully sent to JackYaz who did 100% of the work for the original modmon, which means 99% of the work for this. For more reliability, please navigate to Jack's repo and click Paypal from his repo. @@ -19,8 +19,8 @@ You must be running firmware Merlin 384.15/384.13_4 or Fork 43E5 (or later) [Asu ## Installation Install the original modmon from JackYaz in version 1.1.8. See his instructions. -Replace the modmon file in /jffs/scripts with the modmon from my repo. ! The name in the router must be modmon, not modmon.sh. -(NB: In the future, I might customize other files which would also need to be copied to the router. The commit dates might give you a clue.) +Replace the modmon file in /jffs/scripts with the modmon.sh from my repo. ! The name in the router must be modmon, not modmon.sh. +(NB: In the future, I might customize other files which would also need to be copied to the router. The commit dates might give you a clue.) Also update the .asp file at /jffs/addons/modmon.d The modmon file on the router must be executable (chmod a+x). I guess my Master branch is your best bet. @@ -32,7 +32,7 @@ Using your preferred SSH client/terminal, copy and paste the following command, /usr/sbin/curl --retry 3 "https://raw.githubusercontent.com/waluwaz/modmon/master/modmon.sh" -o "/jffs/scripts/modmon" && chmod 0755 /jffs/scripts/modmon && /jffs/scripts/modmon install ``` -And anyway, don't forget the special dance to adapt the script to an active session. See above. This modiofication might have to be renewed, e.g. if the modem reboots for instance. +And anyway, don't forget the special dance to adapt the script to an active session. See above. This modification might have to be renewed, e.g. if the modem reboots for instance. ## Usage ### WebUI @@ -61,6 +61,9 @@ I guess you already understood, this is not a well-rounded solution for a large Known issues: The timestamps in the log table are wrong. The order is probably wrong too. Legend is so dynamic that channel 22 in chart A may have a different colour than 22 in chart B. -Count of "lines" in charts is somewhat buggy. The filtering is usually not display, even though it shoud be displayed. +Count of "graphic lines" in charts is somewhat buggy. The filtering is usually not display, even though it shoud be displayed. +!! Filtering not working on Uncorrectable, that has only 16 channels, instead of 20. The choice of timeslice (daily, weekly, monthly) should apply to all graphs. -The choice of timeslice in zoom (e.g. from 19:00 'til 22:00) should apply to all graphs. \ No newline at end of file +The choice of timeslice in zoom (e.g. from 19:00 'til 22:00) should apply to all graphs. + +?? debug draw_chart \ No newline at end of file diff --git a/modmonstats_www.js b/modmonstats_www.js index 92fb471..f2b628d 100644 --- a/modmonstats_www.js +++ b/modmonstats_www.js @@ -392,8 +392,10 @@ function poolColors(a){ } function SetRxTxColours(){ - RxColours = poolColors(RxCount); - TxColours = poolColors(TxCount); + # RxColours = poolColors(RxCount); + RxColours = poolColors(22); + # TxColours = poolColors(TxCount); + TxColours = poolColors(4); } function GetMaxChannels(){ From ff5632c793e68bb516963e8689069e84dc43196d Mon Sep 17 00:00:00 2001 From: waluwaz Date: Mon, 21 Mar 2022 21:20:13 +0100 Subject: [PATCH 18/19] protection against weird reports from modem about channel zero --- .../.~lock.modmon_reverse_eng.ods# | 1 + .../modmon_reverse_eng.ods | Bin 0 -> 16751 bytes modmon.sh | 11 +- modmonstats_www.asp | 1210 ++++++++++++++++- 4 files changed, 1219 insertions(+), 3 deletions(-) create mode 100644 documentation/Technicolor_CGA4233_VOO/.~lock.modmon_reverse_eng.ods# create mode 100644 documentation/Technicolor_CGA4233_VOO/modmon_reverse_eng.ods diff --git a/documentation/Technicolor_CGA4233_VOO/.~lock.modmon_reverse_eng.ods# b/documentation/Technicolor_CGA4233_VOO/.~lock.modmon_reverse_eng.ods# new file mode 100644 index 0000000..c9c42b7 --- /dev/null +++ b/documentation/Technicolor_CGA4233_VOO/.~lock.modmon_reverse_eng.ods# @@ -0,0 +1 @@ +,ojadot,satellite-r850,21.03.2022 18:46,file:///home/ojadot/.config/libreoffice/4; \ No newline at end of file diff --git a/documentation/Technicolor_CGA4233_VOO/modmon_reverse_eng.ods b/documentation/Technicolor_CGA4233_VOO/modmon_reverse_eng.ods new file mode 100644 index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nqp>2AvDcqGSFI=C^oJ~|P^C*Kr<`e|mM1%)4BR|B zgwc^$D9^n@_p=v@yR@!?NjR2&3W4x2osg_4B9wp@IHauRpK&FM`CM=L#RmzgIc`bKZY? z{VPhyzd`v^_5A-8rSspQ{HcQedz9a*#o`039{+1a3X%Qa;o)7W=KLp4B>h)JK z&~N6?pQa7=S5fP~`u&v}`CBUVr!jqmt@o#J=wBWGN>lph0&1cCGmr8Q&%dKF{h1}q v$Aj>9q^3Vm{ /tmp/modmon-stats.sql @@ -860,7 +860,14 @@ rm -f "$shstatsfile_ust" # For the VOO modem, a vector with the applicable channel numbers/IDs should be first prepared, # in order to subsequently feed the database with the applicable channel number/ID. # Note that, as a first step, sticking values in pseudo channels 1 to 16 would be good enough - echo "INSERT INTO modstats_$metric ([Timestamp],[ChannelNum],[Measurement]) values($timenow,$channel,$measurement);" >> /tmp/modmon-stats.sql + + # For Corrected, Uncorrectable and Octets, the VOO modem seems to sometimes report a count of zero for channel zero... + # Note that this happened only once over a few days. It happened only for those 3 metrics. + # It happened at the very same timestamp for all 3 metrics. + # https://192.168.17.1:8443/ext/modmon/csv/RxOctets_weekly.htm + # Channel,Time,Value "Ch. 0",1647659701,0.0 "Ch. 1",1647883860,3041822933.0 "Ch. 1", + if [ $channel -ge 1 ]; then echo "INSERT INTO modstats_$metric ([Timestamp],[ChannelNum],[Measurement]) values($timenow,$channel,$measurement);" >> /tmp/modmon-stats.sql + fi counter=$((counter + 1)) done "$SQLITE3_PATH" "$SCRIPT_STORAGE_DIR/modstats.db" < /tmp/modmon-stats.sql diff --git a/modmonstats_www.asp b/modmonstats_www.asp index 39eddd9..fc22f2a 100644 --- a/modmonstats_www.asp +++ b/modmonstats_www.asp @@ -41,7 +41,1215 @@ function LoadCustomSettings(){ } } } -var $j=jQuery.noConflict(),arraysortlistlines=[],sortname="Time",sortdir="desc",maxNoCharts=18,currentNoCharts=0,ShowLines=GetCookie("ShowLines","string"),DragZoom=!0,ChartPan=!1,metriclist=["RxPwr","RxSnr","RxFreq","RxOctets","RxCorr","RxUncor","TxPwr"],titlelist=["Downstream Power","Downstream SNR","Frequency","Octets","Corrected","Uncorrectable","Upstream Power"],measureunitlist=["dBmV","dB","MHz","","","","dBmV"],chartlist=["daily","weekly","monthly"],timeunitlist=["hour","day","day"],intervallist=[24,7,30],RxCount,TxCount,RxColours,TxColours,chartColours=["rgba(24,113,65,1)","rgba(205,117,81,1)","rgba(230,55,90,1)","rgba(5,206,61,1)","rgba(131,4,176,1)","rgba(196,145,14,1)","rgba(169,229,70,1)","rgba(25,64,183,1)","rgba(23,153,199,1)","rgba(223,46,248,1)","rgba(240,92,214,1)","rgba(123,137,211,1)","rgba(141,68,215,1)","rgba(74,210,128,1)","rgba(223,247,240,1)","rgba(226,27,93,1)","rgba(253,78,222,1)","rgba(63,192,102,1)","rgba(82,66,162,1)","rgba(65,190,78,1)","rgba(154,113,118,1)","rgba(222,98,201,1)","rgba(198,186,137,1)","rgba(178,45,245,1)","rgba(95,245,50,1)","rgba(247,142,18,1)","rgba(103,152,205,1)","rgba(39,104,180,1)","rgba(132,165,5,1)","rgba(8,249,253,1)","rgba(227,170,207,1)","rgba(196,70,76,1)","rgba(11,197,73,1)","rgba(127,50,202,1)","rgba(33,248,170,1)","rgba(17,216,225,1)","rgba(176,123,12,1)","rgba(181,111,105,1)","rgba(104,122,233,1)","rgba(217,102,107,1)","rgba(188,174,88,1)","rgba(30,224,236,1)","rgba(169,39,247,1)","rgba(251,86,116,1)","rgba(217,163,80,1)","rgba(155,120,34,1)","rgba(82,124,118,1)","rgba(102,89,62,1)","rgba(48,126,7,1)","rgba(48,118,188,1)","rgba(223,246,227,1)","rgba(152,11,129,1)","rgba(66,97,241,1)","rgba(32,113,78,1)","rgba(83,142,226,1)","rgba(210,105,250,1)","rgba(125,115,7,1)","rgba(198,37,71,1)","rgba(253,99,153,1)","rgba(171,225,78,1)","rgba(66,82,121,1)","rgba(5,82,115,1)","rgba(22,62,141,1)","rgba(135,59,161,1)","rgba(20,223,59,1)","rgba(17,206,99,1)","rgba(142,162,133,1)","rgba(206,76,155,1)","rgba(131,87,41,1)","rgba(199,234,37,1)","rgba(176,94,156,1)","rgba(13,58,185,1)","rgba(147,19,178,1)","rgba(48,203,55,1)","rgba(250,31,116,1)","rgba(138,9,168,1)","rgba(90,208,244,1)","rgba(128,110,93,1)","rgba(222,202,95,1)","rgba(189,78,184,1)","rgba(122,41,65,1)","rgba(243,176,73,1)","rgba(23,123,71,1)","rgba(209,50,12,1)","rgba(253,218,100,1)","rgba(214,18,185,1)","rgba(31,254,215,1)","rgba(191,53,224,1)","rgba(117,197,238,1)","rgba(183,123,104,1)","rgba(88,34,248,1)","rgba(124,157,92,1)","rgba(76,59,160,1)","rgba(143,235,139,1)","rgba(59,85,112,1)","rgba(233,54,148,1)","rgba(244,176,124,1)","rgba(246,246,104,1)","rgba(169,171,44,1)","rgba(240,3,14,1)"];function keyHandler(t){82==t.keyCode?($j(document).off("keydown"),ResetZoom()):68==t.keyCode?($j(document).off("keydown"),ToggleDragZoom(document.form.btnDragZoom)):76==t.keyCode&&($j(document).off("keydown"),ToggleLines())}function Draw_Chart_NoData(t,e){document.getElementById("divLineChart_"+t).width="730",document.getElementById("divLineChart_"+t).height="500",document.getElementById("divLineChart_"+t).style.width="730px",document.getElementById("divLineChart_"+t).style.height="500px";t=document.getElementById("divLineChart_"+t).getContext("2d");t.save(),t.textAlign="center",t.textBaseline="middle",t.font="normal normal bolder 48px Arial",t.fillStyle="white",t.fillText(e,365,250),t.restore()}function Draw_Chart(t,e,o){var a=getChartPeriod($j("#"+t+"_Period option:selected").val()),r=timeunitlist[$j("#"+t+"_Period option:selected").val()],n=intervallist[$j("#"+t+"_Period option:selected").val()],i=window[t+"_"+a];if(null!=i)if(0!=i.length){var s=[],l=[];for(let t=0;t (a."+sortfield+" > b."+sortfield+") ? 1 : ((b."+sortfield+" > a."+sortfield+") ? -1 : 0));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => (a."+sortfield+" < b."+sortfield+") ? 1 : ((b."+sortfield+" < a."+sortfield+") ? -1 : 0));"),"desc"):"number"==sorttype?sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'),"asc"):-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a."+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b."+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'),"desc"):"date"==sorttype&&(sortdir=-1==sorttext.indexOf("↓")&&-1==sorttext.indexOf("↑")||-1!=sorttext.indexOf("↓")?(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a."+sortfield+") - new Date(b."+sortfield+"));"),"asc"):(eval("arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b."+sortfield+") - new Date(a."+sortfield+"));"),"desc")),$j("#sortTableContainer").empty(),$j("#sortTableContainer").append(BuildModemLogsTable()),$j(".sortable").each(function(t,e){e.innerHTML==sortname&&(e.innerHTML="asc"==sortdir?e.innerHTML+" ↑":e.innerHTML+" ↓")})}function BuildModemLogsTableNoData(){return'
Data loading...
'}function BuildModemLogsTable(){var t='';t+='',t+='',t+='',t+='',t+="",t+='',t+='',t+='',t+="",t+="",t+='';for(var e=0;e',t+="",t+="",t+="",t+="";return t+="",t+="
TimePriorityMessage
"+arraysortlistlines[e].Time+""+arraysortlistlines[e].Priority+""+arraysortlistlines[e].Message+"
"}function BuildMetricTable(t,e,a){var o='
 
';return 0==a&&(o+='',o+='',o+="",o+="",o+="",o+="",o+='",o+="",o+="
Charts (click to expand/collapse)
',o+='',o+='',o+='',o+="",o+="",o+='',o+="",o+="",o+='',o+='",o+="",o+="
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
",o+='",o+="
',o+='',o+="     ",o+='',o+="     ",o+='',o+="
",o+='
 
'),o+='',o+='',o+="",o+='",o+="",o+="",o+='',o+='',o+="",o+="",o+="",o+='",o+="",o+="
'+e+" (click to expand/collapse)
Period to display",o+='",o+="
',o+='
',o+="
",a==metriclist.length-1&&(o+="
"),o}function BuildChannelFilterTable(){var t='
 
';return t+='',t+='',t+="",t+='',t+="",t+="",t+="",t+='",t+="",t+="
Chart Filters (click to expand/collapse)
',t+=BuildChannelFilterRow("rx","Downstream Channels",RxCount),t+=BuildChannelFilterRow("tx","Upstream Channels",TxCount),t+="
"}function BuildChannelFilterRow(t,e,a){var o='
 
';for(o+='',o+='',o+='",o+="",o+="",o+='",o+="",o+='',o+="",o+="
'+e+"
',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+='',o+="",channelno=1;channelno",channelno%12==0&&(o+="");return o+="",o+="
",o+="",o+="
",o+='',o+="     ",o+='',o+="
"}function ToggleDataset(t){for(var e=0;e upperlimit || inputvalue < lowerlimit){ + $j(forminput).addClass('invalid'); + return false; + } + else{ + $j(forminput).removeClass('invalid'); + return true; + } +} + +function Format_Number_Setting(forminput){ + var inputname = forminput.name; + var inputvalue = forminput.value*1; + + if(forminput.value.length == 0 || inputvalue == NaN){ + return false; + } + else{ + forminput.value = parseInt(forminput.value); + return true; + } +} + +function Validate_All(){ + var validationfailed = false; + if(! Validate_Number_Setting(document.form.modmon_daystokeep,365,30)){validationfailed=true;} + + if(validationfailed){ + alert('Validation for some fields failed. Please correct invalid values and try again.'); + return false; + } + else{ + return true; + } +} + +function SaveConfig(){ + if(Validate_All()){ + document.getElementById('amng_custom').value = JSON.stringify($j('form').serializeObject()) + document.form.action_script.value = 'start_modmonconfig'; + document.form.action_wait.value = 5; + showLoading(); + document.form.submit(); + } + else{ + return false; + } +} + +function update_modtest(){ + $j.ajax({ + url: '/ext/modmon/detect_modmon.js', + dataType: 'script', + error: function(xhr){ + setTimeout(update_modtest,1000); + }, + success: function(){ + if(modmonstatus == 'InProgress'){ + setTimeout(update_modtest,1000); + } + else if(modmonstatus == 'GenerateCSV'){ + document.getElementById('modupdate_text').innerHTML = 'Retrieving data for charts...'; + setTimeout(update_modtest,1000); + } + else if(modmonstatus == 'LOCKED'){ + showhide('imgModUpdate',false); + document.getElementById('modupdate_text').innerHTML = 'Scheduled stat update already running!'; + showhide('btnUpdateStats',true); + } + else if(modmonstatus == 'Done'){ + document.getElementById('modupdate_text').innerHTML = 'Refreshing charts...'; + PostModUpdate(); + } + } + }); +} + +function PostModUpdate(){ + currentNoCharts = 0; + $j('#table_filters').remove(); + $j('#table_charts').remove(); + $j('#Time_Format').val(GetCookie('Time_Format','number')); + get_statstitle_file(); + setTimeout(ResetLayout,3000); +} + +function ResetLayout(){ + var metrictablehtml = ''; + + for(var i = 0; i < metriclist.length; i++){ + metrictablehtml += BuildMetricTable(metriclist[i],titlelist[i],i); + } + + $j('#table_modemlogs').after(metrictablehtml); + get_modemlogs_file(); + RedrawAllCharts(); +} + +function UpdateStats(){ + showhide('btnUpdateStats',false); + document.formScriptActions.action_script.value = 'start_modmon'; + document.formScriptActions.submit(); + document.getElementById('modupdate_text').innerHTML = 'Retrieving VOO stats'; + showhide('imgModUpdate',true); + showhide('modupdate_text',true); + setTimeout(update_modtest,5000); +} + +function GetVersionNumber(versiontype){ + var versionprop; + if(versiontype == 'local'){ + versionprop = custom_settings.modmon_version_local; + } + else if(versiontype == 'server'){ + versionprop = custom_settings.modmon_version_server; + } + + if(typeof versionprop == 'undefined' || versionprop == null){ + return 'N/A'; + } + else{ + return versionprop; + } +} + +function get_conf_file(){ + $j.ajax({ + url: '/ext/modmon/config.htm', + dataType: 'text', + error: function(xhr){ + setTimeout(get_conf_file,1000); + }, + success: function(data){ + var configdata = data.split('\n'); + configdata = configdata.filter(Boolean); + + for(var i = 0; i < configdata.length; i++){ + eval('document.form.modmon_'+configdata[i].split('=')[0].toLowerCase()).value = configdata[i].split('=')[1].replace(/(\r\n|\n|\r)/gm,''); + } + } + }); +} + +function get_statstitle_file(){ + $j.ajax({ + url: '/ext/modmon/modstatstext.js', + dataType: 'script', + error: function(xhr){ + setTimeout(get_statstitle_file,1000); + }, + success: function(){ + SetModStatsTitle(); + } + }); +} + +function get_modemlogs_file(){ + $j.ajax({ + url: '/ext/modmon/modlogs.htm', + dataType: 'text', + error: function(xhr){ + setTimeout(get_modemlogs_file,1000); + }, + success: function(data){ + ParseModemLogs(data); + } + }); +} + +function ParseModemLogs(data){ + var arraysortlines = data.split('\n'); + arraysortlines = arraysortlines.filter(Boolean); + arraysortlistlines = []; + for(var i = 0; i < arraysortlines.length; i++){ + try{ + var resultfields = arraysortlines[i].split(','); + var parsedsortline = new Object(); + parsedsortline.Time = moment(resultfields[0].trim(),'DD/MM/YYYY HH:mm:ss').format('YYYY-MM-DD HH:mm:ss'); + parsedsortline.Priority = resultfields[1].trim(); + parsedsortline.Message = resultfields[2].trim(); + arraysortlistlines.push(parsedsortline); + } + catch{ + //do nothing,continue + } + } + SortTable(sortname+' '+sortdir.replace('desc','↑').replace('asc','↓').trim()); +} + +function SortTable(sorttext){ + sortname = sorttext.replace('↑','').replace('↓','').trim(); + var sorttype = 'string'; + var sortfield = sortname; + switch(sortname){ + case 'Time': + sorttype = 'date'; + break; + } + + if(sorttype == 'string'){ + if(sorttext.indexOf('↓') == -1 && sorttext.indexOf('↑') == -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => (a.'+sortfield+' > b.'+sortfield+') ? 1 : ((b.'+sortfield+' > a.'+sortfield+') ? -1 : 0));'); + sortdir = 'asc'; + } + else if(sorttext.indexOf('↓') != -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => (a.'+sortfield+' > b.'+sortfield+') ? 1 : ((b.'+sortfield+' > a.'+sortfield+') ? -1 : 0));'); + sortdir = 'asc'; + } + else{ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => (a.'+sortfield+' < b.'+sortfield+') ? 1 : ((b.'+sortfield+' < a.'+sortfield+') ? -1 : 0));'); + sortdir = 'desc'; + } + } + else if(sorttype == 'number'){ + if(sorttext.indexOf('↓') == -1 && sorttext.indexOf('↑') == -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a.'+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000")));'); + sortdir = 'asc'; + } + else if(sorttext.indexOf('↓') != -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(a.'+sortfield+'.replace("m","000")) - parseFloat(b.'+sortfield+'.replace("m","000"))); '); + sortdir = 'asc'; + } + else{ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => parseFloat(b.'+sortfield+'.replace("m","000")) - parseFloat(a.'+sortfield+'.replace("m","000")));'); + sortdir = 'desc'; + } + } + else if(sorttype == 'date'){ + if(sorttext.indexOf('↓') == -1 && sorttext.indexOf('↑') == -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a.'+sortfield+') - new Date(b.'+sortfield+'));'); + sortdir = 'asc'; + } + else if(sorttext.indexOf('↓') != -1){ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(a.'+sortfield+') - new Date(b.'+sortfield+'));'); + sortdir = 'asc'; + } + else{ + eval('arraysortlistlines = arraysortlistlines.sort((a,b) => new Date(b.'+sortfield+') - new Date(a.'+sortfield+'));'); + sortdir = 'desc'; + } + } + + $j('#sortTableContainer').empty(); + $j('#sortTableContainer').append(BuildModemLogsTable()); + + $j('.sortable').each(function(index,element){ + if(element.innerHTML == sortname){ + if(sortdir == 'asc'){ + element.innerHTML = element.innerHTML+' ↑'; + } + else{ + element.innerHTML = element.innerHTML+' ↓'; + } + } + }); +} + +function BuildModemLogsTableNoData(){ + var tablehtml=''; + tablehtml+=''; + tablehtml+=''; + tablehtml+=''; + tablehtml += '
'; + tablehtml+='Data loading...'; + tablehtml+='
'; + return tablehtml; +} + +function BuildModemLogsTable(){ + var tablehtml=''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + + for(var i = 0; i < arraysortlistlines.length; i++){ + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + tablehtml += ''; + } + + tablehtml += ''; + tablehtml += '
TimePriorityMessage
'+arraysortlistlines[i].Time+''+arraysortlistlines[i].Priority+''+arraysortlistlines[i].Message+'
'; + return tablehtml; +} + +function BuildMetricTable(name,title,loopindex){ + var charthtml = '
 
'; + + if(loopindex == 0){ + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += '
Charts (click to expand/collapse)
'; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += '
Chart Display Options (click to expand/collapse)
Time format
(for tooltips and Last 24h chart axis)
'; + charthtml += ''; + charthtml += '
'; + charthtml += ''; + charthtml += '     '; + charthtml += ''; + charthtml += '     '; + charthtml += ''; + charthtml += '
'; + charthtml += '
 
'; + } + + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += ''; + /*charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += '';*/ + charthtml += ''; + charthtml += ''; + charthtml += ''; + charthtml += '
'+title+' (click to expand/collapse)
Period to display'; + charthtml += ''; + charthtml += '
Scale type'; + charthtml += ''; + charthtml += '
'; + charthtml += '
'; + charthtml += '
'; + + if(loopindex == metriclist.length-1){ + charthtml += '
'; + } + + return charthtml; +} + +function BuildChannelFilterTable(){ + var channelhtml = '
 
'; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += '
Chart Filters (click to expand/collapse)
'; + channelhtml += BuildChannelFilterRow('rx','Downstream Channels',RxCount); + channelhtml += BuildChannelFilterRow('tx','Upstream Channels',TxCount); + channelhtml += '
'; + return channelhtml; +} + +function BuildChannelFilterRow(rxtx,title,channelcount){ + var channelhtml = '
 
'; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += '
'+title+'
'; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + channelhtml += ''; + for(channelno = 1; channelno < channelcount+1; channelno++){ + channelhtml += ''; + if(channelno % 12 == 0){ + channelhtml += ''; + } + } + channelhtml += ''; + channelhtml += '
'; + channelhtml += ''; + channelhtml += '
'; + channelhtml += ''; + channelhtml += '     '; + channelhtml += ''; + channelhtml += '
'; + return channelhtml; +} + +function ToggleDataset(checkbox){ + for(var i = 0; i < metriclist.length; i++){ + if(metriclist[i].toLowerCase().indexOf(checkbox.id.substring(0,2)) != -1){ + window['LineChart_'+metriclist[i]].getDatasetMeta((checkbox.id.substring(5)*1)-1).hidden = ! checkbox.checked; + window['LineChart_'+metriclist[i]].update(); + } + } +} + +function SetAllChannels(button,setclear){ + var rxtx = ''; + var startindex = 0; + if(setclear == false){startindex=1;} + if(button.id.substring(0,2) == 'rx'){rxtx='Rx';} + else{rxtx='Tx';} + if(startindex == 1){$j( '#'+rxtx.toLowerCase()+'opt1' ).prop('checked',true);} + for(var i = 1+startindex; i < window[rxtx+'Count']+1; i++){ + $j( '#'+rxtx.toLowerCase()+'opt'+i ).prop('checked',setclear); + } + for(var i = 0; i < metriclist.length; i++){ + if(metriclist[i].indexOf(rxtx) != -1){ + for(var i3 = 0; i3 < window[rxtx+'Count']; i3++){ + window['LineChart_'+metriclist[i]].getDatasetMeta(i3).hidden = ! $j( '#'+rxtx.toLowerCase()+'opt'+(i3+1) ).prop('checked'); + } + window['LineChart_'+metriclist[i]].update(); + } + } +} + +function AddEventHandlers(){ + $j('.collapsible-jquery').off('click').on('click',function(){ + $j(this).siblings().toggle('fast',function(){ + if($j(this).css('display') == 'none'){ + SetCookie($j(this).siblings()[0].id,'collapsed'); + } + else{ + SetCookie($j(this).siblings()[0].id,'expanded'); + } + }) + }); + + $j('.collapsible-jquery').each(function(index,element){ + if(GetCookie($j(this)[0].id,'string') == 'collapsed'){ + $j(this).siblings().toggle(false); + } + else{ + $j(this).siblings().toggle(true); + } + }); +} + From 893a383547b0b3f694298171b21c6edb72010172 Mon Sep 17 00:00:00 2001 From: waluwaz Date: Mon, 21 Mar 2022 21:46:07 +0100 Subject: [PATCH 19/19] Burnin the version in the shell script etc --- modmon.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modmon.sh b/modmon.sh index 50e813b..6fbbff2 100644 --- a/modmon.sh +++ b/modmon.sh @@ -24,9 +24,9 @@ ### Start of script variables ### readonly SCRIPT_NAME="modmon" -readonly SCRIPT_VERSION="v0.0.2" +readonly SCRIPT_VERSION="v0.2.0-beta" SCRIPT_BRANCH="master" -SCRIPT_REPO="https://raw.githubusercontent.com/jackyaz/$SCRIPT_NAME/$SCRIPT_BRANCH" +SCRIPT_REPO="https://raw.githubusercontent.com/waluwaz/$SCRIPT_NAME/$SCRIPT_BRANCH" readonly SCRIPT_DIR="/jffs/addons/$SCRIPT_NAME.d" readonly SCRIPT_WEBPAGE_DIR="$(readlink /www/user)" readonly SCRIPT_WEB_DIR="$SCRIPT_WEBPAGE_DIR/$SCRIPT_NAME"