The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Obtain Mac Adress in crontab Pedro Almeida OS X (Apple) 5 06-06-2008 05:26 AM
How can I obtain Hpux? arabidi HP-UX 4 12-21-2006 05:49 AM
where to obtain UNIX and learning on a UNIX variant? ninelives1980 UNIX for Dummies Questions & Answers 6 04-22-2005 11:27 PM
command to obtain lrecl leroyj UNIX for Dummies Questions & Answers 1 07-07-2004 07:03 AM
Where to obtain FreeBSD? treborwallace UNIX for Dummies Questions & Answers 3 11-30-2001 02:59 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-06-2005
Registered User
 

Join Date: Oct 2005
Posts: 2
Obtain Memory on HP UNIX

Hi,

Does anyone know an easy way of getting the memory usage on a UNIX box? I basically want to find the total % available/in use. Running vmstat gives me 'avm' and 'free' but come in bytes and not percents. Didn't see a switch in sar that just gave me the memory stats similar to Sun's -r command.

Oh, and I need it to come one one line (like sar or vmstat).

Cheers,
J
Reply With Quote
Forum Sponsor
  #2  
Old 10-24-2005
Registered User
 

Join Date: Oct 2005
Posts: 1
Smile I am looking for the same....

Currently, we are looking for something that does exactly what you say...

If you find something or i ... please be in touch. Regards.
Reply With Quote
  #3  
Old 10-27-2005
Registered User
 

Join Date: Oct 2005
Posts: 2
Hi,

Have not found anything. Any luck on your side?

J
Reply With Quote
  #4  
Old 10-28-2005
Registered User
 

Join Date: Feb 2005
Location: Canada
Posts: 131
Glance PLUS is going to do what you need, but you'll have to pay for it depending of the version of HP-UX you have. I know that it comes with the Enterprise OE version of HP-UX but you have to buy a pack for Foundation OE version.

Code:
 GlancePlus C.03.85.00          09:51:39     xxxx     ia64    Current  Avg  High
--------------------------------------44----------------------------------------
CPU  Util   SSSSSSUUUUUU                                       | 24%   24%   24%
Disk Util   FFFFFFFFFFF                                        | 21%   23%   24%
Mem  Util   SSSSSSSSSSSSFFFFSSSSSSSSSSSSSSSSSSUUUUUUUUUUBBB    | 32%   21%   32%
Swap Util   UUUUUUUUUUUUUUUUUUUURRRRRRRR                       | 54%   54%   54%
--------------------------------------------------------------------------------
                                  PROCESS LIST                      Users=  312
                              User      CPU Util     Cum     Disk           Thd
Process Name   PID   PPID Pri Name   (  400% max)    CPU   IO Rate    RSS   Cnt
--------------------------------------------------------------------------------
xxxxxxx       8449      1 168 xxxx     42.2/21.7  7489.5  0.2/ 0.0   1.2mb    1
xx           26306  25776 198 xxxx     18.7/19.9  6877.4  0.0/99.0   1.9mb    1
xxxxxxx       8306      1 185 xxxx      1.8/19.9  6879.1  343/99.2   1.2mb    1
xx           24642  24641 148 xxxx      1.5/ 0.8    37.0  229/14.3   2.3mb    1
xx xx        15611  15610 154 xxxx      1.1/ 0.0     1.5  8.7/ 0.3   2.1mb    1
xxxxxxxx      1876      1 -16 xxxx      0.8/ 0.4  9881.3  0.0/ 0.0  22.3mb    2
xx            8066   8065 154 xxxx      0.6/ 0.0     0.6  6.8/ 0.1   2.7mb    1
xx            9621   9620 154 xxxx      0.6/ 0.0     2.7  8.7/ 0.2   3.7mb    1
xxxxxxxx      3742   3739 154 xxxx      0.4/ 0.1     0.3  3.4/ 0.0  21.8mb    2
xx            8332   8331 154 xxxx      0.4/ 0.2     3.7  2.1/ 0.8   3.5mb    1
xx           26653  26651 154 xxxx      0.4/ 0.0     1.2  7.6/ 0.1   5.0mb    1
xxxx         17820  17819 148 xxxx       0.2/ 0.5 11723.1 38.5/ 0.4   3.1mb   71
xxxxx           53      0 134 xxxx       0.0/ 4.3  100794 15.8/30.4  11.4mb   46
                                          0               9.5                 2
Reply With Quote
  #5  
Old 10-30-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,613
PxT pioneered a technique involving invoking pstat from perl. I have been studying the technique in preparation for a script I plan to write. I have tried to write a script to solve your requirement. I may have succeeded. I have only tested it on one system. The total physical memory matches what I from cstm. Free memory matches what I get from vmstat. And the percentages match what I get from glance. So it may be working. But no guarantees.
Code:
#!/usr/contrib/bin/perl

local($PSTAT, $PSTAT_STATIC, $PSTAT_DYNAMIC) = (239, 2, 3);
local($struct_pst) = ("\0" x 156);
local($struct_psd) = ("\0" x 2904);

syscall($PSTAT, $PSTAT_STATIC, $struct_pst, length($struct_pst), 1, 0);
($pages, $psize) = (unpack("x16LL", $struct_pst));
syscall($PSTAT, $PSTAT_DYNAMIC, $struct_psd, length($struct_psd), 1, 0);
$free = unpack("x64L", $struct_psd);
$mb = ($psize / 1024) * $pages;
$mb = $mb / 1024;
print "Physical Memory: ",$mb,"MB\n";
print "Free Pages: ", $free, "\n";
$pcfree = 100. * $free /$pages;
$pcused = 100. - $pcfree;
printf(" %0.2f%% free          %0.2f%% used \n", $pcfree, $pcused);
exit 0;
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:29 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0