Mainly technical stuff from my job as a UC consultant

Menu

Monitoring your Lync Peak Call Capacity

Both SIP and ISDN trunk providers will often bill you based on the number of simultaneous calls/channels they provide (as well as minute charges). As a result you may end up scaling your capacity above what your real needs might be, just to be on the safe side.

With Lync there is no available tool to monitor this, neither real-time nor historically. There used to be a cool script available by Tom Pacyk to do this, but the times this need has arisen over the last year I have only been faced by an error message stating that the resource is not available.

The call performance counters reside on the Mediation server and are by no means a secret, but I haven’t seen anyone else (beside Tom) provide something to output them.

That aside; I decided to make my own PowerShell script to this.
It is still maturing, but for now it will give you

Console output with the current total of inbound, outbound and concurrent calls (sampled every 15 seconds)

CSV file output with hourly peak and average (per 15 seconds) statistics on the same counters

I will continue to develop it into a more complete solution, as I see fit. If you have suggestions or comments on the topic they are more than welcome! Although, I have to admit that my PowerShell skills are not unlimited, I promise to give it my best effort!

DISCLAIMER: As I just began working for a new employer where I have not yet got the chance to upgrade our Lync platform to server 2013, I can only vouch for it working on Lync Server 2010 – but I cannot see any reason why it should not run on the 2013 version (the counters would be identical, I think). In any case it will have to be run on the server hosting the Mediation role.

Rune, thank you for this script. I have tested it on a Lync 2013 with heavy load from Trio 5.0 in a native ucma integration, but your script doesn’t report the calls (conferences) housed in Trio. I can drop you a screenshot if you have interest. A script like this is absolutely a good tool to have available 🙂

The script will report performance counters on the Mediation server where it is run, meaning that any call handled by a Trio Agent that is from/to an external participant should be reported.
We run a Call Center based on Competella UCMA Application ourselves, and the script is ignorant to whether the call is from/to a Lync or UCMA endpoint – as long as it involves a PSTN participant it is captured.

If you have a pool of Mediation servers the script will however only report the ones involving the one where the script is run. We are about to upgrade our Lync Servers including several Mediation serveres, at which point I will update it to summarize traffic from all servers.

If you were looking for some output on the Trio Conferences themselves this script is not the right for you.

# Now, for every 15 seconds we will repeat this same procedyre:
# -> Fetch current call counter for inbound and outbound
# -> Store data in array
# -> if the hour changes, calculate average and peak counters and store to file

do {

# That was then, this is now
$then = $now

# Get the counters we want, and add them to the arrays
[int]$currentInbound = (Get-Counter $inboundCallPath).CounterSamples[0].CookedValue.ToString()
[int]$currentOutbound = (Get-Counter $outboundCallPath).CounterSamples[0].CookedValue.ToString()