summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Kocialkowski2023-04-27 10:45:29 +0200
committerPaul Kocialkowski2023-04-27 10:45:29 +0200
commitff86ea427efaa689b70aff7273776d1eb16aa8b5 (patch)
tree1e7671efdb34af277f6146b7ca12b64951c4799e
parent3670a4c421cd828709204d4d3f40d048cf1d1e37 (diff)
host-control: Add system-top action
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rwxr-xr-xhost-control11
1 files changed, 11 insertions, 0 deletions
diff --git a/host-control b/host-control
index 8302e40..478aaa0 100755
--- a/host-control
+++ b/host-control
@@ -25,6 +25,7 @@ class host_control():
" system-info show kernel info\n" \
" system-shell access system shell\n" \
" system-ping ping host system\n" \
+ " system-top show top running tasks\n" \
" system-update update system\n" \
" system-restart restart system\n" \
" system-initramfs-update update system initramfs\n" \
@@ -423,6 +424,14 @@ class host_control():
self.command_call(command)
+ def system_top(self, host):
+ if "top" in host:
+ command = [ host["top"] ]
+ else:
+ command = [ "htop" ]
+
+ self.host_call(host, command)
+
def system_update(self, host):
address = self.ssh_address(host)
@@ -523,6 +532,8 @@ class host_control():
return self.system_shell(host)
elif action == "system-ping":
return self.system_ping(host)
+ elif action == "system-top":
+ return self.system_top(host)
elif action == "system-update":
return self.system_update(host)
elif action == "system-restart":