Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display a list from a grep 1

Status
Not open for further replies.
Apr 13, 2004
316
US
Does anyone have a conceivable way to construct a script to do the following:

IBM.PSSP.aixos.Mem.Real.numfrb The number of pages on the free list.
IBM.PSSP.aixos.Mem.Real.%pinned The percentage of memory which is pinned.
IBM.PSSP.aixos.Mem.Real.%free The percentage of memory which is free.
IBM.PSSP.aixos.Mem.Kmem.memuse The ammount of memory that is currently in use (bytes).
IBM.PSSP.aixos.Mem.Kmem.inuse The number of kernel memory buffers in use.
IBM.PSSP.aixos.Mem.Kmem.failures The number of unsuccessful requests for a kernel memory buffer.
IBM.PSSP.aixos.Mem.Kmem.calls The number of requests for a kernel memory buffer.
IBM.PSSP.aixos.LAN.xmitovfl The number of transmit queue overflows.
IBM.PSSP.aixos.LAN.xmiterrors The number of frame transmit errors at the adapter level.
IBM.PSSP.aixos.LAN.xmitdrops The number of transmit packets dropped at the device driver level.
IBM.PSSP.aixos.LAN.recvdrops The number of receive packets dropped at the device driver level.
IBM.PSSP.aixos.LAN.rcverrors The number of frame receive errors at the adapter level.
IBM.PSSP.aixos.VG.free The amount of free space in a volume group, in megabytes.
IBM.PSSP.aixos.FS.%totused The percentage of used space.
IBM.PSSP.aixos.FS.%nodesused The percentage of the file nodes that are used.
IBM.PSSP.aixos.Disk.xfer The number of transfers to or from a disk.
IBM.PSSP.aixos.Disk.wblk The number of 512 byte blocks written to a disk.
IBM.PSSP.aixos.Disk.rblk The number of 512 byte blocks read from a disk.
IBM.PSSP.aixos.Disk.busy Time disk is busy (percent).
IBM.PSSP.aixos.cpu.wait Time CPU waiting for I/O (percent).
IBM.PSSP.aixos.cpu.user Time CPU executing in user mode (percent).
IBM.PSSP.aixos.cpu.kern Time CPU executing in kernel mode (percent).
IBM.PSSP.aixos.cpu.idle Time CPU is idle (percent).
IBM.PSSP.aixos.CPU.glwait System-wide time waiting for I/O (percent).
IBM.PSSP.aixos.CPU.gluser System-wide time executing in user mode (percent).
IBM.PSSP.aixos.CPU.glkern System-wide time executing in kernel mode (percent).
IBM.PSSP.aixos.CPU.glidle System-wide time CPU is idle (percent).
IBM.PSSP.Response.Switch.state Indicates the state of the switch adapter.
IBM.PSSP.Response.Host.state Indicates if the node has connectivity over the en0 adapter.
IBM.PSSP.Membership.Node.state Indicates whether a node has connectivity.
IBM.PSSP.Membership.LANAdapter.state Indicates whether a LAN adapter has connectivity.

Given the above list, say somebody does a ‘grep’ for “pag” and it returns:

IBM.PSSP.aixos.Proc.swpque The average number of processes waiting to be paged in.
IBM.PSSP.aixos.pagsp.size The size of the paging space (4K pages).
IBM.PSSP.aixos.pagsp.%free Free portion of this paging space (percent).
IBM.PSSP.aixos.PagSp.totalsize Total active paging space size (4K pages).
IBM.PSSP.aixos.PagSp.totalfree Total free disk paging space (4K pages).
IBM.PSSP.aixos.PagSp.%totalused Total used disk paging space (percent).
IBM.PSSP.aixos.Mem.Virt.pgspgout The rate of 4K pages written to paging space by VMM.
IBM.PSSP.aixos.Mem.Virt.pgspgin The rate of 4K pages read from paging space by VMM.
IBM.PSSP.aixos.Mem.Virt.pagexct The rate of page faults.
IBM.PSSP.aixos.Mem.Virt.pageout The rate of 4K pages written by VMM.
IBM.PSSP.aixos.Mem.Virt.pagein The rate of 4K pages read by VMM.
IBM.PSSP.aixos.Mem.Real.size The size of the physical memory (4K pages).
IBM.PSSP.aixos.Mem.Real.numfrb The number of pages on the free list.

What is the best way for it to print a list similar to the following:

1) Total active paging space size (4K pages).
2) Total free disk paging space (4K pages).
3) Total used disk paging space (percent).
….. etc.

This list would be printed for the results of the grep with a different number each time, of course.

From this list the user would select the number which in turn would query the event manager.

Thanks for any insight you can share!!!!
 
Try something like this:
awk '/pag/{$1="";printf "%d)\t%s\n",++i,$0}' /path/to/input

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top