summaryrefslogtreecommitdiff
path: root/polux/application/boa/spc200/cgi-bin/calcul.php
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/boa/spc200/cgi-bin/calcul.php')
-rwxr-xr-xpolux/application/boa/spc200/cgi-bin/calcul.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/polux/application/boa/spc200/cgi-bin/calcul.php b/polux/application/boa/spc200/cgi-bin/calcul.php
new file mode 100755
index 0000000000..c414019d22
--- /dev/null
+++ b/polux/application/boa/spc200/cgi-bin/calcul.php
@@ -0,0 +1,61 @@
+#! /bin/uphp
+<?php
+ $ethac=popen("/sbin/ifconfig $choice","r");
+ while(!feof($ethac)) {
+ l = trim(fread($ethac));
+
+ if(ereg("RX[ ]*packets[:]([0-9]*)[ ]*errors[:]([0-9]*)[ ]*dropped[:]([0-9]*)[ ]*overruns[:]([0-9]*)[ ]*frame[:]([0-9]*)",l,$regs)){
+ RxEpac=regs[1];
+ RxEerr=$regs[2];
+ RxEdro=$regs[3];
+ RxEover=$regs[4];
+ RxEframe=$regs[5];
+ }
+
+ if(ereg("TX[ ]*packets[:]([0-9]*)[ ]*errors[:]([0-9]*)[ ]*dropped[:]([0-9]*)[ ]*overruns[:]([0-9]*)[ ]*carrier[:]([0-9]*)",l,$regs)){
+ TxEpac=regs[1];
+ TxEerr=$regs[2];
+ TxEdro=$regs[3];
+ TxEover=$regs[4];
+ TxEcar=$regs[5];
+ }
+
+ if(ereg("collisions[:]([0-9]*)[ ]txqueuelen[:]([0-9]*)",l,$regs)){
+ TxEcoll=regs[1];
+ TxEqlen=regs[2];
+ }
+
+ if(ereg("RX[ ]*bytes[:]([0-9]*)",l,$regs)){
+ RxEbytes=regs[1];
+ }
+ if(ereg("TX[ ]*bytes[:]([0-9]*)",l,$regs)){
+ TxEbytes=regs[1];
+ }
+ }
+ pclose($ethac);
+?>
+<html>
+<head>
+<script>
+function rifresh() { window.location.reload(); }
+
+parent.document.cIP.RxEpac.value="<?=$RxEpac?>";
+parent.document.cIP.TxEpac.value="<?=$TxEpac?>";
+parent.document.cIP.RxEerr.value="<?=$RxEerr?>";
+parent.document.cIP.TxEerr.value="<?=$TxEerr?>";
+parent.document.cIP.RxEdro.value="<?=$RxEdro?>";
+parent.document.cIP.TxEdro.value="<?=$TxEdro?>";
+parent.document.cIP.RxEover.value="<?=$RxEover?>";
+parent.document.cIP.TxEover.value="<?=$TxEover?>";
+parent.document.cIP.RxEframe.value="<?=$RxEframe?>";
+parent.document.cIP.TxEcar.value="<?=$TxEcar?>";
+parent.document.cIP.TxEcoll.value="<?=$TxEcoll?>";
+parent.document.cIP.TxEqlen.value="<?=$TxEqlen?>";
+parent.document.cIP.RxEbytes.value="<?=$RxEbytes?>";
+parent.document.cIP.TxEbytes.value="<?=$TxEbytes?>";
+self.setTimeout('rifresh()', 5000);
+</script>
+</head>
+<body>
+</body>
+</html>