Linux e Unix: Ferramentas de Monitoracao e Performance

Informações sobre processos - Information about process

 * top (Linux)
 * nmon (Linux)
 * topas (AIX)
 * topas_nmon (AIX)

VM Statistics & CPU

 * vmstat (Linux/AIX)

Exemplo Linux:

Usage: vmstat [-V] [-n] [delay [count]] procs ---memory-- ---swap-- -io -system-- cpu r b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa 2  0      0 1226172  94704 991204    0    0    41    18  423  791  5  3 91  1 procs ---memory-- ---swap-- -io -system-- cpu r b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa 0  0      0 1226056  94920 991244    0    0    41    18  423  790  5  3 91  1 0 0      0 1226048  94936 991244    0    0     0    12  479  802  1  1 97  1 0  0      0 1225800  94936 991244    0    0     0     1  513  849  1  1 97  0
 * 1) vmstat
 * 1) vmstat  5

Exemplo AIX
 * 1) vmstat -lwt 5

I/O Statistics & Activity

 * iostat (Linux/AIX)

Linux 2.6.32-24-generic (ebasso) 	16-09-2010 	_i686_	(2 CPU) avg-cpu: %user   %nice %system %iowait  %steal   %idle 5,02   0,23    2,92    1,18    0,00   90,65 Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm   %util sda             14,34     7,04    2,30    2,79   162,32    77,42    47,04     0,13   25,97   5,01    2,56 120 coletas a cada 30 segundos
 * 1) sudo apt-get install sysstat
 * 2) iostat -x
 * 1) iostat 30 120 > iostat.out &

Network Statistics & Activity

 * netstat (Linux/AIX)

Tabela de Interfaces do Kernel Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg eth0      1500 0    181181      0      0 0         24087      0      0      0 BMRU lo       16436 0         9      0      0 0             9      0      0      0 LRU tun0      1362 0     14411      0      0 0         14792      0      0      0 MOPRU vmnet1    1500 0         0      0      0 0           489      0      0      0 BMRU vmnet8    1500 0         0      0      0 0           489      0      0      0 BMRU
 * 1) netstat -i

Topas_nmon

 * topas_nmon (AIX)


 * 1) topas_nmon

1 - CPU currently 1 - CPU configured 1904 - MHz CPU clock rate PowerPC_POWER4 - Processor 64 bit - Hardware 32 bit - Kernel 7,P0307_HOMOL_TST_XXXXX - Logical Partition 5.3.12.1 TL12 - AIX Kernel Version xxxx3007 - Hostname xxxx3007 - Node/WPAR Name 0231EDD - Serial Number IBM,7040-681 - Machine Type

Análise dos arquivos que estão no /var/nmon do AIX: http://www.ibm.com/developerworks/aix/library/au-nmon_analyser/

prtconf

 * prtconf (AIX)

System Model: IBM,7040-681 Machine Serial Number: 0231EDD Processor Type: PowerPC_POWER4 Processor Implementation Mode: POWER 4 Processor Version: PV_4_2 Number Of Processors: 1 Processor Clock Speed: 1904 MHz CPU Type: 64-bit Kernel Type: 32-bit LPAR Info: 7 P0307_HOMOL_TST_COLAB1 Memory Size: 16384 MB Good Memory Size: 16384 MB Platform Firmware level: 3H050715 Firmware Version: IBM,RG050715_d79e12_r Console Login: enable Auto Restart: true Full Core: false ...
 * 1) prtconf

svmon
Uso de VM pelos processos: svmon -P -O summary=basic,unit=MB svmon -P PID http://pic.dhe.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.prftungd%2Fdoc%2Fprftungd%2Fmem_use_processes.htm

Memória Livre no AIX
Criar um arquivo showFreeMemory.sh

vi showFreeMemory.sh

colar esse conteúdo:

memory=`prtconf -m | awk 'BEGIN {FS=" "} {print $3/1024}'` usedmem=`svmon -G | grep memory | awk 'BEGIN {FS=" "} {print $3/256/1024}'` freemem=`echo $memory-$usedmem | bc -l` echo "Avai Mem: $memory GB" echo "Free Mem: $freemem GB" echo "Used Mem: $usedmem GB"
 * 1) Conclusion

Salvar

Alterar a permissão

chmod 755 showFreeMemory.sh

saida é isso: Avai Mem: 8 GB Free Mem: 2.24053 GB Used Mem: 5.75947 GB	16:29:02

Ver também

 * Linux:Comando Find
 * Linux:Comando Awk
 * Linux:Comando Xargs
 * Linux: Identificando qual processo esta escutando uma porta tcpip


 * Mais Artigos sobre Linux / UNIX / AIX