Cisco OTV

Implements the CISCO-OTV-MIB to retrieve OTV counters from Cisco devices.
This collects information on the configured Overlays and Adjacencies

Statistics are collected for the amount of VLAN's on each overlay and the amount of MAC addresses available over each OTV endpoint.
OTV alerts are collected and generated if the appropriate alerting rules exist.

Data is displayed under routing at both the global and device level.

Includes function snmpwalk_array_num, which performs a numeric SNMPWalk and returns an array containing $count indexes
One Index:
 From: 1.3.6.1.4.1.9.9.166.1.15.1.1.27.18.655360 = 0
 To: $array['1.3.6.1.4.1.9.9.166.1.15.1.1.27.18']['655360'] = 0
Two Indexes:
 From: 1.3.6.1.4.1.9.9.166.1.15.1.1.27.18.655360 = 0
 To: $array['1.3.6.1.4.1.9.9.166.1.15.1.1.27']['18']['655360'] = 0
And so on...
This commit is contained in:
Aaron Daniels
2016-01-21 22:04:20 +10:00
parent 81fdfa6aa9
commit 8f4dbb5338
13 changed files with 793 additions and 4 deletions

View File

@@ -0,0 +1,62 @@
<?php
/*
* LibreNMS module to display Cisco Class-Based QoS Details
*
* Copyright (c) 2015 Aaron Daniels <aaron@daniels.id.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.
*/
require_once "../includes/component.php";
$COMPONENT = new component();
$options['filter']['type'] = array('=','Cisco-OTV');
$COMPONENTS = $COMPONENT->getComponents($device['device_id'],$options);
// We only care about our device id.
$COMPONENTS = $COMPONENTS[$device['device_id']];
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'VLANs Now Min Max\\n'";
$rrd_additions = "";
$COUNT = 0;
foreach ($COMPONENTS as $ID => $ARRAY) {
if ($ARRAY['otvtype'] == 'overlay') {
$rrd_filename = $config['rrd_dir'].'/'.$device['hostname'].'/'.safename("cisco-otv-".$ARRAY['label']."-vlan.rrd");
if (file_exists($rrd_filename)) {
// Stack the area on the second and subsequent DS's
$STACK = "";
if ($COUNT != 0) {
$STACK = ":STACK ";
}
// Grab a color from the array.
if ( isset($config['graph_colours']['mixed'][$COUNT]) ) {
$COLOR = $config['graph_colours']['mixed'][$COUNT];
}
else {
$COLOR = $config['graph_colours']['oranges'][$COUNT-7];
}
$rrd_additions .= " DEF:DS" . $COUNT . "=" . $rrd_filename . ":count:AVERAGE ";
$rrd_additions .= " AREA:DS" . $COUNT . "#" . $COLOR . ":'" . str_pad(substr($COMPONENTS[$ID]['label'],0,15),15) . "'" . $STACK;
$rrd_additions .= " GPRINT:DS" . $COUNT . ":LAST:%4.0lf%s ";
$rrd_additions .= " GPRINT:DS" . $COUNT . ":MIN:%4.0lf%s ";
$rrd_additions .= " GPRINT:DS" . $COUNT . ":MAX:%4.0lf%s\\\l ";
$COUNT++;
}
}
}
if ($rrd_additions == "") {
// We didn't add any data points.
}
else {
$rrd_options .= $rrd_additions;
}