[server] Move monitor function into seaf-server.