git-svn-id: http://www.observium.org/svn/observer/trunk@409 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-04-28 10:28:58 +00:00
parent dde365e30c
commit 1df7127d28
7 changed files with 37 additions and 21 deletions
+13
View File
@@ -238,6 +238,19 @@ function interface_errors ($rrd_file) // Returns the last in/out errors value in
return $errors;
}
function interface_packets ($rrd_file) // Returns the last in/out pps 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 6,7";
$data = trim(shell_exec($cmd));
foreach( explode("\n", $data) as $entry) {
list($in, $out) = explode(" ", $entry);
}
$packets['in'] = round($in);
$packets['out'] = round($out);
return $packets;
}
function geteventicon ($message)
{