From ff86ea427efaa689b70aff7273776d1eb16aa8b5 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Thu, 27 Apr 2023 10:45:29 +0200 Subject: host-control: Add system-top action Signed-off-by: Paul Kocialkowski --- host-control | 11 +++++++++++ 1 file changed, 11 insertions(+) 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": -- cgit v1.2.3