newdevice: Added additional support for F5 BigIP LTM objects

This commit is contained in:
Aaron Daniels
2016-12-20 05:50:44 +10:00
committed by Neil Lathwood
parent ac316b6a17
commit efa0747564
31 changed files with 2163 additions and 11 deletions

View File

@@ -0,0 +1,75 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id']);
// We only care about our device id.
$components = $components[$device['device_id']];
// We extracted all the components for this device, now lets only get the LTM ones.
$keep = array();
$types = array('f5-ltm-pool', 'f5-ltm-poolmember');
foreach ($components as $k => $v) {
foreach ($types as $type) {
if ($v['type'] == $type) {
$keep[$k] = $v;
}
}
}
$components = $keep;
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'LTM Pool Members Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// Is the ID we are looking for a valid LTM VS Pool
if ($components[$vars['id']]['type'] == 'f5-ltm-pool') {
$parent = $components[$vars['id']]['UID'];
// Find all pool members
foreach ($components as $compid => $comp) {
if ($comp['type'] != 'f5-ltm-poolmember') {
continue;
}
if (!strstr($comp['UID'], $parent)) {
continue;
}
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding PM: " . $label . "\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: " . (count($colours) - 1) . ", Requesting:" . $count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":bytesin:AVERAGE ";
$rrd_options .= " CDEF:MOD" . $count . "=DS" . $count . ",8,* ";
$rrd_options .= " LINE1.25:MOD" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 40), 40) . "'";
$rrd_options .= " GPRINT:MOD" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
} // End Foreach
}
d_echo("</pre>");

View File

@@ -0,0 +1,75 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id']);
// We only care about our device id.
$components = $components[$device['device_id']];
// We extracted all the components for this device, now lets only get the LTM ones.
$keep = array();
$types = array('f5-ltm-pool', 'f5-ltm-poolmember');
foreach ($components as $k => $v) {
foreach ($types as $type) {
if ($v['type'] == $type) {
$keep[$k] = $v;
}
}
}
$components = $keep;
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'LTM Pool Members Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// Is the ID we are looking for a valid LTM VS Pool
if ($components[$vars['id']]['type'] == 'f5-ltm-pool') {
$parent = $components[$vars['id']]['UID'];
// Find all pool members
foreach ($components as $compid => $comp) {
if ($comp['type'] != 'f5-ltm-poolmember') {
continue;
}
if (!strstr($comp['UID'], $parent)) {
continue;
}
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding PM: " . $label . "\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: " . (count($colours) - 1) . ", Requesting:" . $count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":bytesout:AVERAGE ";
$rrd_options .= " CDEF:MOD" . $count . "=DS" . $count . ",8,* ";
$rrd_options .= " LINE1.25:MOD" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 40), 40) . "'";
$rrd_options .= " GPRINT:MOD" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
} // End Foreach
}
d_echo("</pre>");

View File

@@ -0,0 +1,74 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id']);
// We only care about our device id.
$components = $components[$device['device_id']];
// We extracted all the components for this device, now lets only get the LTM ones.
$keep = array();
$types = array('f5-ltm-pool', 'f5-ltm-poolmember');
foreach ($components as $k => $v) {
foreach ($types as $type) {
if ($v['type'] == $type) {
$keep[$k] = $v;
}
}
}
$components = $keep;
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'LTM Pool Members Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// Is the ID we are looking for a valid LTM VS Pool
if ($components[$vars['id']]['type'] == 'f5-ltm-pool') {
$parent = $components[$vars['id']]['UID'];
// Find all pool members
foreach ($components as $compid => $comp) {
if ($comp['type'] != 'f5-ltm-poolmember') {
continue;
}
if (!strstr($comp['UID'], $parent)) {
continue;
}
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding PM: " . $label . "\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: " . (count($colours) - 1) . ", Requesting:" . $count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":totconns:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 40), 40) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
} // End Foreach
}
d_echo("</pre>");

View File

@@ -0,0 +1,74 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id']);
// We only care about our device id.
$components = $components[$device['device_id']];
// We extracted all the components for this device, now lets only get the LTM ones.
$keep = array();
$types = array('f5-ltm-pool', 'f5-ltm-poolmember');
foreach ($components as $k => $v) {
foreach ($types as $type) {
if ($v['type'] == $type) {
$keep[$k] = $v;
}
}
}
$components = $keep;
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'LTM Pool Members Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// Is the ID we are looking for a valid LTM VS Pool
if ($components[$vars['id']]['type'] == 'f5-ltm-pool') {
$parent = $components[$vars['id']]['UID'];
// Find all pool members
foreach ($components as $compid => $comp) {
if ($comp['type'] != 'f5-ltm-poolmember') {
continue;
}
if (!strstr($comp['UID'], $parent)) {
continue;
}
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding PM: " . $label . "\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: " . (count($colours) - 1) . ", Requesting:" . $count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":pktsin:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 40), 40) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
} // End Foreach
}
d_echo("</pre>");

View File

@@ -0,0 +1,74 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$components = $component->getComponents($device['device_id']);
// We only care about our device id.
$components = $components[$device['device_id']];
// We extracted all the components for this device, now lets only get the LTM ones.
$keep = array();
$types = array('f5-ltm-pool', 'f5-ltm-poolmember');
foreach ($components as $k => $v) {
foreach ($types as $type) {
if ($v['type'] == $type) {
$keep[$k] = $v;
}
}
}
$components = $keep;
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'LTM Pool Members Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// Is the ID we are looking for a valid LTM VS Pool
if ($components[$vars['id']]['type'] == 'f5-ltm-pool') {
$parent = $components[$vars['id']]['UID'];
// Find all pool members
foreach ($components as $compid => $comp) {
if ($comp['type'] != 'f5-ltm-poolmember') {
continue;
}
if (!strstr($comp['UID'], $parent)) {
continue;
}
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding PM: " . $label . "\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: " . (count($colours) - 1) . ", Requesting:" . $count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":pktsout:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 40), 40) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
} // End Foreach
}
d_echo("</pre>");

View File

@@ -0,0 +1,53 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$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:'LTM Vitrual Servers Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// add all LTM VS on this device.
foreach ($components as $compid => $comp) {
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding VS: ".$comp['label']."\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: ".(count($colours)-1).", Requesting:".$count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":bytesin:AVERAGE ";
$rrd_options .= " CDEF:MOD" . $count . "=DS" . $count . ",8,* ";
$rrd_options .= " LINE1.25:MOD" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 60), 60) . "'";
$rrd_options .= " GPRINT:MOD" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
}
d_echo("</pre>");

View File

@@ -0,0 +1,53 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$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:'LTM Vitrual Servers Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// add all LTM VS on this device.
foreach ($components as $compid => $comp) {
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding VS: ".$comp['label']."\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: ".(count($colours)-1).", Requesting:".$count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":bytesout:AVERAGE ";
$rrd_options .= " CDEF:MOD" . $count . "=DS" . $count . ",8,* ";
$rrd_options .= " LINE1.25:MOD" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 60), 60) . "'";
$rrd_options .= " GPRINT:MOD" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:MOD" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
}
d_echo("</pre>");

View File

@@ -0,0 +1,52 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$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:'VS Total Connections Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// add all LTM VS on this device.
foreach ($components as $compid => $comp) {
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding VS: ".$comp['label']."\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: ".(count($colours)-1).", Requesting:".$count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":totconns:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 60), 60) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
}
d_echo("</pre>");

View File

@@ -0,0 +1,52 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$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:'LTM Vitrual Servers Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// add all LTM VS on this device.
foreach ($components as $compid => $comp) {
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding VS: ".$comp['label']."\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: ".(count($colours)-1).", Requesting:".$count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":pktsin:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 60), 60) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
}
d_echo("</pre>");

View File

@@ -0,0 +1,52 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$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:'LTM Vitrual Servers Now Avg Max\\n'";
$colours = array_merge($config['graph_colours']['mixed'], $config['graph_colours']['manycolours'], $config['graph_colours']['manycolours']);
$count = 0;
d_echo("<pre>");
// add all LTM VS on this device.
foreach ($components as $compid => $comp) {
$label = $comp['label'];
$hash = $comp['hash'];
$rrd_filename = rrd_name($device['hostname'], array($comp['type'], $label, $hash));
if (file_exists($rrd_filename)) {
d_echo("\n Adding VS: ".$comp['label']."\t+ added to the graph");
// Grab a colour from the array.
if (isset($colours[$count])) {
$colour = $colours[$count];
} else {
d_echo("\nError: Out of colours. Have: ".(count($colours)-1).", Requesting:".$count);
}
$rrd_options .= " DEF:DS" . $count . "=" . $rrd_filename . ":pktsout:AVERAGE ";
$rrd_options .= " LINE1.25:DS" . $count . "#" . $colour . ":'" . str_pad(substr($label, 0, 60), 60) . "'";
$rrd_options .= " GPRINT:DS" . $count . ":LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:DS" . $count . ":MAX:%6.2lf%s\l ";
$count++;
}
}
d_echo("</pre>");

View File

@@ -0,0 +1,47 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$components = $component->getComponents($device['device_id'], $options);
// We only care about our device id.
$components = $components[$device['device_id']];
// Is the ID we are looking for a valid LTM VS
if (isset($components[$vars['id']])) {
$label = $components[$vars['id']]['label'];
$hash = $components[$vars['id']]['hash'];
include "includes/graphs/common.inc.php";
$rrd_options .= " -l 0 -E ";
$rrd_options .= " COMMENT:'Bits Now Ave Max\\n'";
$rrd_filename = rrd_name($device['hostname'], array('f5-ltm-vs', $label, $hash));
if (file_exists($rrd_filename)) {
$rrd_options .= " DEF:INBYTES=" . $rrd_filename . ":bytesin:AVERAGE ";
$rrd_options .= " CDEF:INBITS=INBYTES,8,* ";
$rrd_options .= " LINE1.25:INBITS#330033:'Bits In '";
$rrd_options .= " GPRINT:INBITS:LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:INBITS:AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:INBITS:MAX:%6.2lf%s\l ";
$rrd_options .= " DEF:OUTBYTES=" . $rrd_filename . ":bytesout:AVERAGE ";
$rrd_options .= " CDEF:OUTBITS=OUTBYTES,8,* ";
$rrd_options .= " LINE1.25:OUTBITS#FF6600:'Bits Out'";
$rrd_options .= " GPRINT:OUTBITS:LAST:%6.2lf%s ";
$rrd_options .= " GPRINT:OUTBITS:AVERAGE:%6.2lf%s ";
$rrd_options .= " GPRINT:OUTBITS:MAX:%6.2lf%s\l ";
}
}

View File

@@ -0,0 +1,44 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$components = $component->getComponents($device['device_id'], $options);
// We only care about our device id.
$components = $components[$device['device_id']];
// Is the ID we are looking for a valid LTM VS
if (isset($components[$vars['id']])) {
$label = $components[$vars['id']]['label'];
$hash = $components[$vars['id']]['hash'];
$rrd_filename = rrd_name($device['hostname'], array('f5-ltm-vs', $label, $hash));
if (file_exists($rrd_filename)) {
require 'includes/graphs/common.inc.php';
$ds = 'totconns';
$colour_area = '9999cc';
$colour_line = '0000cc';
$colour_area_max = '9999cc';
$graph_max = 1;
$graph_min = 0;
$unit_text = 'Total Connections';
$line_text = 'Connections';
require 'includes/graphs/generic_simplex.inc.php';
}
}

View File

@@ -0,0 +1,48 @@
<?php
/*
* LibreNMS module to display F5 LTM Virtual Server Details
*
* Copyright (c) 2016 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.
*/
$component = new LibreNMS\Component();
$options = array();
$options['filter']['type'] = array('=','f5-ltm-vs');
$components = $component->getComponents($device['device_id'], $options);
// We only care about our device id.
$components = $components[$device['device_id']];
// Is the ID we are looking for a valid LTM VS
if (isset($components[$vars['id']])) {
$label = $components[$vars['id']]['label'];
$hash = $components[$vars['id']]['hash'];
$rrd_filename = rrd_name($device['hostname'], array('f5-ltm-vs', $label, $hash));
if (file_exists($rrd_filename)) {
$ds_in = 'pktsin';
$ds_out = 'pktsout';
$colour_area_in = 'AA66AA';
$colour_line_in = '330033';
$colour_area_out = 'FFDD88';
$colour_line_out = 'FF6600';
$in_text = 'Packets in';
$out_text = 'Packets out';
$colour_area_in_max = 'cc88cc';
$colour_area_out_max = 'FFefaa';
$graph_max = 1;
$unit_text = 'Packets';
require 'includes/graphs/generic_duplex.inc.php';
}
}