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 Endian Bugtracker
Endian Issue Tracker





Please see now our new Bugtracker system: JIRA








View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003351Endian FirewallOther Scriptspublic2010-12-02 17:152010-12-02 17:16
Reportermax-endian 
Assigned Tomax-endian 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003351: The function getSpareMemory works wrong
DescriptionThe function getSpareMemory in the file /var/efw/header.pl calculates a wrong resusalt.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005283)
max-endian (developer)
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;
}

- Issue History
Date Modified Username Field Change
2010-12-02 17:15 max-endian New Issue
2010-12-02 17:16 max-endian Note Added: 0005283
2010-12-02 17:16 max-endian Status new => resolved
2010-12-02 17:16 max-endian Resolution open => fixed
2010-12-02 17:16 max-endian Assigned To => max-endian

Copyright © 2005-2008 Endian, SRL. All rights reserved.


Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker