SYSTEM WARNING: 'date_default_timezone_get(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in '/usr/share/mantis/www/core.php' line 264

0003351: The function getSpareMemory works wrong - MantisBT
MantisBT - Endian Firewall
View Issue Details
0003351Endian FirewallOther Scriptspublic2010-12-02 17:152010-12-02 17:16
max-endian 
max-endian 
normalminoralways
resolvedfixed 
 
 
0003351: The function getSpareMemory works wrong
The function getSpareMemory in the file /var/efw/header.pl calculates a wrong resusalt.
No tags attached.
Issue History
2010-12-02 17:15max-endianNew Issue
2010-12-02 17:16max-endianNote Added: 0005283
2010-12-02 17:16max-endianStatusnew => resolved
2010-12-02 17:16max-endianResolutionopen => fixed
2010-12-02 17:16max-endianAssigned To => max-endian

Notes
(0005283)
max-endian   
2010-12-02 17:16   
Replace the function by this one:

sub getSpareMemory() {
    my $swapfree = 0;
    my $used = 0;
    foreach my $line (`/usr/bin/free`) {
    if ($line =~ /cache:\s+(\d+)\s+(\d+)$/) {
        $memfree = $2;
    }
    if ($line =~ /Swap:\s+(\d+)\s+(\d+)\s+(\d+)$/) {
        $swapfree = $3;
    }
    }
    return ($swapfree+$memfree)*1024;
}