mcp-agent mode for mcp-checker with web-info and REST API
New:
- agent index page serving on 0.0.0.0:8765
- REST API with modular approach to modules
- 'fio' module working via thread-safe Thread able to return
real-time info on its status
- 'fio' module scheduled run option
- ability to preserve multiple testrun results while active
- dockerfile for agent image
Fixed:
- Network report fixes to work on Kube envs
- Fixed function for running commands inside daemonset pods
Related-PROD: PROD-36669
Change-Id: I57e73001247af9187680bfc5744590eef219d93c
diff --git a/cfg_checker/reports/reporter.py b/cfg_checker/reports/reporter.py
index 1f54ff3..dc9a2cf 100644
--- a/cfg_checker/reports/reporter.py
+++ b/cfg_checker/reports/reporter.py
@@ -302,18 +302,19 @@
def _extend_data(self, data):
def get_bytes(value):
- _char = value[-1]
+ _size_i = True if value[-1] == 'i' else False
+ _char = value[-2] if _size_i else value[-1]
_ord = ord(_char)
if _ord > 47 and _ord < 58:
# bytes comes with no Char
return int(value)
else:
_sizes = ["*", "K", "M", "G", "T"]
- _flo = float(value[:-1])
+ _flo = float(value[:-2]) if _size_i else float(value[:-1])
_pwr = 1
if _char in _sizes:
_pwr = _sizes.index(_char)
- return int(_flo**_pwr)
+ return int(1024**_pwr*_flo)
def _dmidecode(_dict, type=0):
# _key = "dmi"
@@ -379,7 +380,7 @@
_key = "ram"
_key_r = "ram_raw"
_f_cmd = self.master.get_cmd_for_nodes
- _cmd = "free -h | sed -n '/Mem/s/ \\+/ /gp'"
+ _cmd = "free -h | grep 'Mem' | sed -n '/Mem/s/ \\+/ /gp'"
_f_cmd(_cmd, _key_r, target_dict=_dict)
# parse them and put into dict
for node, dt in _dict.items():