agent: cherrypick host resource accounting from master