Technical article 109422

The script /usr/lib/sa/sa2 is broken on multi and single-processor CPUs.

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4

Written · Last revised

Problem

The script /usr/lib/sa2 greps for the wrong number of CPUs when run
on either a multiprocessor or single-processor.  It also increases
the number of CPUs by one, which causes an extra iteration in the
while loop statement.

Solution

This problem is resolved in SCO OpenServer 5.0.5.

As a workaround for OpenServer 5.0.4, using your favorite editor, edit the /usr/lib/sa/sa2 file.

Change the following line:
A_CPUS=`cat /dev/string/cfg | grep "CPU.*type=" | wc -l`
to:
CPUS=`cat /dev/string/cfg | grep -i "CPU.*type=" | wc -l | sed 's/ //g'`
and delete the line:
CPU=`expr $A_CPUS + 1`

See also

manual pages: sar(ADM), cpusar(ADM), mpsar(ADM), sa1(ADM), sadc(ADM)

ta104892, "Try to run sar, get: 'sar: Can't open /usr/adm/sa/saXX'."

From the Xinuos technical article database, record 109422. Reproduced with permission. The original is at www.sco.com/ta/109422, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.