Here cron is responsible for the "every minute" part, then each new sa1 process does "6 measurements with 10-second intervals".Īfter you set this up, it's all about sar invocation to get data "for last 2-3 hours" (try with -s and -e options, see man 1 sar for details). Which means "every minute take 6 measurements with 10-second intervals". Your CPU usage will be displayed on your. Enter sar u 5 in the terminal window, and press the Enter key. On your Linux PC, open the Terminal by pressing the Ctrl + Alt + T. Example: * * * * * root command -v debian-sa1 > /dev/null & debian-sa1 10 6 The sar command is not limited to checking CPU usage you can also use it to track CPU performance with the correct code option. Cron does not go down to sub-minute resolutions, yet sa1 uses seconds. The latter method seems over-complicated, yet it's useful if you want to take measurements more than once a minute. (Note in this case 5-55/10 may as well be */10). Run the tool every ten minutes but let each invocation do 10 measurements in 60-second intervals: 5-55/10 * * * * root command -v debian-sa1 > /dev/null & debian-sa1 60 10 sa1 itself can iterate measurements and the syntax is sa1 interval count. Straightforwardly run the tool each minute: * * * * * root command -v debian-sa1 > /dev/null & debian-sa1 1 1Ĭhanging the command. Modify this line to get what you want ( there's no need to restart cron). Is responsible for running debian-sa1 every 10 minutes ( debian-sa1 is a wrapper over sa1 if your distro is neither Debian nor its derivative, you should probably use sole sa1 instead). This line 5-55/10 * * * * root command -v debian-sa1 > /dev/null & debian-sa1 1 1 In my Kubuntu the relevant file is /etc/cron.d/sysstat. Sysstat uses cron to run sa1 periodically. Sar reads files where scripts from the sysstat's set of tools write to. I tried using sar but I got results for a 10-minute interval.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |