mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add graph type for MIB-based polling
This commit is contained in:
36
html/includes/graphs/device/mib.inc.php
Normal file
36
html/includes/graphs/device/mib.inc.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/*
|
||||
* LibreNMS MIB-based polling
|
||||
*
|
||||
* Copyright (c) 2015 Gear Consulting Pty Ltd <github@libertysys.com.au>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation, either version 3 of the License, or (at your
|
||||
* option) any later version. Please see LICENSE.txt at the top level of
|
||||
* the source code distribution for details.
|
||||
*/
|
||||
|
||||
$rrd_list = array();
|
||||
$prefix = rrd_name($device['hostname'], array($subtype, ""), "");
|
||||
foreach (glob($prefix."*.rrd") as $filename) {
|
||||
// find out what * expanded to
|
||||
$globpart = str_replace($prefix, '', $filename); // take off the prefix
|
||||
$instance = substr($globpart, 0, -4); // take off ".rrd"
|
||||
|
||||
$ds = array();
|
||||
$mibvar = end(explode("-", $subtype));
|
||||
$ds['ds'] = name_shorten($mibvar);
|
||||
$ds['descr'] = "$mibvar-$instance";
|
||||
$ds['filename'] = $filename;
|
||||
$rrd_list[] = $ds;
|
||||
}
|
||||
|
||||
$colours = 'mixed';
|
||||
$scale_min = "0";
|
||||
$nototal = 0;
|
||||
$simple_rrd = true;
|
||||
|
||||
include("includes/graphs/generic_multi_line.inc.php");
|
||||
|
||||
?>
|
@@ -44,8 +44,10 @@ include($config['install_dir'] . "/html/includes/graphs/$type/auth.inc.php");
|
||||
if ($auth && is_file($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php")) {
|
||||
include($config['install_dir'] . "/html/includes/graphs/$type/$subtype.inc.php");
|
||||
}
|
||||
else
|
||||
{
|
||||
elseif ($auth && is_mib_graph($type, $subtype)) {
|
||||
include($config['install_dir'] . "/html/includes/graphs/$type/mib.inc.php");
|
||||
}
|
||||
else {
|
||||
graph_error("$type*$subtype ");//Graph Template Missing");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user