Asterisk app: add IAX2 peer graphs (#11078)

* Asterisk app: add IAX2 peer graphs

* It's an entirely new graph and will not break existing graphs.
* The asterisk extend script must be updated to provide the appropriate poller data.
* The PR for librenms-agent/snmp/asterisk is here: https://github.com/librenms/librenms-agent/pull/274

* code climate, round 1

* clarified unit text

* code climate, round 2

* changes needed to properly generate test data

* linux_asterisk-v1 test data
This commit is contained in:
Joseph Tingiris
2020-02-03 12:47:27 -05:00
committed by GitHub
parent 051ca6503f
commit 02bc15c206
7 changed files with 208 additions and 29 deletions

View File

@@ -306,6 +306,7 @@ $graphs['asterisk'] = array(
'calls',
'channels',
'sip',
'iax2',
);
echo '<div class="panel panel-default">';
echo '<div class="panel-heading">';

View File

@@ -1,27 +1,23 @@
<?php
$graphs = array(
'asterisk_calls' => 'Asterisk - Calls',
'asterisk_channels' => 'Asterisk - Channels',
'asterisk_sip' => 'Asterisk - SIP'
);
$asterisk_graphs = array(
'asterisk_calls' => 'Asterisk - Calls',
'asterisk_channels' => 'Asterisk - Channels',
'asterisk_sip' => 'Asterisk - SIP Peers',
'asterisk_iax2' => 'Asterisk - IAX2 Peers'
);
foreach ($graphs as $key => $text) {
$graph_type = $key;
foreach ($asterisk_graphs as $asterisk_graphs_key => $asterisk_graphs_value) {
$graph_type = $asterisk_graphs_key;
$graph_array['height'] = '100';
$graph_array['width'] = '215';
$graph_array['id'] = $app['app_id'];
$graph_array['to'] = \LibreNMS\Config::get('time.now');
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = 'application_'.$key;
$graph_array['type'] = 'application_'.$asterisk_graphs_key;
$graph_array['width'] = '215';
echo '<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">'.$text.'</h3>
</div>
<div class="panel-body">
<div class="row">';
<div class="panel-heading"><h3 class="panel-title">'.$asterisk_graphs_value.'</h3></div>
<div class="panel-body"><div class="row">';
include 'includes/html/print-graphrow.inc.php';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div></div></div></div>';
}