01-26-2016 11:39 AM - edited 03-14-2019 03:42 PM
This came up on my project and can't think of a way to tackle this. Was hoping someone might have had a similar issue in the past.
We're trying to figure out how many agents are logged in at any one time to a PG. Now, as part of this, we also need to know if they are nailed up agents, call by call agents, or traditional agents. I can find the total logins via a Windows perfmon, but can't distinguish mobile agents. Ultimately, we want to know if we're getting close to the 2000 agent max but keeping in mind that no every agent counts as a 1 agent.
Anyone have any ideas?
david
01-26-2016 01:43 PM
something this easy, or are you looking for counts?
SELECT A.EnterpriseName, ART.Extension, P.PeripheralID, ART.PhoneType
FROM Agent A, Agent_Real_Time ART, Peripheral P
WHERE A.SkillTargetID = ART.SkillTargetID
AND A.PeripheralID = P.PeripheralID
ORDER BY P.PeripheralID
Per the database schema, Phone Type 0 are traditional agents, 1 is call-by-call, and 2 is nailed
01-26-2016 05:30 PM
Here's a count version. It's messy and clunky - but it works. Swap out the PeripheralID for other CUCM PGs. IF you've come up with something cleaner - please post.. would be a nice query to have :)
SELECT COUNT(P.PeripheralID) AS [No. of Traditional Agents], P.PeripheralID AS [ID],
P.PeripheralName AS [Periph Name]
FROM Agent A, Agent_Real_Time ART, Peripheral P
WHERE A.SkillTargetID = ART.SkillTargetID
AND A.PeripheralID = P.PeripheralID
AND P.PeripheralID = '5000'
AND ART.PhoneType = '0'
GROUP BY P.PeripheralID, P.PeripheralName, ART.PhoneType
UNION
SELECT COUNT(P.PeripheralID) AS [No. of Call-by-Call Agents], P.PeripheralID AS [Periph ID],
P.PeripheralName AS [Periph Name]
FROM Agent A, Agent_Real_Time ART, Peripheral P
WHERE A.SkillTargetID = ART.SkillTargetID
AND A.PeripheralID = P.PeripheralID
AND P.PeripheralID = '5000'
AND ART.PhoneType = '1'
GROUP BY P.PeripheralID, P.PeripheralName, ART.PhoneType
UNION
SELECT COUNT(P.PeripheralID) AS [No. of Nailed Agents], P.PeripheralID AS [ID],
P.PeripheralName AS [Periph Name]
FROM Agent A, Agent_Real_Time ART, Peripheral P
WHERE A.SkillTargetID = ART.SkillTargetID
AND A.PeripheralID = P.PeripheralID
AND P.PeripheralID = '5000'
AND ART.PhoneType = '2'
GROUP BY P.PeripheralID, P.PeripheralName, ART.PhoneType
01-26-2016 06:43 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide