<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m doing something similar in my Solaris zones, calculating the percentage of RSS per zone versus the cap on the zone and reporting the percentage. That way we have a good threshold to alarm off, i.e. 90% of the capped memory is being used.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> xymon-bounces@xymon.com [mailto:xymon-bounces@xymon.com] <b>On Behalf Of </b>Vernon Everett<br><b>Sent:</b> Tuesday, July 24, 2012 7:04 AM<br><b>To:</b> Henrik Størner<br><b>Cc:</b> xymon@xymon.com<br><b>Subject:</b> Re: [Xymon] Memory monitoring - capped zone<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Henrik<br><br>I was hoping you would respond. :-)<br>My comprehension of C is shaky at best, which is why I asked the list.<br>Here's my understanding of the problem, and how I think we can improve things.<br>I am happy to code any changes to the script side, but there may be some updates required in the C code.<br><br>Using prtconf to get installed memory makes sense.<br>In a capped zone, it will show the cap.<br>In an uncapped zone, it will show the total memory, as seen from the global zone. (This may not really be the available memory because of other zones, but that is the potential memory available, and the best we can get at the moment.)<br><br>However, whenever we check the memory within a zone, capped, or uncapped, it interrogates the kernel. The kernel returns all the free memory it can see. From the global zone!<br>The problem arises in cases where there is more memory free than the cap size. <br>e.g. 2Gb cap, with 3Gb free memory.<br><br>So how to establish how much memory is really free in a capped zone.<br>If we run prstat -Z, the last lines will show the memory footprint of the zone.<br>(If you run it in the global zone, it shows the memory footprint of all the zones.)<br>The memory cap, less the footprint, should give us the free memory within the zone.<br><br>I do not believe there is any way from within a zone, to determine if you are capped or not capped, but that shouldn't make a difference. However, it's easy to deteremine if you are in a zone.<br>"zoneadm list" should be a single line, not equal to "global".<br>A non-zero exit code, or a return of global, indicates you are in a global zone, or a system not running zones.<br><br>Translating to pseudo code<br>if [ is a zone ] and [ not global zone ]<br>then<br>     use prtconf to get memory footprint<br>     calculate free memory using prtconf and memory footprint<br>else<br>     use existing method to determine free memory<br>fi<br><br>Thoughts and feedback appreciated.<br><br>Regards<br>     Vernon<br><br><br><br><o:p></o:p></p><div><p class=MsoNormal>On 24 July 2012 15:58, Henrik Størner <<a href="mailto:henrik@hswn.dk" target="_blank">henrik@hswn.dk</a>> wrote:<o:p></o:p></p><div><p class=MsoNormal>On <a href="tel:24-07-2012%2005" target="_blank">24-07-2012 05</a>:45, Vernon Everett wrote:<o:p></o:p></p><p class=MsoNormal>Hi all<br><br>I think I have eventually figured out how we can monitor memory in a<br>meaningful way in a capped zone.<br>Looking at the "client data" sent to the server, can anybody tell me<br>which data are used to calculate the figures, and percentage used for<br>memory?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal>It depends on what operating system is monitored - memory monitoring is one of the most messy parts of the Xymon client, simply because there is no standard way of reporting it from the various operating systems.<br><br>Look at the OS-specific code in xymond/client/*.c<br><br>E.g. on Solaris, it uses the "prtconf" data to determine the amount of RAM installed, the "memory" data to figure out how much is used, and the "swap" or "swaplist" data for swap information (depending on what version of the OS and client is installed).<br><br><br>Regards,<br>Henrik<br><br>_______________________________________________<br>Xymon mailing list<br><a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br><a href="http://lists.xymon.com/mailman/listinfo/xymon" target="_blank">http://lists.xymon.com/mailman/listinfo/xymon</a><o:p></o:p></p></div><p class=MsoNormal><br><br clear=all><br>-- <br>"Accept the challenges so that you can feel the exhilaration of victory"<o:p></o:p></p><div><p class=MsoNormal>- General George Patton<o:p></o:p></p></div><p class=MsoNormal><o:p> </o:p></p></div></body></html>