Merge pull request #2536 from paulgear/mib-poller-alpha2

MIB-based poller alpha2
This commit is contained in:
Neil Lathwood
2016-01-06 09:08:56 +00:00
42 changed files with 1371 additions and 478 deletions
+20 -10
View File
@@ -13,25 +13,35 @@
*/
$rrd_list = array();
$prefix = rrd_name($device['hostname'], array($subtype, ''), '');
foreach (glob($prefix.'*.rrd') as $filename) {
$prefix = rrd_name($device['hostname'], array($subtype, ''), '');
$filenames = glob($prefix."*.rrd");
$count = count($filenames);
foreach ($filenames as $filename) {
// find out what * expanded to
$globpart = str_replace($prefix, '', $filename);
// take off the prefix
$instance = substr($globpart, 0, -4);
// take off ".rrd"
$globpart = str_replace($prefix, '', $filename); // take off the prefix
$instance = substr($globpart, 0, -4); // take off ".rrd"
$ds = array();
$mibparts = explode('-', $subtype);
$mibvar = end($mibparts);
$ds['ds'] = name_shorten($mibvar);
$ds['ds'] = 'mibval';
$ds['descr'] = "$mibvar-$instance";
$ds['filename'] = $filename;
$rrd_list[] = $ds;
}
$colours = 'mixed';
$scale_min = '0';
$nototal = 0;
$simple_rrd = true;
require 'includes/graphs/generic_multi_line.inc.php';
// If there are multiple matching files, use a stacked graph instead of a line graph
if ($count > 1) {
$nototal = 1;
$divider = $count;
$text_orig = 1;
$colours = 'manycolours';
include "includes/graphs/generic_multi_simplex_seperated.inc.php";
}
else {
$colours = 'mixed';
$nototal = 0;
include "includes/graphs/generic_multi_line.inc.php";
}
@@ -18,7 +18,7 @@ foreach ($procs as $proc) {
$unit_text = 'Load %';
$units = '%';
$units = '';
$total_units = '%';
$colours = 'mixed';