How to get the agent availability details in the particular agent group

How to get the agent availability details in the particular agent group in the Chat SCXML development

We are checking for the amount of agents logged in on an agent group:

varStatAgentsLoggedIn = _genesys.statistic.sData(varAgentGroup, ‘StatAgentsLoggedIn’);