Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4006 from adaniels21487/issue-3550
Change the IPSLA feature to allow different metrics to be collected…
- Loading branch information
Showing
15 changed files
with
527 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:ICPIF=" . $rrd_filename . ":ICPIF:AVERAGE "; | ||
$rrd_options .= " LINE1.25:ICPIF#0000ee:'ICPIF ' "; | ||
$rrd_options .= " GPRINT:ICPIF:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:ICPIF:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:ICPIF:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:SD=" . $rrd_filename . ":OWAvgSD:AVERAGE "; | ||
$rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; | ||
$rrd_options .= " GPRINT:SD:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:DS=" . $rrd_filename . ":OWAvgDS:AVERAGE "; | ||
$rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; | ||
$rrd_options .= " GPRINT:DS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:SD=" . $rrd_filename . ":PacketLossSD:AVERAGE "; | ||
$rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; | ||
$rrd_options .= " GPRINT:SD:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:DS=" . $rrd_filename . ":PacketLossDS:AVERAGE "; | ||
$rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; | ||
$rrd_options .= " GPRINT:DS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:POS=" . $rrd_filename . ":PacketOutOfSequence:AVERAGE "; | ||
$rrd_options .= " LINE1.25:POS#0000ee:'Out of Sequence ' "; | ||
$rrd_options .= " GPRINT:POS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:POS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:POS:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:MIA=" . $rrd_filename . ":PacketMIA:AVERAGE "; | ||
$rrd_options .= " LINE1.25:MIA#008C00:'Missing in Action ' "; | ||
$rrd_options .= " GPRINT:MIA:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:MIA:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:MIA:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:PLA=" . $rrd_filename . ":PacketLateArrival:AVERAGE "; | ||
$rrd_options .= " LINE1.25:PLA#CC0000:'Late Arrival ' "; | ||
$rrd_options .= " GPRINT:PLA:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:PLA:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:PLA:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:MOS=" . $rrd_filename . ":MOS:AVERAGE "; | ||
$rrd_options .= " LINE1.25:MOS#0000ee:'Mean Opinion Score ' "; | ||
$rrd_options .= " GPRINT:MOS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:MOS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:MOS:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = rrd_name($device['hostname'], array('sla', $sla['sla_nr'], 'jitter')); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:SD=" . $rrd_filename . ":AvgSDJ:AVERAGE "; | ||
$rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; | ||
$rrd_options .= " GPRINT:SD:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:DS=" . $rrd_filename . ":AvgDSJ:AVERAGE "; | ||
$rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; | ||
$rrd_options .= " GPRINT:DS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
require 'includes/graphs/common.inc.php'; | ||
$rrd_options .= ' -l 0 -E '; | ||
$rrd_filename = $config['rrd_dir']."/".$device['hostname']."/".safename('sla-'.$sla['sla_nr'].'-jitter.rrd'); | ||
|
||
if (file_exists($rrd_filename)) { | ||
$rrd_options .= " COMMENT:' Cur Min Max\\n'"; | ||
|
||
$rrd_options .= " DEF:SD=" . $rrd_filename . ":AvgSDJ:AVERAGE "; | ||
$rrd_options .= " LINE1.25:SD#0000ee:'Src to Dst ' "; | ||
$rrd_options .= " GPRINT:SD:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:SD:MAX:%3.0lf\\\l "; | ||
|
||
$rrd_options .= " DEF:DS=" . $rrd_filename . ":AvgDSJ:AVERAGE "; | ||
$rrd_options .= " LINE1.25:DS#008C00:'Dst to Src ' "; | ||
$rrd_options .= " GPRINT:DS:LAST:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MIN:%3.0lf "; | ||
$rrd_options .= " GPRINT:DS:MAX:%3.0lf\\\l "; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
/* | ||
* LibreNMS module to Graph Cisco IPSLA UDP Jitter metrics | ||
* | ||
* 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. | ||
*/ | ||
|
||
$sla = dbFetchRow('SELECT `sla_nr`,`rtt_type` FROM `slas` WHERE `sla_id` = ?', array($vars['id'])); | ||
|
||
?> | ||
<div class="well well-sm"> | ||
<!-- Need some kind of header here to represent the SLA --> | ||
</div> | ||
|
||
<div class="panel panel-default" id="ipsla"> | ||
<?php | ||
|
||
// All SLA's support the RTT metric | ||
include 'sla/rtt.inc.php'; | ||
|
||
// Load the per-type SLA metrics | ||
if (file_exists('pages/device/sla/'.$sla['rtt_type'].'.inc.php')) { | ||
include 'sla/'.$sla['rtt_type'].'.inc.php'; | ||
} | ||
|
||
?> | ||
</div> | ||
<?php |
Oops, something went wrong.