Commit e1ff81c9 authored by Franco Fichtner's avatar Franco Fichtner

include: get rid of spurious dir (1/2)

parent 70a2bcf6
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2009 Bill Marquette Copyright (C) 2009 Bill Marquette
...@@ -37,5 +38,3 @@ require_once("system.inc"); ...@@ -37,5 +38,3 @@ require_once("system.inc");
include_once("includes/functions.inc.php"); include_once("includes/functions.inc.php");
echo get_stats(); echo get_stats();
?>
<?php <?php
/* /*
Copyright (C) 2014-2015 Deciso B.V. Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net> Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net>
and Jonathan Watt <jwatt@jwatt.org>. and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved. All rights reserved.
...@@ -39,7 +40,7 @@ header("Content-type: image/svg+xml"); ...@@ -39,7 +40,7 @@ header("Content-type: image/svg+xml");
/********* Other conf *******/ /********* Other conf *******/
$nb_plot = 120; // maximum number of data points to plot in the graph $nb_plot = 120; // maximum number of data points to plot in the graph
$fetch_link = "stats.php?stats=cpu"; $fetch_link = 'stats.php';
//SVG attributes //SVG attributes
$attribs['axis']='fill="black" stroke="black"'; $attribs['axis']='fill="black" stroke="black"';
......
...@@ -177,17 +177,6 @@ function get_pfstate($percent=false) { ...@@ -177,17 +177,6 @@ function get_pfstate($percent=false) {
return $curentries . "/" . $maxstates; return $curentries . "/" . $maxstates;
} }
function has_temp() {
/* no known temp monitors available at present */
/* should only reach here if there is no hardware monitor */
return false;
}
function get_hwtype() {
return;
}
function get_mbuf($percent=false) { function get_mbuf($percent=false) {
$mbufs_output=trim(`/usr/bin/netstat -mb | /usr/bin/grep "mbuf clusters in use" | /usr/bin/awk '{ print $1 }'`); $mbufs_output=trim(`/usr/bin/netstat -mb | /usr/bin/grep "mbuf clusters in use" | /usr/bin/awk '{ print $1 }'`);
list( $mbufs_current, $mbufs_cache, $mbufs_total, $mbufs_max ) = explode( "/", $mbufs_output); list( $mbufs_current, $mbufs_cache, $mbufs_total, $mbufs_max ) = explode( "/", $mbufs_output);
...@@ -292,71 +281,59 @@ function get_load_average() { ...@@ -292,71 +281,59 @@ function get_load_average() {
return $load_average[0]; return $load_average[0];
} }
function get_interfacestats() { function get_interfacestats()
global $config; {
//build interface list for widget use
$ifdescrs = get_configured_interface_list(); $ifdescrs = get_configured_interface_list();
$array_in_packets = array();
$array_out_packets = array();
$array_in_bytes = array();
$array_out_bytes = array();
$array_in_errors = array();
$array_out_errors = array();
$array_collisions = array(); $array_collisions = array();
$array_interrupt = array(); $new_data = '';
$new_data = "";
//build data arrays foreach ($ifdescrs as $ifdescr => $ifname) {
foreach ($ifdescrs as $ifdescr => $ifname){
$ifinfo = get_interface_info($ifdescr); $ifinfo = get_interface_info($ifdescr);
$new_data .= "{$ifinfo['inpkts']},"; $new_data .= "{$ifinfo['inpkts']},";
$new_data .= "{$ifinfo['outpkts']},"; $new_data .= "{$ifinfo['outpkts']},";
$new_data .= format_bytes($ifinfo['inbytes']) . ","; $new_data .= format_bytes($ifinfo['inbytes']) . ",";
$new_data .= format_bytes($ifinfo['outbytes']) . ","; $new_data .= format_bytes($ifinfo['outbytes']) . ",";
if (isset($ifinfo['inerrs'])){ if (isset($ifinfo['inerrs'])){
$new_data .= "{$ifinfo['inerrs']},"; $new_data .= "{$ifinfo['inerrs']},";
$new_data .= "{$ifinfo['outerrs']},"; $new_data .= "{$ifinfo['outerrs']},";
} } else {
else{ $new_data .= "0,";
$new_data .= "0,"; $new_data .= "0,";
$new_data .= "0,"; }
} if (isset($ifinfo['collisions'])) {
if (isset($ifinfo['collisions'])) $new_data .= htmlspecialchars($ifinfo['collisions']) . ",";
$new_data .= htmlspecialchars($ifinfo['collisions']) . ","; } else {
else $new_data .= "0,";
$new_data .= "0,"; }
}//end for }
return $new_data; return $new_data;
} }
function get_interfacestatus() { function get_interfacestatus()
$data = ""; {
global $config;
//build interface list for widget use
$ifdescrs = get_configured_interface_with_descr(); $ifdescrs = get_configured_interface_with_descr();
$data = '';
foreach ($ifdescrs as $ifdescr => $ifname){ foreach ($ifdescrs as $ifdescr => $ifname) {
$ifinfo = get_interface_info($ifdescr); $ifinfo = get_interface_info($ifdescr);
$data .= $ifname . ","; $data .= $ifname . ",";
if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") { if ($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") {
$data .= "up"; $data .= "up";
}else if ($ifinfo['status'] == "no carrier") { } elseif ($ifinfo['status'] == "no carrier") {
$data .= "down"; $data .= "down";
}else if ($ifinfo['status'] == "down") { } elseif ($ifinfo['status'] == "down") {
$data .= "block"; $data .= "block";
} }
$data .= ","; $data .= ",";
if ($ifinfo['ipaddr']) if ($ifinfo['ipaddr']) {
$data .= htmlspecialchars($ifinfo['ipaddr']); $data .= htmlspecialchars($ifinfo['ipaddr']);
}
$data .= ","; $data .= ",";
if ($ifinfo['status'] != "down") if ($ifinfo['status'] != "down") {
$data .= htmlspecialchars($ifinfo['media']); $data .= htmlspecialchars($ifinfo['media']);
}
$data .= "~"; $data .= "~";
} }
return $data; return $data;
} }
<?php <?php
/* /*
Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com> Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com>
All rights reserved. All rights reserved.
...@@ -28,9 +29,4 @@ ...@@ -28,9 +29,4 @@
require_once("guiconfig.inc"); require_once("guiconfig.inc");
require_once("includes/functions.inc.php"); require_once("includes/functions.inc.php");
$cpu = cpu_usage(); echo cpu_usage();
echo $cpu;
exit;
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment