what would a script include to find CPU's %system time high and user time high?

Hi ,
I am trying to :wall: my head while scripting ..I am really new to this stuff , never did it before :frowning: .

how to find cpu's system high time and user time high in a script??

thanks , help would be appreciated !
:slight_smile:

I know what system and user time mean, but don't usually see these terms used together with 'high'. What precisely do you mean here?

Hi , I just need the command to include in a script to find the CPU's %system high time and user high time . Not together , but in two different command lines .:slight_smile: . Also how about system (kernel) time , and user time .Am i being any familiar with the terms?

What Operating System and version do you have and what Shell do you use?

These "high" values (whatever they mean?). Over what sample period of time?

What record keeping is present on your system? Do you have sar record keeping implemented for example?

Thanks for your reply , I am like just few days of research new to scripting . I have Ubuntu installed (VirtualBox) and i need to create a simple script that would drive the system time , the user time , and elapsed time without affecting the first two (i.e. system time & user time) . Not sure how to start with this .

A part of my script where i need help is
case $choice in
1)
echo "Hi $USER"
echo ""
echo "Cpu's system time"
echo "---------------------------------------------"
This is where i need help ;; :wall:

I went through google and it says to use top or vmstat to know the cpu's system time .Not sure how Right i m . I have sysstat package installed ..

What do you mean 'drive the system time' and 'drive the user time', etc? And what do you mean by 'system high time' and all that? You keep saying these things over and over, and giving more details on what you've tried is appreciated, but we're no closer to understanding what you actually want until you define these unique terms.

oops my bad !
okay i'll be easier ..
All i want is a script that would show me the system time and user time which is a part of CPU usage . did i make sense?

I think that we are going round in circles.
Are you looking for a snapshot at this moment or the peak over a period of time?

Please note that I know nothing about the Ubuntu sysstat package.

Are you takling about figures like this (which came from a unix system):

sar 10 10

17:46:14    %usr    %sys    %wio   %idle
17:46:24       1       2      14      82
17:46:34       1       1      20      78
17:46:44      14       3      19      65
17:46:54       4       2       9      85
17:47:04       1       2      18      79
17:47:14       5       3      17      75
17:47:24       0       1      15      84
17:47:34       4       2      19      75
17:47:44       2       0       5      93
17:47:54       4       2       2      91

Average        4       2      14      81

Yes , you are right . We are going around in circles and the worst part is I am so new to this , its a bit confusing to me .
I have a project , which wants me to create a script and all it says is to find
Cpu's %system time high and %user time high , that is why i posted a thread here .. But i m getting everyone confused :stuck_out_tongue:
Not sure , what this still means !

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.

1 Like