attiahia,
I will reiterate. SU is nothing like what you are doing with Telnet. WIth SU, you are impersonating another user so that the script will run in that user's context. The script runs on the processor that SU is authenticated against.

Telnet is entirely different. With Telnet you are simply sending keystrokes to a remote processor. The script does not run on the switch, it runs on your computer. It is like the KiX SendKeys() function and just like SendKeys() is prone to timing issues.

The best way to get the information would be to use SNMP but that would involve a fair learning curve.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.