]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/memory.cgi
corrected some smaller bugs in some cgiŽs
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / memory.cgi
index 07f7b438594541d9974224090b2425906176706a..ed73fb3f80e9671840825e5b667c1f20fd2720be 100644 (file)
@@ -1,31 +1,42 @@
 #!/usr/bin/perl
-#
-# SmoothWall CGIs
-#
-# This code is distributed under the terms of the GPL
-#
-# (c) The SmoothWall Team
-#
-#
+###############################################################################
+#                                                                             #
+# IPFire.org - A linux based firewall                                         #
+# Copyright (C) 2007  Michael Tremer & Christian Schmidt                      #
+#                                                                             #
+# This program is free software: you can redistribute it and/or modify        #
+# it under the terms of the GNU General Public License as published by        #
+# the Free Software Foundation, either version 3 of the License, or           #
+# (at your option) any later version.                                         #
+#                                                                             #
+# This program is distributed in the hope that it will be useful,             #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
+# GNU General Public License for more details.                                #
+#                                                                             #
+# You should have received a copy of the GNU General Public License           #
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
+#                                                                             #
+###############################################################################
 
 use strict;
 
 # enable only the following on debugging purpose
-use warnings;
-use CGI::Carp 'fatalsToBrowser';
+#use warnings;
+#use CGI::Carp 'fatalsToBrowser';
 
 require '/var/ipfire/general-functions.pl';
 require "${General::swroot}/lang.pl";
 require "${General::swroot}/header.pl";
+require "${General::swroot}/graphs.pl";
 
 my %cgiparams=();
 
-&Header::showhttpheaders();
+&Graphs::updatememgraph ("day");
 
+&Header::showhttpheaders();
 &Header::getcgihash(\%cgiparams);
-
 &Header::openpage($Lang::tr{'memory information'}, 1, '');
-
 &Header::openbigbox('100%', 'left');
 
 &Header::openbox('100%', 'center', "Memory $Lang::tr{'graph'}");
@@ -86,7 +97,7 @@ END
       print <<END
 <tr>
 <td class='boldbase'><b>$Lang::tr{'ram'}</b></td>
-<td align='center'>$size</td>
+<td align='center'>$size  KB</td>
 END
 ;
     } elsif ($_ =~ m/^Swap:\s+(\d+)\s+(\d+)\s+(\d+)$/) {
@@ -100,7 +111,7 @@ END
       print <<END
 <tr>
 <td class='boldbase'><b>$Lang::tr{'swap'}</b></td>
-<td align='center'>$size</td>
+<td align='center'>$size  KB</td>
 END
 ;
     } elsif ($ram and $_ =~ m/^-\/\+ buffers\/cache:\s+(\d+)\s+(\d+)$/ ) {
@@ -109,8 +120,8 @@ END
       print "<tr><td colspan='2' class='boldbase'><b>$Lang::tr{'excluding buffers and cache'}</b></td>"
     }
     print <<END
-<td align='center'>$used</td>
-<td align='center'>$free</td>
+<td align='center'>$used KB</td>
+<td align='center'>$free KB</td>
 <td>
 END
 ;
@@ -126,9 +137,9 @@ END
 close FREE;
 print <<END
 <tr><td class='boldbase' colspan='2'><br /></td></tr>
-<tr><td class='boldbase'><b>$Lang::tr{'shared'}</b></td><td align='center'>$shared</td></tr>
-<tr><td class='boldbase'><b>$Lang::tr{'buffers'}</b></td><td align='center'>$buffers</td></tr>
-<tr><td class='boldbase'><b>$Lang::tr{'cached'}</b></td><td align='center'>$cached</td></tr>
+<tr><td class='boldbase'><b>$Lang::tr{'shared'}</b></td><td align='center'>$shared KB</td></tr>
+<tr><td class='boldbase'><b>$Lang::tr{'buffers'}</b></td><td align='center'>$buffers KB</td></tr>
+<tr><td class='boldbase'><b>$Lang::tr{'cached'}</b></td><td align='center'>$cached KB</td></tr>
 </table>
 END
 ;