Actually, we can use SSH to connect to the VIOS of PowerVM.
We type "topas" and see the monitoring data of VIOS.
But, if I just want to read the byte array of the topas result, how to parse the strange format?
Step:
1.Execute: topas>&1
2.Get the result:
The encoding seems lick $TERM=xterm.
What?????
Can parse xterm encoding?
How??????
We type "topas" and see the monitoring data of VIOS.
But, if I just want to read the byte array of the topas result, how to parse the strange format?
Step:
1.Execute: topas>&1
2.Get the result:
Code:
^[=^[[?7h^[[?1l^[(B^[=^[[m^[(B^[[H^[[2JTopas Monitor for host: rd-aixvio01 EVENTS/QUEUES FILE/TTY
^MFri May 24 02:13:51 2013 Interval: 2 Cswitch Readch
^[[23DSyscall Writech
^MKernel |^[[28C| Reads Rawin
^MUser |^[[28C| Writes Ttyout
^MWait |^[[28C| Forks Igets
^MIdle |^[[28C| Execs Namei
^MPhysc =^[[27C%Entc= Runqueue Dirblk
^[[23DWaitqueue^[[11;49HPAGING MEMORY
^[[23DFaults Real,MB
^[[24DSteals % Comp
^[[23DPgspIn % Noncomp
^[[26DPgspOut % Client
^[[25DPageIn
^[[6DPageOut PAGING SPACE
^[[29DSios Size,MB
^[[7D% Used
^[[23DNFS (calls/sec) % Free
^[[23DServerV2
^[[8DClientV2 Press:
^[[25DServerV3 "h" for help
^[[31DClientV3 "q" to quit^[[9;10H^[[H^[[2JTopas Monitor for host: rd-aixvio01 EVENTS/QUEUES FILE/TTY
^MFri May 24 02:13:51 2013 Interval: 2 Cswitch Readch
^[[23DSyscall Writech
^MNetwork ^[[;7m^[(BKBPS ^[[m^[(BI-Pack O-Pack KB-In KB-Out Reads Rawin
^[[22DWrites Ttyout
^[[23DForks Igets
^[[22DExecs Namei
^MDisk Busy% ^[[;7m^[(BKBPS^[[5C^[[m^[(BTPS KB-Read KB-Writ Runqueue Dirblk
^[[23DWaitqueue^[[11;49HPAGING MEMORY
^[[23DFaults Real,MB
^[[24DSteals % Comp
^[[23DPgspIn % Noncomp
^[[26DPgspOut % Client
^[[25DPageIn
^[[6DPageOut PAGING SPACE
^[[29DSios Size,MB
^[[7D% Used
^[[23DNFS (calls/sec) % Free
^[[23DServerV2
^[[8DClientV2 Press:
^[[25DServerV3 "h" for help
^[[31DClientV3 "q" to quit^[[4;10H
^Mhdisk2 0.1 8.9 0.2 7.5 1.3
^Mhdisk0 0.0 1.2 0.1 0.4 0.8
^Mcd1 0.0 0.0 0.0 0.0 0.0^[[4;10H^[[9B^MName PID CPU% PgSp Owner
^Mseaproc^[[6C155728 0.0 1.0 root
^Mgil^[[11C69666 0.0 0.9 root
^Mgetty^[[8C278672 0.0 0.6 root
^Mxmgc^[[10C49176 0.0 0.4 root
^Msyslogd^[[6C127206 0.0 0.3 root
^Minit 1 0.0 0.6 root
^Mnetm^[[10C65568 0.0 0.4 root
^Mpilegc^[[8C45078 0.0 1.2 root
^Mrdpgc^[[8C159826 0.0 0.4 root
^Mfbdsk_io 163936 0.0 0.4 root
^Mtarget_k 122962 0.0 0.5 root
^Mpsmd^[[10C24588 0.0 0.5 root^[[4;10H^[[H^[[2JTopas Monitor for host: rd-aixvio01 EVENTS/QUEUES FILE/TTY
^MFri May 24 02:13:53 2013 Interval: 2 Cswitch Readch
^[[23DSyscall Writech
^MCPU ^[[;7m^[(BUser% ^[[C^[[m^[(BKern% Wait% Idle% Physc Reads Rawin
^[[22DWrites Ttyout
^[[23DForks Igets
^[[22DExecs Namei
^[[22DRunqueue Dirblk
^[[23DWaitqueue
^MNetwork ^[[;7m^[(BKBPS ^[[m^[(BI-Pack O-Pack KB-In KB-Out
PAGING MEMORY
^[[23DFaults Real,MB
^[[24DSteals % Comp
^MDisk Busy% ^[[;7m^[(BKBPS^[[5C^[[m^[(BTPS KB-Read KB-Writ PgspIn % Noncomp
^[[26DPgspOut % Client
^[[25DPageIn
^[[6DPageOut PAGING SPACE
^[[29DSios Size,MB
^[[7D% Used
^[[23DNFS (calls/sec) % Free
^[[23DServerV2
^[[8DClientV2 Press:
^[[25DServerV3 "h" for help
^[[31DClientV3 "q" to quit^[[10;10H^[[5A^Mcpu0 30.8 57.9 0.0 11.4 0.01
^Mcpu1 0.0 1.6 0.0 98.4 0.00
^Mcpu2 0.0 18.5 0.0 81.5 0.00
^Mcpu3 0.0 19.1 0.0 80.9 0.00
^Men0 5.4 16.0 33.5 0.9 4.4
^Mlo0 0.0 0.0 0.0 0.0 0.0
^Mhdisk0 0.0 0.0 0.0 0.0 0.0
^Mhdisk2 0.0 0.0 0.0 0.0 0.0
^Mcd1 0.0 0.0 0.0 0.0 0.0^[[10;10H^[[2;61H191 693.5K^M
^[[59C3367^[[13C7186^M
^[[60C261^[[16C0^M
^[[60C183^[[13C1258^M
^[[62C5^[[16C0^M
^[[62C7^[[14C264^M
^[[60C0.0^[[16C0^M
^[[60C0.0
^H^H76^[[14C576^M
^[[62C0^[[13C74.4^M
^[[62C0^[[14C6.6^M
^[[62C0^[[14C6.6^M
^[[62C0
^H0
^H0^[[13C1536^M
Name PID CPU% PgSp Owner^[[40C9.9^M
topas 1728550 1.9 1.5 root^[[40C91.1^M
ioscli 1314958 1.6 0.4 root^[[27C0
^Mtee 1925372 0.6 0.1 padmin^[[25C0
^Msshd^[[9C450798 0.4 0.7 padmin^[[25C0
^Mrksh 1683610 0.3 0.5 padmin^[[25C0
^Mgetty^[[8C278672 0.1 0.6 root^[[10;10H^[[15B^M^[>^[[?7h
The encoding seems lick $TERM=xterm.
What?????
Can parse xterm encoding?
How??????