Script creation (Input needed)


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script creation (Input needed)
# 1  
Old 07-10-2010
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.
# 2  
Old 07-10-2010
From OpenSolaris xm man page:
Quote:

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 :
Quote:

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):
Code:
xn top --batch --iteration=1 >xmtop.txt

or
Code:
xentop --batch --iteration=1 >xmtop.txt

Jean-Pierre.
This User Gave Thanks to aigles For This Post:
# 3  
Old 07-10-2010
Quote:
Originally Posted by aigles
From OpenSolaris xm man page:From OpenSolaris xentop man page :You can try (not tested):
Code:
xn top --batch --iteration=1 >xmtop.txt

or
Code:
xentop --batch --iteration=1 >xmtop.txt

Jean-Pierre.
thanks for your suggestion i will try this and let other know.
# 4  
Old 07-13-2010
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Input password to bash script, save, and enter when needed

I am looking for a way to start a script and have it prompt for a password that will be used later on in the script to SSH to another host and to SFTP. I don't want the password to be hard coded. Below is my script with the actual IP's and usernames removed. #!/usr/bin/expect -f... (2 Replies)
Discussion started by: jbrass
2 Replies

2. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

3. Shell Programming and Scripting

Help with Playlist creation script

Hello. I am hoping to have an automated way to create Playlist files from Genre txt files I'll be making with my music collection. This is for use with my WD Live player, and is so that certain albums / artists can live in multiple genre directories when I browse to them from my WD Live player. ... (4 Replies)
Discussion started by: Davinator
4 Replies

4. Shell Programming and Scripting

User creation script

Hi Gems.. I am working out on project of creating a mass user on 100 server. Please help me with script where i can create an user id of new 80 user using shell script Thanks in advance. Indrajit Bhagat (1 Reply)
Discussion started by: indrajit_renu
1 Replies

5. Shell Programming and Scripting

Script to monitor Machine Health (Project Doctortux) Input needed.

I have written little script to check the CPU performance of the machine. Request you to contribute your comments on the same. Feel free to add your own scriptlet to make it better. I have decided to call it as doctortux I have decided to run the script in two mode 1)Interactive.(Not... (4 Replies)
Discussion started by: pinga123
4 Replies

6. UNIX for Dummies Questions & Answers

[solved] Script creation (how to include options in the script)

Hi guys i have written a script which takes the options given to him and execute itself accordingly. for example if a script name is doctortux then executing doctortux without option should made doctortux to be executed in automatic mode i.e. doctortux -a or if a doctortux is needed to run in... (4 Replies)
Discussion started by: pinga123
4 Replies

7. Shell Programming and Scripting

Help with Creation of Script to Input Separators in Data

Hi all, I have one problem that is preparing datas so I can run a script to extrat informations for my statistic reports. I receive some datas, that are informations mixed and I need to separate them to analyse. This is an exemple of datas:... (8 Replies)
Discussion started by: Alexis Duarte
8 Replies

8. Shell Programming and Scripting

Need help in a shell script to edit a tablespace creation script.

Hi, CREATE TABLESPACE aps_blob_large01 DATAFILE '/c2r6u13/u03/oradata/qnoldv01/aps_blob_large0101.dbf' SIZE X 270532608 REUSE DEFAULT STORAGE (INITIAL 134217728 NEXT... (2 Replies)
Discussion started by: rparavastu
2 Replies

9. Shell Programming and Scripting

flexible sed command needed to handle multiple input types

Hello, I need a smart sed command that can take any of the following two as an input and give below mentioned output. As you can see, I am trying to convert some C code INPUT: struct abc_sample1 { char myString; UINT16 myValue1; ... (2 Replies)
Discussion started by: SiftinDotCom
2 Replies

10. UNIX for Advanced & Expert Users

AIX + disk redundency input needed

OK guys & gals this is the issue: i am trying to sort out all the disks in all of our AIX servers. 12 hdisks w/ mirroring (so only 6 disks in uses @ any time) 2 volume groups (rootvg, vg1) this does include muliple informix databases and misc. data. Do you think it would be wise to... (1 Reply)
Discussion started by: Optimus_P
1 Replies
Login or Register to Ask a Question