cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1113
Views
0
Helpful
4
Replies

Humanify Numbers

Jason Kopacko
Level 4
Level 4

I have an EEM script that generates this output based on monitoring my WAN interface load:

%HA_EM-6-LOG: INTERFACE_LOAD: BW: 50000 kbps/sec || TX: 15/255, 1651000 bits/sec, 598 packets/sec || RX: 8/255, 3057000 bits/sec, 627 packets/sec

I would like to make the values of the variables be the same metric of kbps/sec or Mbps/sec and include the comma in the correct locations. No matter what I do, I cannot get it work correct with trim, replace, match, etc.

Can anyone help?

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

Have a look at http://wiki.tcl.tk/37493. ; Those procedures should give you exactly what you're looking for.

I am using an applet and not a Tcl script. :-(

I don't see a way to do this easily with an applet.  Can you convert to Tcl using http://www.marcuscom.com/convert_applet, and then use the above code to print your numbers?

I will just trim the right 3 digits off the bit/sec and reference the numbers as kbps like the bandwidth statement.