I've detected that my swap calculation method is wrong, since:
Virtual Memory = PhysicalMemory(RAM) + Extended Memory (Disk)
Therefore, i've changed the SWAP calculation method to:
my $total_swap_mem = $v->{SizeStoredInPagingFiles}; my $free_swap_mem = $v->{FreeSpaceInPagingFiles}; my $used_swap_mem = $total_swap_mem - $free_swap_mem; my $used_swap_mem_perc = ($total_swap_mem - $free_swap_mem) / $total +_swap_mem * 100; printf "Swap total:%d kb\n", $total_swap_mem; printf "Swap free:%d kb\n", $free_swap_mem; printf "Swap used:%d kb\n", $used_swap_mem; printf "Swap used:%.2f %%\n", $used_swap_mem_perc;
in short, i need to validade this:
MEM_USED = Win32_OperatingSystem->TotalVisibleMemorySize - Win32_Opera +tingSystem->FreePhysicalMemory SWAP_USED = (Win32_OperatingSystem->SizeStoredInPagingFiles - Win32_Op +eratingSystem->FreeSpaceInPagingFiles) / Win32_OperatingSystem->Size +StoredInPagingFiles

tks,

gulden
«A contentious debate is always associated with a lack of valid arguments.»

In reply to Re: Collect Memory Data from WMI (Win32) by gulden
in thread Collect Memory Data from WMI (Win32) by gulden

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.