How to get "active-links" number from PPPoE connection

I would like to create a script that compares the number of “active-links” in a multilink pppoe connection with the number that should exist and was wondering how to get this value into a variable for comparison.

Thanks,
Ken