From 736acd6a55502ad463612b09a62cadfa866a8ef8 Mon Sep 17 00:00:00 2001 From: Justas Balcas Date: Wed, 17 Jul 2024 17:27:06 -0500 Subject: [PATCH] Debughtmlfix (#595) * Fix HTTP UI and calls for debug actions * Debug history show logs of actions and process out --- src/html/debughistory.html | 12 +++-- src/html/newdebug.html | 50 ++++++++++---------- src/python/SiteFE/REST/Modules/DebugCalls.py | 2 +- src/python/SiteRMLibs/BaseDebugAction.py | 2 +- 4 files changed, 36 insertions(+), 30 deletions(-) diff --git a/src/html/debughistory.html b/src/html/debughistory.html index dd0a0736..cb267f09 100644 --- a/src/html/debughistory.html +++ b/src/html/debughistory.html @@ -91,13 +91,17 @@ if (myObject['exitCode']){ model.append('
Runtime Exit Code: <\/b>' + myObject['exitCode'] + '<\/div>'); } - if (myObject['err']){ + if (myObject['stderr']){ model.append('
Debug Err:<\/b><\/div>'); - tableAddKeyLine(myObject['err'], ['LineNum', 'Value'], model); + tableAddKeyLine(myObject['stderr'], ['LineNum', 'Value'], model); } - if (myObject['out']){ + if (myObject['stdout']){ model.append('
Debug Output:<\/b><\/div>'); - tableAddKeyLine(myObject['out'], ['LineNum', 'Value'], model); + tableAddKeyLine(myObject['stdout'], ['LineNum', 'Value'], model); + } + if (myObject['processOut']){ + model.append('
Process Output:<\/b><\/div>'); + tableAddKeyLine(myObject['processOut'], ['LineNum', 'Value'], model); } } $('#v-pills-' + debugID).empty(); diff --git a/src/html/newdebug.html b/src/html/newdebug.html index 02615bb7..a2e01c1f 100644 --- a/src/html/newdebug.html +++ b/src/html/newdebug.html @@ -28,8 +28,7 @@ } $.post("/"+params['sitename']+"/sitefe/json/frontend/submitdebug/NEW", params, function(result){ newAlert("New debug action submit state:" + JSON.stringify(result), params); - }); - } + })} function doSiteUpdate(ids) { @@ -39,10 +38,7 @@ success: function(json){ for (j=0; j < json.length; j++){ addDropDown(json[j]['hostname'], $("#" + ids + "hostname")); - } - } - }); - } + }}})} function doSiteUpdateN(ids) { strSite = document.getElementById(ids + "sitename").value; @@ -50,11 +46,10 @@ for (i=0; i < data['general']['sites'].length; i++){ sitename = data['general']['sites'][i]; if (strSite === sitename) { - for (const [switchname] of Object.entries(data[sitename]['switch'])) { - addDropDown(switchname, $("#" + ids + "hostname")) - }}}})} - - + const switchArray = data[sitename]['switch']; + switchArray.forEach((name, index) => { + addDropDown(name, $("#" + ids + "hostname")) + })}}})} function doDTNUpdate(ids) { strDTN = document.getElementById(ids + "hostname").value; @@ -148,7 +143,7 @@

Request New Debug Action

Rapid Ping (from Host)

-
+
Rapid ping - very similar to Flood ping implemented in FreeBSD. where a minimum of 100 packets are sent in one second or as soon as a reply to the request has come.
It will execute the following command on selected hostname: ping -i <interval> -w <runtime> <ip> -s <packetsize> -I <Interface>

@@ -177,7 +172,7 @@

Rapid Ping (from Host)

- @@ -254,7 +249,7 @@

TCPDump (from Host)

ARP Table

-
+
The ip neigh command manipulates neighbour objects that establish bindings between protocol addresses and link layer addresses for hosts sharing the same link. Neighbour entries are organized into tables. The IPv4 neighbour table is also known by another name - the ARP table.
The corresponding commands display neighbour bindings and their properties. @@ -288,9 +283,9 @@

ARP Table

-

IPerf Client (from Host)

+

IPerf Server (from Host)

-
+
iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test it reports the bandwidth, loss, and other parameters.
@@ -320,13 +315,13 @@

IPerf Client (from Host)

- +
- +
- @@ -353,9 +348,9 @@

IPerf Client (from Host)

-

IPerf Server (from Host)

+

IPerf Client (from Host)

-
+
iPerf3 is a tool for active measurements of the maximum achievable bandwidth on IP networks. It supports tuning of various parameters related to timing, buffers and protocols (TCP, UDP, SCTP with IPv4 and IPv6). For each test it reports the bandwidth, loss, and other parameters.
@@ -393,6 +388,13 @@

IPerf Server (from Host)

+
+ +
- +
- +