Swap usage
"gulikoza" <[email protected]>
| Newsgroups | gmane.comp.log.logwatch.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello, zz-sys shows Total memory and Free memory but not Swap usage. This could be useful info for an administrator. The patch is fairly trivial, attached. Regards, gulikoza ------------------------------------------------------------------------------ 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 _______________________________________________ Logwatch-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/logwatch-devel
logwatch-swap.diff
(application/octet-stream, 911 B)
diff --git a/scripts/services/zz-sys b/scripts/services/zz-sys
--- a/scripts/services/zz-sys
+++ b/scripts/services/zz-sys
@@ -60,9 +60,11 @@ if ($@) {
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