A query against $cmd.sys.inprog (and $cmd.sys.killop) with a readpreference set
{$query: {$all:true}, $readPreference:{mode: 'primary'}}
This will either require drivers to specially filter these collections, to avoid errors, or a fix in the server to handle the $readPreference in some way (either ignore or respect it for mongos).