I want to increase the system CPU load in Solaris 10 in order to test this scenario in Nagios.

I'm running following command to get the CPU utitlization in Solaris:

bash-3.00# sar -s 10 60

SunOS unknown 5.10 Generic_139556-08 i86pc    08/19/2013

16:10:49    %usr    %sys    %wio   %idle
16:11:50      93       5       0       2

I want to make 30 to 35% on %sys field. And how to do that?


According to your comment your goal is not to actually increase the load on the server, you only want to test the Nagios alert in the case of high load.

For doing this, I wouldn't try to actually increase the load of the server, the server load is hard to artificially control so this isn't a very reliable test scenario. Instead you could store the output of sar into a file, edit the content of the file, and then use a the content of this file instead of calling the sar command to test your Nagios check.

sar 3 10 > /tmp/sar_output
vi /tmp/sar_output #write the numbers that you want

Then in your nagios check script, instead of calling sar you just do cat /tmp/sar_output

This way your test happens in controlled condition and is more reliable than by finding creative ways to increase your server's load.


The simplest way is with yes command.

yes > /dev/null &

You may need to run the above command multiple times to increase the CPU load.

To kill all the yes process after testing with single command.

killall yes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.