KBI 311379 Issue Addressed: LINUX Script Rule SCP_LINUX_PDT_CPU_UTIL Always Return 100% CPU Usage

Version

Argent Advanced Technology 3.1A-1601-C or earlier

Date

Monday, 18 April 2016

Summary

LINUX Script Rule SCP_LINUX_PDT_CPU_UTIL always returns 100% CPU Usage

The issue has been addressed in Argent AT 3.1A-1601-T8

Technical Background

LINUX Script Rule SCP_LINUX_PDT_CPU_UTIL uses utility ‘vmstat’ to retrieve CPU idle number, then minus from 100 to get the CPU usage

The output format for utility ‘vmstat’ has changed over years

The bundled Linux Script Rule always calculates the CPU idle number as zero

The issue is addressed by updating the script accordingly

Resolution

Upgrade to Argent AT 3.1A-1601-T8 or later

For customer who cannot upgrade immediately, he can update the script by replacing line

CPU_IDLE=`vmstat 1 2 | awk ‘ { if ( NR == 4 ) print $NF } ‘`

with

CPU_IDLE=`vmstat 1 2 |awk ‘{for(i=NF;i>0;i–)if($i==”id”){x=i;break}}END{print $x}’`