Commit e1ff81c9 authored by Franco Fichtner's avatar Franco Fichtner

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

parent 70a2bcf6
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2009 Bill Marquette
......@@ -37,5 +38,3 @@ require_once("system.inc");
include_once("includes/functions.inc.php");
echo get_stats();
?>
<?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>
and Jonathan Watt <jwatt@jwatt.org>.
All rights reserved.
......@@ -39,7 +40,7 @@ header("Content-type: image/svg+xml");
/********* Other conf *******/
$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
$attribs['axis']='fill="black" stroke="black"';
......
......@@ -177,17 +177,6 @@ function get_pfstate($percent=false) {
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) {
$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);
......@@ -292,71 +281,59 @@ function get_load_average() {
return $load_average[0];
}
function get_interfacestats() {
global $config;
//build interface list for widget use
function get_interfacestats()
{
$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_interrupt = array();
$new_data = "";
$new_data = '';
//build data arrays
foreach ($ifdescrs as $ifdescr => $ifname){
foreach ($ifdescrs as $ifdescr => $ifname) {
$ifinfo = get_interface_info($ifdescr);
$new_data .= "{$ifinfo['inpkts']},";
$new_data .= "{$ifinfo['outpkts']},";
$new_data .= format_bytes($ifinfo['inbytes']) . ",";
$new_data .= format_bytes($ifinfo['outbytes']) . ",";
if (isset($ifinfo['inerrs'])){
$new_data .= "{$ifinfo['inerrs']},";
$new_data .= "{$ifinfo['outerrs']},";
}
else{
$new_data .= "0,";
$new_data .= "0,";
}
if (isset($ifinfo['collisions']))
$new_data .= htmlspecialchars($ifinfo['collisions']) . ",";
else
$new_data .= "0,";
}//end for
$new_data .= "{$ifinfo['inpkts']},";
$new_data .= "{$ifinfo['outpkts']},";
$new_data .= format_bytes($ifinfo['inbytes']) . ",";
$new_data .= format_bytes($ifinfo['outbytes']) . ",";
if (isset($ifinfo['inerrs'])){
$new_data .= "{$ifinfo['inerrs']},";
$new_data .= "{$ifinfo['outerrs']},";
} else {
$new_data .= "0,";
$new_data .= "0,";
}
if (isset($ifinfo['collisions'])) {
$new_data .= htmlspecialchars($ifinfo['collisions']) . ",";
} else {
$new_data .= "0,";
}
}
return $new_data;
}
function get_interfacestatus() {
$data = "";
global $config;
//build interface list for widget use
function get_interfacestatus()
{
$ifdescrs = get_configured_interface_with_descr();
$data = '';
foreach ($ifdescrs as $ifdescr => $ifname){
foreach ($ifdescrs as $ifdescr => $ifname) {
$ifinfo = get_interface_info($ifdescr);
$data .= $ifname . ",";
if($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") {
if ($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") {
$data .= "up";
}else if ($ifinfo['status'] == "no carrier") {
} elseif ($ifinfo['status'] == "no carrier") {
$data .= "down";
}else if ($ifinfo['status'] == "down") {
} elseif ($ifinfo['status'] == "down") {
$data .= "block";
}
$data .= ",";
if ($ifinfo['ipaddr'])
if ($ifinfo['ipaddr']) {
$data .= htmlspecialchars($ifinfo['ipaddr']);
}
$data .= ",";
if ($ifinfo['status'] != "down")
if ($ifinfo['status'] != "down") {
$data .= htmlspecialchars($ifinfo['media']);
}
$data .= "~";
}
return $data;
}
<?php
/*
Copyright (C) 2007 Scott Ullrich <sullrich@gmail.com>
All rights reserved.
......@@ -28,9 +29,4 @@
require_once("guiconfig.inc");
require_once("includes/functions.inc.php");
$cpu = cpu_usage();
echo $cpu;
exit;
?>
echo cpu_usage();
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