On 16/04/2011 15:10, Rita wrote:
Is it possible to get the status of user's job running/idle similar to condor_status -submitters?A quick (and dirty) fix could be: Or, maybe a script like this:condor_q -format "%s " Owner -format "%s\n" 'ifThenElse(JobStatus==1,"I",ifThenElse(JobStatus==2,"R",\ ifThenElse(JobStatus==5,"H",string(JobStatus)))' | sort | uniq -c The result is not sorted and there is no error-check in it.#!/usr/bin/env python # import re, commands, struct q_users = "condor_q -format \"\%s \" Owner -format \"\%s\\n\" JobStatus" cmdOut = commands.getoutput(q_users) counts = {} for i in cmdOut.split('\n'): user, irh = i.split() u = counts.setdefault(user, {}) u[irh] = u.setdefault(irh, 0) + 1 print "%-14s%10s%10s%10s" % ('User','Idel','Running','Held') print "=" * 44 for user in counts: stat = counts[user] print "%-14s%10s%10s%10s" % \ (user, stat.get('1', 0), stat.get('2', 0), stat.get('5', 0)) -Santanu
|