From: system@SendSpamHere.ORG Sent: Thursday, June 15, 2000 12:43 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: System call to get CPU utilization? In article <3948FFEE.BF5848D9@ix.netcom.com>, Rob Davis writes: >Anyone know if there's a way to get the % of CPU utilization for a node >in a cluster (like what's displayed for MONITOR SYSTEM) via some sort of >system call? Thanks. You can use the "undocumented" EXE$GETSPI routine. You need to call this twice to get the stats necessary to compute the % CPU utilization (busy time). The item lists to pass will look like: SPI_ITEM_LIST1: .WORD 8*4,GETSPI$_MODES .ADDRESS INITIAL_MODE_TICKS .LONG 0[2] INITIAL_MODE_TICKS: .LONG 0 ICPU_ID: .BYTE 0 IINTERRUPT: .LONG 0 IMP_SYNCH: .LONG 0 IKERNEL: .LONG 0 IEXECUTIVE: .LONG 0 ISUPERVISOR: .LONG 0 IUSER: .LONG 0 ICOMPATIBILITY: .LONG 0 IIDLE: .LONG 0 SPI_ITEM_LIST2: .WORD 8*4,GETSPI$_MODES .ADDRESS MODE_TICKS .LONG 0[2] MODE_TICKS: .LONG 0 CPU_ID: .BYTE 0 INTERRUPT: .LONG 0 MP_SYNCH: .LONG 0 KERNEL: .LONG 0 EXECUTIVE: .LONG 0 SUPERVISOR: .LONG 0 USER: .LONG 0 COMPATIBILITY: .LONG 0 IDLE: .LONG 0 Then you need to "correct" a few items by subtracting the IDLE times from the INTERRUPT times. Then, compute the differences of each item... for example, SUBL2 IKERNEL,KERNEL. Then compute the total time by adding the elements in the vector to get the total time. You then compute the per- centages by dividing the item times by the total time. Simple, Eh? -- VAXman- OpenVMS APE certification number: AAA-0001 VAXman(at)TMESIS(dot)COM