We are using OEM 12C, it reports spike of CPU utilization of a server, but vmstat result does not.
According to MOS doc, OEM use kstat to calculate CPU usage.
How To Calculate CPU Usage on Solaris (Doc ID 1910409.1)
And this link has some info about kstat on Solaris:
https://blogs.oracle.com/tpenta/entry/how_solaris_calculates_user_system
So I deleveloped the following shell script to verify the result:
while true; do
date >> kstat.dropit
kstat -n sys -s 'cpu_nsec*'|awk 'BEGIN {idletotal=0;usertotal=0;systotal=0;total=0}
{if ($1~/cpu_nsec_idle/) {idletotal=idletotal+$2;}
else if ($1~/cpu_nsec_user/) {usertotal=usertotal+$2;}
else if ($1~/cpu_nsec_kernel/) {systotal=systotal+$2;}}
END {total=idletotal+usertotal+systotal; userpercent=usertotal*100/total;syspercent=systotal*100/total;idlepercent=idletotal*100/total;
print "total="total,"idletotal="idletotal,"usertotal="usertotal,"systotal="systotal,"user%="userpercent,"sys%="syspercent,"idle%="idlepercent}' >> kstat.dropit
sleep 60
done
However, the result does not match.
one reason that why the OEM chart is flat for date older than 1 day is because it report on hourly basis, the spike showing within 24 hours is because it reports on 5 minutes interval.
Bug
EM 12c: False High CPU Utilization (%) Alerts in Enterprise Manager 12c Cloud Control (Doc ID 1603132.1)
Comments
Post a Comment