SF.net SVN: logwatch:[185] scripts/services/zz-sys

[email protected]
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Revision: 185
          http://sourceforge.net/p/logwatch/code/185
Author:   stefjakobs
Date:     2014-02-02 12:27:49 +0000 (Sun, 02 Feb 2014)
Log Message:
-----------
zz-sys: report swap usage (thanks gulikoza)

Modified Paths:
--------------
    scripts/services/zz-sys

Modified: scripts/services/zz-sys
===================================================================
--- scripts/services/zz-sys	2014-01-26 13:46:58 UTC (rev 184)
+++ scripts/services/zz-sys	2014-02-02 12:27:49 UTC (rev 185)
@@ -60,9 +60,11 @@
    print STDERR "No Sys::MemInfo module installed.  To install, execute the command:\n";
    print STDERR "   perl -MCPAN -e 'install Sys::MemInfo' \n\n";
 } else {
-   import Sys::MemInfo qw(totalmem freemem);
+   import Sys::MemInfo qw(totalmem freemem totalswap freeswap);
+   my $swapused = &totalswap - &freeswap;
    printf "   Total Memory:  %6d MB\n", ((&totalmem - (&totalmem % (1024*1024))) / (1024*1024));
-   printf "   Free Memory:   %6d MB\n", ((&freemem - (&freemem % (1024*1024))) / (1024*1024)); 
+   printf "   Free Memory:   %6d MB\n", ((&freemem - (&freemem % (1024*1024))) / (1024*1024));
+   printf "   Swap Used:     %6d MB\n", (($swapused - ($swapused % (1024*1024))) / (1024*1024));
 }
 
 # vi: shiftwidth=3 tabstop=3 syntax=perl et

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.