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.
aigles
July 10, 2010, 5:51am
2
From OpenSolaris xm man page :
xm(1M) System Administration Commands xm(1M)
NAME
xm - xVM management user interface
SYNOPSIS
xm subcommand [options] domain
DESCRIPTION
The main interface for command and control of both xVM and guest
domains is virsh(1M). Users should use virsh wherever possible, as it
provides a generic and stable interface to controlling virtualized
operating systems. Some xVM operations are not yet implemented by
virsh. In those cases, the legacy utility xm can be used for detailed
control.
With minor variations, the basic structure of an xm command is:
xm subcommand [options] domain
...where subcommand is one of the subcommands listed below, domain is
the domain name (which is internally translated to a numeric domain
id), and options are subcommand-specific options.
. . . .
top domain...
Invokes the xentop\(1M\) command. Monitor a host and one or more
domains in real time.
From OpenSolaris xentop man page :
xentop(1M) System Administration Commands xentop(1M)
NAME
xentop - display real-time information about an xVM system and domains
SYNOPSIS
xentop [-h] [-V] [-d=seconds] [-n] [-r] [-v] [-b] [-i=iterations]
DESCRIPTION
The xentop command displays information about the Solaris xVM system
and domains in a continually-updating way. It is analogous to the BSD
UNIX top command.
OPTIONS
The following options are supported:
. . .
-b, --batch
Output data to stdout in batch mode.
-i, --iterations=iterations
Maximum number of iterations xentop should display before terminat-
ing.
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.