[Xymon] hpux-meminfo.c patch

Williams, Doug (Consultant-RIC) Doug.Williams at DexOne.com
Thu Mar 3 16:08:49 CET 2011


# ./mytest.sh
Total:49122
Free:42732

# cat mytest.sh
#!/usr/bin/sh

FREE=`/usr/sbin/swapinfo |grep ^memory |awk {'print $4'}`
FREEREPORT=`echo $FREE / 1024 |/usr/bin/bc`
TOTAL=`/usr/sbin/swapinfo |grep ^memory |awk {'print $2'}`
TOTALREPORT=`echo $TOTAL / 1024 |/usr/bin/bc`
echo Total:$TOTALREPORT
echo Free:$FREEREPORT


# uname -r
B.11.23

# swapinfo -ta
             Kb      Kb      Kb   PCT  START/      Kb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev     1048576       0 1038336    0%       0       -    1
/dev/vg00/lvol2
dev     83853312       0 83852288    0%       0       -    0
/dev/vgev08_swap_r0_1/lvswap
reserve       - 3775900 -3775900
memory  50301020 6543124 43757896   13%
total   135202908 10319024 124872620    8%       -       0    -

# swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        1024       0    1014    0%       0       -    1
/dev/vg00/lvol2
dev       81888       0   81887    0%       0       -    0
/dev/vgev08_swap_r0_1/lvswap
reserve       -    3686   -3686
memory    49122    6390   42732   13%
total    132034   10076  121947    8%       -       0    -


-----Original Message-----
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf
Of henrik at hswn.dk
Sent: Thursday, March 03, 2011 9:00 AM
To: Jason Fredricksen
Cc: xymon at xymon.com
Subject: Re: [Xymon] hpux-meminfo.c patch

Hi Jason,

On Tue, 22 Feb 2011 08:15:14 -0600, Jason Fredricksen
<jasonajfredricksen at gmail.com> wrote:
> This patch for hpux-meminfo.c may help due to  11iv3 page sizes 4096
,8192
> ,16384 ,65536. 

I was sent another solution back in December which replaces the
hpux-meminfo 
utility with a bit of shell scripting:

FREE=`/usr/sbin/swapinfo |grep ^memory |awk {'print $4'}`
FREEREPORT=`echo $FREE / 1024 |/usr/bin/bc`
TOTAL=`/usr/sbin/swapinfo |grep ^memory |awk {'print $2'}`
TOTALREPORT=`echo $TOTAL / 1024 |/usr/bin/bc`
echo Total:$TOTALREPORT
echo Free:$FREEREPORT

(the original message is 
 http://lists.xymon.com/archive/2010-December/030100.html 
 from Earl Flack)

Can you confirm if this shell script works OK for you ? 
I would much rather use standard shell-tools than a custom
C program that I have difficulty supporting.


Also, anyone with access to older HP/UX versions ? I would
be most interested to hear if Earl's shell version to get
the memory info works on other HP/UX versions as well.


Regards,
Henrik

_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon



More information about the Xymon mailing list