Script creation (Input needed)

Hi ,

I m trying to write a script in linux .
The problem is the output of command get changed every now and then.
Just like top command in linux.

How would i manipulate the output of the command ?

The command i m talking about gives the real time values of performance of hosted guest machines.

Since i m using oracle virtual technology this command may not be available on any other linux distribution.

Can anybody help me giving a clue go proceed further?
I have tried storing the output to a file using
xm top > abc.txt
but since its a real time execution the command never terminates by itself.
When terminated manually the content of abc.txt was difficult to manipulate.

From OpenSolaris xm man page:

From OpenSolaris xentop man page :

You can try (not tested):

xn top --batch --iteration=1 >xmtop.txt

or

xentop --batch --iteration=1 >xmtop.txt

Jean-Pierre.

1 Like

thanks for your suggestion i will try this and let other know.

Executing
xentop --batch --iteration=1
giving me 0% cpu utilization.

There fore executing following command which somehow giving me acceptable values for cpu utilization.
xentop -d=10 --batch --iteration=4

I m thinking of getting 3 4 entries in such a way and calculate the average.
One more issue is Hostname is displayed only 10 character long.

any way i will post the end result in some time.