updates, more mibs, cleanups

git-svn-id: http://www.observium.org/svn/observer/trunk@486 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-10-13 20:07:31 +00:00
parent 1ddbacb7ce
commit 8828225659
8 changed files with 2520 additions and 13 deletions
+2 -2
View File
@@ -236,11 +236,11 @@ function interface_rates ($rrd_file) // Returns the last in/out value in RRD
return $rate;
}
function interface_errors ($rrd_file) // Returns the last in/out errors value in RRD
function interface_errors ($rrd_file, $period = '-1d') // Returns the last in/out errors value in RRD
{
global $config;
#$rrdfile = $config['rrd_dir'] . "/" . $interface['hostname'] . "/" . $interface['ifIndex'] . ".rrd";
$cmd = $config['rrdtool']." fetch -s -1d -e -300s $rrd_file AVERAGE | grep : | cut -d\" \" -f 4,5";
$cmd = $config['rrdtool']." fetch -s $period -e -300s $rrd_file AVERAGE | grep : | cut -d\" \" -f 4,5";
$data = trim(shell_exec($cmd));
foreach( explode("\n", $data) as $entry) {
list($in, $out) = explode(" ", $entry);