[comp.unix.admin] swapon -i needed

gplan@sol.aer.com (George A. Planansky) (06/20/91)

Sun 3/60, 3/280, 4/65, 4/75  running SunOS 4.03, 4.1, 4.1.1 ...;
Alliant fx/40 Concentrix 5.6, 5.7; other Un*x boxes? 

How can a user find out how much swap space is available on any
given machine?  Is there something like a "swapon -inquiry" 
command?  Or has someone written a shell script (perl "phrase" :-) ),
that rounds up all the usual messages, and says what it's found?

I'd like such a thing to help me see how things stand with some machine
I am setting up, but it would also be useful to users wondering if 
their packages will fly on any given machine, say for selecting which
of a bunch to run a job on.
--
George Planansky                       
Atmospheric & Environmental Research        
Cambridge, MA 02139
gplanansky@aer.com   (617) 547-6207

kparker@javelin.sim.es.com (Kevin Parker) (06/21/91)

	The command "pstat -T" will  give you the answer in bytes.
	The last line of the output gives you the answer.

EXAMPLE:

	%pstat -T
	
	277/582 files
	320/326 inodes
 	96/138 processes
	10768/42872 swap




	Hope this helps,
	Kevin

moss@cs.umass.edu (Eliot Moss) (06/21/91)

pstat -s works fine for me (Ultrix 4.1, but known to work on prior releases,
etc.) ...
--

		J. Eliot B. Moss, Assistant Professor
		Department of Computer and Information Science
		Lederle Graduate Research Center
		University of Massachusetts
		Amherst, MA  01003
		(413) 545-4206, 545-1249 (fax); Moss@cs.umass.edu

hyc@hanauma.jpl.nasa.gov (Howard Chu) (06/21/91)

In article <GPLAN.91Jun19210331@sol.aer.com> gplan@sol.aer.com (George A. Planansky) writes:
>Sun 3/60, 3/280, 4/65, 4/75  running SunOS 4.03, 4.1, 4.1.1 ...;
>Alliant fx/40 Concentrix 5.6, 5.7; other Un*x boxes? 
>
>How can a user find out how much swap space is available on any
>given machine?  Is there something like a "swapon -inquiry" 
>command?  Or has someone written a shell script (perl "phrase" :-) ),
>that rounds up all the usual messages, and says what it's found?

Try "pstat -s," pstat is standard in BSD Unix.
-- 
  -- Howard Chu @ Jet Propulsion Laboratory, Pasadena, CA
	Disclaimer: How would I know, I just got here!

lalonde@semifs3 ( iccad) (06/21/91)

gplan@sol.aer.com (George A. Planansky) writes:

>How can a user find out how much swap space is available on any
>given machine?  Is there something like a "swapon -inquiry" 
>command?  Or has someone written a shell script (perl "phrase" :-) ),
>that rounds up all the usual messages, and says what it's found?

Try "pstat -s" 
It returns a line like:

4584k allocated + 704k reserved = 5288k used, 50864k available

From the pstat mna page:
     -s   Print information about swap space usage:

               allocated:  The amount of swap  space  (in  bytes)
                           allocated to private pages.

               reserved:   The number of  swap  space  bytes  not
                           currently  allocated,  but  claimed by
                           memory  mappings  that  have  not  yet
                           created private pages.

               used:       The total amount  of  swap  space,  in
                           bytes,  that  is  either  allocated or
                           reserved.

               available:  The total swap space, in  bytes,  that
                           is   currently  available  for  future
                           reservation and allocation.

-- 
==============================================================================
Terry Lalonde (613)592-2122   | "the war between mainframes and micros is over
Usenet:...!uunet!mitel!lalonde| over and the network has won" 
Internet: lalonde@mitel.com   |                Editors Network Computing 01/91  

ballen@convex.csd.uwm.edu (Bruce Allen) (06/22/91)

In article <GPLAN.91Jun19210331@sol.aer.com> gplan@sol.aer.com (George A. Planansky) writes:
>How can a user find out how much swap space is available on any
>given machine?  Is there something like a "swapon -inquiry" 
>command?  Or has someone written a shell script (perl "phrase" :-) ),

Try pstat -s

katz@elements.rpal.com (Morry Katz) (06/22/91)

In article <GPLAN.91Jun19210331@sol.aer.com> gplan@sol.aer.com (George A. Planansky) writes:
> 
> Sun 3/60, 3/280, 4/65, 4/75  running SunOS 4.03, 4.1, 4.1.1 ...;
> Alliant fx/40 Concentrix 5.6, 5.7; other Un*x boxes? 
> 
> How can a user find out how much swap space is available on any
> given machine?  Is there something like a "swapon -inquiry" 
> command?  Or has someone written a shell script (perl "phrase" :-) ),
> that rounds up all the usual messages, and says what it's found?
> 
pstat -s
--
------------------------------------------------------
Morry Katz
Rockwell Science Center
administrator@rpal.rockwell.com (machine administration issues)
katz@rpal.rockwell.com (other)
------------------------------------------------------

pd@x.co.uk (Paul Davey) (06/24/91)

>>>>> On 21 Jun 91 20:05:10 GMT, ballen@convex.csd.uwm.edu (Bruce Allen) said:

-> In article <GPLAN.91Jun19210331@sol.aer.com> gplan@sol.aer.com (George A. Planansky) writes:
>How can a user find out how much swap space is available on any
>given machine?  Is there something like a "swapon -inquiry" 
>command?  Or has someone written a shell script (perl "phrase" :-) ),

-> Try pstat -s

This is good for Berkley Software Distribution, but what does one do
on a plain SYSV box? 

All I can think of is to use dd to copy the b partition of the root
disc (default swap or page) to /dev/null to report the size, but this
is obviously flawed. Is there a better way?
--
 Regards,			 pd@x.co.uk          IXI Limited
	Paul Davey		 pd@ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ      
				 USA: 1 800 XDESK 57

klamer@mi.eltn.utwente.nl (Klamer Schutte) (06/24/91)

In <GPLAN.91Jun19210331@sol.aer.com> gplan@sol.aer.com (George A. Planansky) writes:
>How can a user find out how much swap space is available on any
>given machine?  Is there something like a "swapon -inquiry" 

try: /usr/etc/pstat -s

Klamer
-- 
Klamer Schutte			Tel: +31-53-892786	Fax: +31-53-340045
Faculty of electrical engineering -- University of Twente, The Netherlands
preferred: klamer@mi.eltn.utwente.nl   SMTP: klamer@utelmi01.el.utwente.nl