[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ipcop-cvs
Subject:    [IPCop-cvs] CVS: ipcop/html/cgi-bin index.cgi,1.5.2.9,1.5.2.10
From:       Mark Wormgoor <riddles () users ! sourceforge ! net>
Date:       2003-04-24 8:46:30
[Download RAW message or body]

Update of /cvsroot/ipcop/ipcop/html/cgi-bin
In directory sc8-pr-cvs1:/tmp/cvs-serv31966/html/cgi-bin

Modified Files:
      Tag: IPCOP_v1
	index.cgi 
Log Message:
High memory usage warning

Index: index.cgi
===================================================================
RCS file: /cvsroot/ipcop/ipcop/html/cgi-bin/Attic/index.cgi,v
retrieving revision 1.5.2.9
retrieving revision 1.5.2.10
diff -C2 -d -r1.5.2.9 -r1.5.2.10
*** index.cgi	24 Apr 2003 08:29:16 -0000	1.5.2.9
--- index.cgi	24 Apr 2003 08:46:27 -0000	1.5.2.10
***************
*** 16,19 ****
--- 16,20 ----
  my %modemsettings;
  my %netsettings;
+ my $warnmessage = '';
  
  &showhttpheaders();
***************
*** 328,333 ****
  }
  
  @df = `/bin/df -h -x rootfs`;
- my $warnmessage = '';
  foreach $line (@df) {
  	next if $line =~ m/Filesystem/;
--- 329,344 ----
  }
  
+ # Memory usage warning
+ my @free = `/usr/bin/free`;
+ $free[1] =~ m/(\d+)/;
+ my $mem = $1;
+ $free[2] =~ m/(\d+)/;
+ my $pct = int 100 * ($mem - $1) / $mem;
+ if ($used / $mem > 90) {
+ 	$warnmessage .= "<LI> $tr{'high memory usage'}: $pct% !";
+ }
+ 
+ # Diskspace usage warning
  @df = `/bin/df -h -x rootfs`;
  foreach $line (@df) {
  	next if $line =~ m/Filesystem/;
***************
*** 339,342 ****
--- 350,354 ----
  }
  
+ # Patches warning
  open(AV, "${swroot}/patches/available") or die "Could not open available patches database ($!)";
  @av = <AV>;



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
IPCop-cvs mailing list
IPCop-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic