fyi: Not all systems have sar.
you can use top in a script like so:
you can grep/awk/sed the output to your liking.
As alternatives, there are iostat and mpstat.
You can always use uptime as well & look for a 1 second load average of 1.00 which may or may not be reliable enough for your purposes.