77 lines
1.7 KiB
PHP
Raw Normal View History

add app for getting status of TCP connections for specified services (#8090) * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * remove dump of get_portactivity_ports function added during rebase * update to the current json_app_get * add portactivity snmprec * add the portactivity test data * whoops bad merge when rebasing... fix * minor formatting cleanup and add a missing comma * fix some odditities with what one of the tests is doing * whoops... include the use for the exception * set the response to okay * attempt to make snmpsim array check happy again * the json now lints * more making metric testing happy * one more update to make travis-ci happy * now flattens arrays also add array_flatten * rename array_flatten to data_flatten as pre-commit chokes on it as laravel has something similarly named * go through and properly add all the metrics * tested with the newest one and it works * whoops, clean up json and remove prototype that was used when putting it together * doh! make it happy with laravel now * see if a minor changing in formatting for the numbers makes the polling unit test happy * order them properly * remove a comma * a few more minor fixes
2018-11-22 09:05:38 -06:00
<?php
$ports=get_portactivity_ports($device['device_id']);
sort($ports);
$link_array = array(
'page' => 'device',
'device' => $device['device_id'],
'tab' => 'apps',
'app' => 'portactivity',
);
print_optionbar_start();
echo 'Ports:';
$ports_int=0;
while (isset($ports[$ports_int])) {
$port=$ports[$ports_int];
$label=$ports[$ports_int];
if ($vars['port'] == $port) {
$label='>>'.$port.'<<';
}
$ports_int++;
$append='';
if (isset($ports[$ports_int])) {
$append=', ';
}
echo generate_link($label, $link_array, array('port'=>$port)).$append;
}
print_optionbar_end();
if (!isset($vars['port'])) {
echo "Please select a port.\n";
$graphs = array(
# No useful bits to display with out selecting anything.
);
} else {
$graphs = array(
'portactivity_totals'=>'Total Connections',
'portactivity_total_details'=>'Total Connections Details',
'portactivity_to'=>'Connections To Server',
'portactivity_from'=>'Connections From Server',
);
}
foreach ($graphs as $key => $text) {
$graph_type = $key;
$graph_array['height'] = '100';
$graph_array['width'] = '215';
$graph_array['to'] = \LibreNMS\Config::get('time.now');
add app for getting status of TCP connections for specified services (#8090) * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * remove dump of get_portactivity_ports function added during rebase * update to the current json_app_get * add portactivity snmprec * add the portactivity test data * whoops bad merge when rebasing... fix * minor formatting cleanup and add a missing comma * fix some odditities with what one of the tests is doing * whoops... include the use for the exception * set the response to okay * attempt to make snmpsim array check happy again * the json now lints * more making metric testing happy * one more update to make travis-ci happy * now flattens arrays also add array_flatten * rename array_flatten to data_flatten as pre-commit chokes on it as laravel has something similarly named * go through and properly add all the metrics * tested with the newest one and it works * whoops, clean up json and remove prototype that was used when putting it together * doh! make it happy with laravel now * see if a minor changing in formatting for the numbers makes the polling unit test happy * order them properly * remove a comma * a few more minor fixes
2018-11-22 09:05:38 -06:00
$graph_array['id'] = $app['app_id'];
$graph_array['type'] = 'application_'.$key;
if (isset($vars['port'])) {
$graph_array['port']=$vars['port'];
}
echo '<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">'.$text.'</h3>
</div>
<div class="panel-body">
<div class="row">';
include 'includes/html/print-graphrow.inc.php';
add app for getting status of TCP connections for specified services (#8090) * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * add the poller for portactivity * add the ability to get monitor ports for portactivity * add the graphs for displaying stuff for the portactivity app * add the portactivity app page * update the docs for Portactivity * remove extra line * minor doc update for Portactivity * add update_application line * convert to use json_app_get * convert curly brackets to square * style fix * remote error, errorString, and version after they stop being important so they are not processed * add alert rule examples * remove dump of get_portactivity_ports function added during rebase * update to the current json_app_get * add portactivity snmprec * add the portactivity test data * whoops bad merge when rebasing... fix * minor formatting cleanup and add a missing comma * fix some odditities with what one of the tests is doing * whoops... include the use for the exception * set the response to okay * attempt to make snmpsim array check happy again * the json now lints * more making metric testing happy * one more update to make travis-ci happy * now flattens arrays also add array_flatten * rename array_flatten to data_flatten as pre-commit chokes on it as laravel has something similarly named * go through and properly add all the metrics * tested with the newest one and it works * whoops, clean up json and remove prototype that was used when putting it together * doh! make it happy with laravel now * see if a minor changing in formatting for the numbers makes the polling unit test happy * order them properly * remove a comma * a few more minor fixes
2018-11-22 09:05:38 -06:00
echo '</div>';
echo '</div>';
echo '</div>';
}