[server] Fix the wrong calculation of the number of triggers and hosts when the hostgroup is specfied.