2017-03-06 16:58:13 -06:00
|
|
|
<?php
|
|
|
|
|
2017-04-12 04:45:12 -05:00
|
|
|
$databases=get_postgres_databases($device['device_id']);
|
|
|
|
|
|
|
|
$link_array = array(
|
|
|
|
'page' => 'device',
|
|
|
|
'device' => $device['device_id'],
|
|
|
|
'tab' => 'apps',
|
|
|
|
'app' => 'postgres',
|
|
|
|
);
|
|
|
|
|
|
|
|
print_optionbar_start();
|
|
|
|
|
|
|
|
echo generate_link('Total', $link_array);
|
|
|
|
echo '| DBs:';
|
|
|
|
$db_int=0;
|
|
|
|
while (isset($databases[$db_int])) {
|
|
|
|
$db=$databases[$db_int];
|
|
|
|
$label=$db;
|
|
|
|
|
|
|
|
if ($vars['database'] == $db) {
|
|
|
|
$label='>>'.$db.'<<';
|
|
|
|
}
|
|
|
|
|
|
|
|
$db_int++;
|
|
|
|
|
|
|
|
$append='';
|
|
|
|
if (isset($databases[$db_int])) {
|
|
|
|
$append=', ';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo generate_link($label, $link_array, array('database'=>$db)).$append;
|
|
|
|
}
|
|
|
|
|
|
|
|
print_optionbar_end();
|
|
|
|
|
2017-03-06 16:58:13 -06:00
|
|
|
$graphs = array(
|
|
|
|
'postgres_backends' => 'Backends',
|
|
|
|
'postgres_cr' => 'Commits & Rollbacks',
|
|
|
|
'postgres_rows' => 'Rows',
|
|
|
|
'postgres_hr' => 'Buffer Hits & Disk Blocks Read',
|
2018-09-05 22:16:13 -04:00
|
|
|
'postgres_index' => 'Indexes',
|
2017-03-06 16:58:13 -06:00
|
|
|
'postgres_sequential' => 'Sequential',
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($graphs as $key => $text) {
|
|
|
|
$graph_type = $key;
|
|
|
|
$graph_array['height'] = '100';
|
|
|
|
$graph_array['width'] = '215';
|
2019-06-23 00:29:12 -05:00
|
|
|
$graph_array['to'] = \LibreNMS\Config::get('time.now');
|
2017-03-06 16:58:13 -06:00
|
|
|
$graph_array['id'] = $app['app_id'];
|
|
|
|
$graph_array['type'] = 'application_'.$key;
|
|
|
|
|
2017-04-12 04:45:12 -05:00
|
|
|
if (isset($vars['database'])) {
|
|
|
|
$graph_array['database']=$vars['database'];
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-03-06 16:58:13 -06:00
|
|
|
echo '<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">'.$text.'</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row">';
|
2019-04-11 23:26:42 -05:00
|
|
|
include 'includes/html/print-graphrow.inc.php';
|
2017-03-06 16:58:13 -06:00
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
echo '</div>';
|
|
|
|
}
|