Sponsored Content
Operating Systems Solaris Question about details for the whole machine Post 302785415 by Marc G on Monday 25th of March 2013 03:53:37 PM
Old 03-25-2013
Quote:
Originally Posted by jlliagre
You are missing the first set of statistics reported by most of the *stat commands is an average since last boot.

Instead of "vmstat 1 1", you should run "vmstat 1 2" and use the last line values.
The facts they are about different periods of time and reported with different units (KB vs 4 or 8 KB pages depending on the architecture) is something worth considering Smilie
ok....
I've been reading here and also doing a lot of research

As jlliagre says,

if I use the command:
Code:
"vmstat 1 2 | cut -b77-78 | grep -v id"

I get the following output:

Code:
85
99

now "85" is based on the period "since the device was booted"
so "99" is what I want

So how to I only grab the second value?

I tried a test like this:
Code:
   set data=`vmstat 1 2 | cut -b77-78 | grep -v id`
   echo $data

But that only hung at the prompt until the process ran, and gave me no data.

Thanks for your continuing help.

Marc

---------- Post updated at 02:52 PM ---------- Previous update was at 02:50 PM ----------

Quote:
Originally Posted by MadeInGermany
1. get a new top program that does not get stuck
2. if it still goes stuck, call it through a timeout wrapper
Code:
perl -e "alarm 3600; exec @ARGV" top ...

This one will kill top after 1 hour.
Actually, It continued to get stuck so I put a command after the top to determine if top was running and kill it.

That failed to resolve the issue to the sys admin's satisfaction.

---------- Post updated at 02:52 PM ---------- Previous update was at 02:52 PM ----------

Quote:
Originally Posted by MadeInGermany
1. get a new top program that does not get stuck
2. if it still goes stuck, call it through a timeout wrapper
Code:
perl -e "alarm 3600; exec @ARGV" top ...

This one will kill top after 1 hour.
Actually, It continued to get stuck so I put a command after the top to determine if top was running and kill it.

That failed to resolve the issue to the sys admin's satisfaction.

---------- Post updated at 03:53 PM ---------- Previous update was at 02:52 PM ----------

additionally...

When I run the following from the command line:
I get:
Code:
bash-3.2# vmstat 1 2 | grep -v id | cut -b77-78

85
98
bash-3.2#

Note, the blank line is part of the output

but when I create a script: "test.sh" containing:
Code:
bash-3.2# cat test.sh
/usr/bin/ksh

vmstat 1 2 | grep -v id | cut -b77-78

and I run that, I get:
Code:
bash-3.2# ./test.sh
#

I then have to type "exit" to allow the script to complete execution as follows:
Code:
bash-3.2# ./test.sh
# exit

85
98
bash-3.2#

So the more I am trying the more I am both learning and digging my wheels in deeper. Smilie

I'm hoping someone can help me out.

Marc

Last edited by Marc G; 03-25-2013 at 05:01 PM..
 

9 More Discussions You Might Find Interesting

1. SCO

How to check memory details of a SCO UNIXWARE machine

Hi All, I want to check memory details and other hardware details of my SCO machine. can someone please share the command to do that? Thanks, Am (2 Replies)
Discussion started by: am_yadav
2 Replies

2. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

3. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

4. Shell Programming and Scripting

How to transfer files from unix machine to local machine using shell script?

Hi All.. Am new to Unix!! Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp). And also i have to transfer the input file from the local directory to Unix machine (Server) Any help from you... (1 Reply)
Discussion started by: vidhyaS
1 Replies

5. Windows & DOS: Issues & Discussions

How to know machine details in windows through cmd

Hi, I want to print machine details in windows. In UNIX it is easily available by the command uname -X Is there any command like this in windows to get those details.. can anybody help me on this.. Thanks in advance. ~arup (1 Reply)
Discussion started by: arup1980
1 Replies

6. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

7. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

8. Linux

Unable to connect to Server machine from a client machine using ftp service

Hi, Could you please help me with the below issue.. I'm running RHEL6 OS on both server (192.168.0.10) and client machines (192.168.0.1). I'm trying to connect to server from the client machine using ftp service. I have installed vsftpd daemon on both the machines. I'm getting... (4 Replies)
Discussion started by: raosr020
4 Replies

9. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy