From aa597b907c12f1c2c2251ba80f4b97b98e638e9b Mon Sep 17 00:00:00 2001 From: Wirawan Purwanto Date: Thu, 20 Oct 2016 10:11:18 -0400 Subject: [PATCH] * In hoststats subcommand: Also print node status flags if they exist. --- sge/show-node-status.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sge/show-node-status.py b/sge/show-node-status.py index ddaa4dc..4ecf930 100755 --- a/sge/show-node-status.py +++ b/sge/show-node-status.py @@ -215,6 +215,7 @@ def collect_host_stats(qstat_f, show_disabled_nodes=None): hoststat['queues'].append(queue) # FIXME we assume all have same load; fix if not correct: hoststat['node_load'] = node_load + hoststat['status_flags'] = status_flags #return host_list_by_kinds, host_stats return host_stats @@ -237,7 +238,7 @@ def print_host_stats(host_stats): % ("HOST", "CORES", "used", "free", "resv", "load", "load/used")) for h in hostnames: hs = host_stats[h] - print("%-16s %5d %5d %5d %5d %7.2f %9.3f" \ + print("%-16s %5d %5d %5d %5d %7.2f %9.3f%s" \ % (h, hs['slots_tot'], hs['slots_used'], @@ -245,6 +246,7 @@ def print_host_stats(host_stats): hs['slots_resv'], hs['node_load'], node_load_ratio(hs['node_load'], hs['slots_used']), + " "+hs['status_flags'] if hs['status_flags'] else "" ) ) @@ -313,6 +315,9 @@ Usage: one of the following: %(CMD)s raw [qstat_file] [--save] [--show-disabled-nodes] Shows the raw queue/node status +%(CMD)s hoststats [qstat_file] [--save] [--show-disabled-nodes] + Shows the present statistics for every node + %(CMD)s %(CMD)s stats [qstat_file] [--save] [--show-disabled-nodes] Shows the statistic summary per node type