'Returns a list of servers that failed to be contacted and a dict
of "job_id : status" pairs (where status is a bunchified version
of the API\'s structure.'

def check_all_jobs(self):

    servers = []
    failures = []
    statuses = {}
    for pbs_job_state in self.watched:
        pbs_server_name = self.__get_pbs_server(pbs_job_state.job_destination.params)
        if (pbs_server_name not in servers):
            servers.append(pbs_server_name)
        pbs_job_state.check_count += 1
    for pbs_server_name in servers:
        c = pbs.pbs_connect(util.smart_str(pbs_server_name))
        if (c <= 0):
            log.debug(('connection    to    PBS    server    %s    for    state    check    failed' % pbs_server_name))
            failures.append(pbs_server_name)
            continue
        stat_attrl = pbs.new_attrl(3)
        stat_attrl[0].name = pbs.ATTR_state
        stat_attrl[1].name = pbs.ATTR_used
        stat_attrl[2].name = pbs.ATTR_exitstat
        jobs = pbs.pbs_statjob(c, None, stat_attrl, None)
        pbs.pbs_disconnect(c)
        statuses.update(self.convert_statjob_to_bunches(jobs))
    return (failures, statuses)
