]> mj.ucw.cz Git - bex.git/commitdiff
Implemented "bex queue --attn"
authorMartin Mares <mj@ucw.cz>
Fri, 21 Sep 2012 13:42:39 +0000 (15:42 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 21 Sep 2012 13:42:39 +0000 (15:42 +0200)
lib/bin/bex-queue

index 9b01a4e4fd4aae2800e8a529909599e1ad0abcc5..d98f8dc683ad354326f24e085ca3e42dbf3f1a02 100755 (executable)
@@ -14,6 +14,7 @@ my $op_rm;
 my $op_move_to;
 
 my $queue_name;
+my $attention;
 my $filenames;
 my $given_job;
 my $summary;
@@ -30,6 +31,7 @@ Actions:
     --move-to=<queue>  Move jobs to a different queue
 
 Options:
+-a, --attn             Show jobs needing attention (e.g., failures)
 -f, --filenames                Show filenames of jobs and log files
 -j, --job=<id>         Act on the specified job (default: on all)
 -q, --queue=<name>     Act on the given queue
@@ -45,6 +47,7 @@ GetOptions(
        "h|by-host!" => \$op_by_host,
        "rm!" => \$op_rm,
        "move-to=s" => \$op_move_to,
+       "a|attn!" => \$attention,
        "f|filenames!" => \$filenames,
        "j|job=s" => \$given_job,
        "q|queue=s" => \$queue_name,
@@ -93,6 +96,7 @@ sub do_ls()
                for my $j (@{$machs{$m}}) {
                        my $st = $queue->read_job_status($m, $j);
                        my $s = $st->{"Status"} // "UNKNOWN";
+                       if ($attention) { next if $s =~ m{^(NEW|NOPING)$}; }
                        $cnt_by_job{$j}{$s}++;
                        $cnt_by_mach{$m}{$s}++;
                        $why{$m}{$j} = "";