mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
add cef switching graphs and un-retard sensors polling
git-svn-id: http://www.observium.org/svn/observer/trunk@2079 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -33,6 +33,7 @@ ALTER TABLE `ports` MODIFY `port_descr_type` VARCHAR(255);
|
||||
RENAME TABLE `vmware_vminfo` TO `vminfo` ;
|
||||
ALTER TABLE `vminfo` ADD `vm_type` VARCHAR(16) NOT NULL DEFAULT 'vmware' AFTER `device_id`;
|
||||
CREATE TABLE IF NOT EXISTS `cef_switching` ( `device_id` int(11) NOT NULL, `entPhysicalIndex` int(11) NOT NULL, `afi` varchar(4) COLLATE utf8_unicode_ci NOT NULL, `cef_index` int(11) NOT NULL, `cef_path` varchar(16) COLLATE utf8_unicode_ci NOT NULL, `drop` int(11) NOT NULL, `punt` int(11) NOT NULL, `punt2host` int(11) NOT NULL, `drop_prev` int(11) NOT NULL, `punt_prev` int(11) NOT NULL, `punt2host_prev` int(11) NOT NULL,`updated` INT NOT NULL , `updated_prev` INT NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
ALTER TABLE `mac_accounting` CHANGE `peer_mac` `mac` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
|
||||
ALTER TABLE `mac_accounting` CHANGE `peer_mac` `mac` VARCHAR( 32 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL;
|
||||
ALTER TABLE `mac_accounting` DROP `peer_ip`, DROP `peer_desc`, DROP `peer_asn`;
|
||||
UPDATE sensors SET sensor_class='frequency' WHERE sensor_class='freq';
|
||||
ALTER TABLE `cef_switching` ADD `cef_switching_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;
|
||||
|
20
html/includes/graphs/cefswitching/auth.inc.php
Normal file
20
html/includes/graphs/cefswitching/auth.inc.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
if (is_numeric($id))
|
||||
{
|
||||
$query = mysql_query("SELECT * FROM `cef_switching` AS C, `devices` AS D WHERE C.cef_switching_id = '".$id."' AND C.device_id = D.device_id");
|
||||
$cef = mysql_fetch_assoc($query);
|
||||
|
||||
if (is_numeric($cef['device_id']) && ($config['allow_unauth_graphs'] || device_permitted($cef['device_id'])))
|
||||
{
|
||||
$device = device_by_id_cache($cef['device_id']);
|
||||
|
||||
$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("cefswitching-".$cef['entPhysicalIndex']."-".$cef['afi']."-".$cef['cef_index'].".rrd");
|
||||
|
||||
$title = generate_device_link($device);
|
||||
$title .= " :: CEF Switching :: " . htmlentities($cef['cef_descr']);
|
||||
$auth = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
28
html/includes/graphs/cefswitching/graph.inc.php
Normal file
28
html/includes/graphs/cefswitching/graph.inc.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
## Cycle through dot3stats OIDs and build list of RRAs to pass to multi simplex grapher
|
||||
|
||||
$oids = array('drop', 'punt', 'hostpunt');
|
||||
$i = 0;
|
||||
|
||||
if (is_file($rrd_filename))
|
||||
{
|
||||
foreach ($oids as $oid)
|
||||
{
|
||||
$oid = str_replace("dot3Stats", "", $oid);
|
||||
$oid_rra = truncate($oid, 19, '');
|
||||
$rrd_list[$i]['filename'] = $rrd_filename;
|
||||
$rrd_list[$i]['descr'] = $oid;
|
||||
$rrd_list[$i]['rra'] = $oid_rra;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
#} else { echo("file missing: $file"); }
|
||||
|
||||
$colours = "mixed";
|
||||
$nototal = 1;
|
||||
$unit_text = "Errors";
|
||||
|
||||
include("includes/graphs/generic_multi_simplex_seperated.inc.php");
|
||||
|
||||
?>
|
@@ -3,28 +3,28 @@
|
||||
# FIXME uhh..
|
||||
if (1)
|
||||
{
|
||||
$rrd_list[1]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
$rrd_list[1]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[1]['rra_in'] = "INNUCASTPKTS";
|
||||
$rrd_list[1]['rra_out'] = "OUTNUCASTPKTS";
|
||||
$rrd_list[1]['descr'] = "NonUnicast";
|
||||
$rrd_list[1]['colour_area_in'] = "BB77BB";
|
||||
$rrd_list[1]['colour_area_out'] = "FFDD88";
|
||||
# $rrd_list[1]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
# $rrd_list[1]['descr'] = $int['ifDescr'];
|
||||
# $rrd_list[1]['rra_in'] = "INNUCASTPKTS";
|
||||
# $rrd_list[1]['rra_out'] = "OUTNUCASTPKTS";
|
||||
# $rrd_list[1]['descr'] = "NonUnicast";
|
||||
# $rrd_list[1]['colour_area_in'] = "BB77BB";
|
||||
# $rrd_list[1]['colour_area_out'] = "FFDD88";
|
||||
|
||||
$rrd_list[2]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
$rrd_list[2]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[2]['rra_in'] = "INBROADCASTPKTS";
|
||||
$rrd_list[2]['rra_out'] = "OUTBROADCASTPKTS";
|
||||
$rrd_list[2]['descr'] = "Broadcast";
|
||||
$rrd_list[2]['colour_area_in'] = "aa77BB";
|
||||
$rrd_list[2]['colour_area_out'] = "eeDD88";
|
||||
$rrd_list[2]['colour_area_in'] = "aa37BB";
|
||||
$rrd_list[2]['colour_area_out'] = "ee9D88";
|
||||
|
||||
$rrd_list[4]['filename'] = $config['rrd_dir'] . "/" . $device['hostname'] . "/port-" . safename($port['ifIndex'] . ".rrd");
|
||||
$rrd_list[4]['descr'] = $int['ifDescr'];
|
||||
$rrd_list[4]['rra_in'] = "INMULTICASTPKTS";
|
||||
$rrd_list[4]['rra_out'] = "OUTMULTICASTPKTS";
|
||||
$rrd_list[4]['descr'] = "Multicast";
|
||||
$rrd_list[4]['colour_area_in'] = "805080";
|
||||
$rrd_list[4]['colour_area_in'] = "905090";
|
||||
$rrd_list[4]['colour_area_out'] = "c0a060";
|
||||
|
||||
$units='';
|
||||
@@ -60,4 +60,4 @@ elseif (is_file($config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename(
|
||||
include("includes/graphs/generic_duplex.inc.php");
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
@@ -90,6 +90,23 @@ while ($cef = mysql_fetch_assoc($cef_query))
|
||||
|
||||
echo("</tr>
|
||||
");
|
||||
|
||||
if($_GET['opta'] == "graphs")
|
||||
{
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $now;
|
||||
$graph_array['id'] = $cef['cef_switching_id'];
|
||||
$graph_array['type'] = "cefswitching_graph";
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'><td colspan=6>");
|
||||
|
||||
include("includes/print-quadgraphs.inc.php");
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
@@ -223,7 +223,13 @@ while ($device = mysql_fetch_assoc($device_query))
|
||||
}
|
||||
} else {
|
||||
include("includes/polling/ipmi.inc.php");
|
||||
include("includes/polling/sensors.inc.php");
|
||||
include("includes/polling/temperatures.inc.php");
|
||||
include("includes/polling/humidity.inc.php");
|
||||
include("includes/polling/fanspeeds.inc.php");
|
||||
include("includes/polling/voltages.inc.php");
|
||||
include("includes/polling/frequencies.inc.php");
|
||||
include("includes/polling/current.inc.php");
|
||||
#include("includes/polling/sensors.inc.php"); FIXMESTOMMEBELGEN
|
||||
include("includes/polling/processors.inc.php");
|
||||
include("includes/polling/mempools.inc.php");
|
||||
include("includes/polling/storage.inc.php");
|
||||
|
Reference in New Issue
Block a user