2008-08-22 20:07:32 +02:00
< ? php
2021-06-03 15:37:11 +02:00
/**
* Graph viewer .
*
* @ category Reporting
* @ package Pandora FMS
* @ subpackage Community
* @ version 1.0 . 0
* @ license See below
*
* ______ ___ _______ _______ ________
* | __ \ .-----.--.--.--| |.-----.----.-----. | ___ | | | __ |
* | __ /| _ | | _ || _ | _ | _ | | ___ | | __ |
* | ___ | | ___ . _ | __ | __ | _____ || _____ | __ | | ___ . _ | | ___ | | __ | _ | __ | _______ |
*
* ============================================================================
* Copyright ( c ) 2005 - 2021 Artica Soluciones Tecnologicas
* Please see http :// pandorafms . org for full contribution list
* 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 for version 2.
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
* ============================================================================
*/
// Begin.
2021-03-11 15:40:23 +01:00
global $config ;
2019-01-30 16:18:44 +01:00
check_login ();
2007-04-19 20:50:07 +02:00
2021-03-11 15:40:23 +01:00
2019-01-30 16:18:44 +01:00
require_once 'include/functions_custom_graphs.php' ;
2007-04-19 20:50:07 +02:00
2019-01-30 16:18:44 +01:00
$delete_graph = ( bool ) get_parameter ( 'delete_graph' );
$view_graph = ( bool ) get_parameter ( 'view_graph' );
$id_graph = ( int ) get_parameter ( 'id' );
2009-01-12 Esteban Sanchez <estebans@artica.es>
* godmode/agentes/alert_manager.php: Complete rewritten of the alert
system when assigned alerts to an agent.
* pandoradb.sql: New tables for alert system. These are:
talert_commands, talert_actions, talert_templates,
talert_template_modules, talert_template_module_actions. No migration
tool is available yet.
* godmode/alerts/configure_alert_template.php,
godmode/alerts/configure_alert_action.php,
godmode/alerts/alert_templates.php,
godmode/alerts/configure_alert_command.php,
godmode/alerts/alert_actions.php: Added to repository. Administration
interface to new alert system.
* godmode/alerts/modify_alert.php: Deleted from repository.
* godmode/setup/setup.php: Added an example of the date format. Main
table has now percentage width.
* godmode/menu.php, operation/menu.php: Added new alert options.
Removed refr value when it's not neccesary.
* include/styles/pandora.css: Added width to textarea elements. Style
correction and cleanup. Tables doesn't have a odd-even pattern, but
the hovered row now changes its colour. New styles for alert pages.
* include/functions_custom_graphs.php: Added to repository. custom
graphs functions moved here.
* include/functions_incidents.php, include/functions_events.php: Moved
to LGPL. Style comment corrections.
* include/functions_html.php: Documentation style correction. Added
print_input_file() and print_label().
* include/functions_ui.php: Doc style correction.
* operation/reporting/graph_viewer.php: Include new function file with
custom graphs. Use generic functions.
* index.php: Unset pass from POST and REQUEST arrays.
* include/functions_db.php: Some documentation updated to new format.
Added format_array_to_update_sql() to generate SQL sentences for
updates. Style correction.
* godmode/agentes/configurar_agente.php: Variables renamed to have a
meaning.
* extensions/update_manager/main.php: Mark an string translatable.
* extensions/update_manager/lib/libupdate_manager_client.php,
godmode/alerts/configure_alert.php, include/functions.php,
godmode/agentes/module_manager.php, operation/agentes/networkmap.php,
operation/reporting/reporting_viewer.php,
godmode/agentes/manage_config.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1331 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2009-01-12 15:31:01 +01:00
2019-01-30 16:18:44 +01:00
if ( $id_graph !== 0 ) {
$sql = " SELECT * FROM tgraph
WHERE ( private = 0 OR ( private = 1 AND id_user = '".$config[' id_user ']."' ))
2017-04-11 15:30:32 +02:00
AND id_graph = " . $id_graph ;
2019-01-30 16:18:44 +01:00
$control = db_process_sql ( $sql );
if ( ! $control ) {
header ( 'Location: index.php?sec=reporting&sec2=godmode/reporting/graphs' );
}
2017-04-11 15:30:32 +02:00
}
2021-11-23 13:14:56 +01:00
// Delete module SQL code.
2008-10-02 11:19:02 +02:00
if ( $delete_graph ) {
2019-01-30 16:18:44 +01:00
if ( check_acl ( $config [ 'id_user' ], 0 , 'AW' )) {
$res = db_process_sql_delete ( 'tgraph_source' , [ 'id_graph' => $id_graph ]);
if ( $res ) {
$result = ui_print_success_message ( __ ( 'Successfully deleted' ), '' , true );
} else {
$result = ui_print_error_message ( __ ( 'Not deleted. Error deleting data' ), '' , true );
}
$res = db_process_sql_delete ( 'tgraph' , [ 'id_graph' => $id_graph ]);
if ( $res ) {
$result = ui_print_success_message ( __ ( 'Successfully deleted' ), '' , true );
} else {
$result = ui_print_error_message ( __ ( 'Not deleted. Error deleting data' ), '' , true );
}
echo $result ;
} else {
2022-01-20 10:55:23 +01:00
db_pandora_audit ( AUDIT_LOG_ACL_VIOLATION , 'Trying to delete a graph from access graph builder' );
2019-01-30 16:18:44 +01:00
include 'general/noaccess.php' ;
exit ;
}
2007-06-12 13:57:03 +02:00
}
2008-10-02 11:19:02 +02:00
if ( $view_graph ) {
2019-01-30 16:18:44 +01:00
$sql = " SELECT * FROM tgraph_source WHERE id_graph = $id_graph " ;
$sources = db_get_all_rows_sql ( $sql );
$sql = " SELECT * FROM tgraph WHERE id_graph = $id_graph " ;
$graph = db_get_row_sql ( $sql );
$id_user = $graph [ 'id_user' ];
$private = $graph [ 'private' ];
$width = $graph [ 'width' ];
$height = ( $graph [ 'height' ] + count ( $sources ) * 10 );
$zoom = ( int ) get_parameter ( 'zoom' , 0 );
// Increase the height to fix the leyend rise
if ( $zoom > 0 ) {
switch ( $zoom ) {
case 1 :
$width = 500 ;
$height = ( 200 + count ( $sources ) * 15 );
break ;
case 2 :
$width = 650 ;
$height = ( 300 + count ( $sources ) * 10 );
break ;
case 3 :
$width = 770 ;
$height = ( 400 + count ( $sources ) * 5 );
break ;
}
}
// Get different date to search the report.
$date = ( string ) get_parameter ( 'date' , date ( DATE_FORMAT ));
$time = ( string ) get_parameter ( 'time' , date ( TIME_FORMAT ));
$unixdate = strtotime ( $date . ' ' . $time );
$period = ( int ) get_parameter ( 'period' );
if ( ! $period ) {
$period = $graph [ 'period' ];
} else {
$period = $period ;
}
$events = $graph [ 'events' ];
$description = $graph [ 'description' ];
$stacked = ( int ) get_parameter ( 'stacked' , - 1 );
$percentil = ( $graph [ 'percentil' ]) ? 1 : null ;
$check = get_parameter ( 'threshold' , false );
$fullscale = ( $graph [ 'fullscale' ]) ? 1 : null ;
if ( $check == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD ) {
$check = true ;
$stacked = CUSTOM_GRAPH_BULLET_CHART_THRESHOLD ;
}
if ( $stacked == - 1 ) {
$stacked = $graph [ 'stacked' ];
}
if ( $stacked == CUSTOM_GRAPH_BULLET_CHART || $stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD ) {
$height = 50 ;
}
if ( $stacked == CUSTOM_GRAPH_GAUGE ) {
// Use the defined graph height, that's why
// the user can setup graph height.
$height = $graph [ 'height' ];
}
$name = $graph [ 'name' ];
if (( $graph [ 'private' ] == 1 ) && ( $graph [ 'id_user' ] != $id_user )) {
db_pandora_audit (
2022-01-20 10:55:23 +01:00
AUDIT_LOG_ACL_VIOLATION ,
2019-01-30 16:18:44 +01:00
'Trying to access to a custom graph not allowed'
);
include 'general/noaccess.php' ;
exit ;
}
html_print_input_hidden ( 'line_width_graph' , $config [ 'custom_graph_width' ]);
html_print_input_hidden ( 'custom_graph' , 1 );
$url = 'index.php?' . 'sec=reporting&' . 'sec2=operation/reporting/graph_viewer&' . " id= $id_graph & " . 'view_graph=1' ;
$options = [];
2020-10-22 12:00:44 +02:00
if ( check_acl_restricted_all ( $config [ 'id_user' ], $graph [ 'id_group' ], 'RW' )
|| check_acl_restricted_all ( $config [ 'id_user' ], $graph [ 'id_group' ], 'RM' )
) {
2019-01-30 16:18:44 +01:00
$options = [
'graph_list' => [
'active' => false ,
2021-03-11 15:40:23 +01:00
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' . html_print_image (
'images/list.png' ,
true ,
[
'title' => __ ( 'Graph list' ),
'class' => 'invert_filter' ,
]
) . '</a>' ,
2019-01-30 16:18:44 +01:00
],
'main' => [
'active' => false ,
2021-03-11 15:40:23 +01:00
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=main&edit_graph=1&id=' . $id_graph . '">' . html_print_image (
'images/chart.png' ,
true ,
[
'title' => __ ( 'Main data' ),
'class' => 'invert_filter' ,
]
) . '</a>' ,
2019-01-30 16:18:44 +01:00
],
'graph_editor' => [
'active' => false ,
2021-03-11 15:40:23 +01:00
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=' . $id_graph . '">' . html_print_image (
'images/builder.png' ,
true ,
[
'title' => __ ( 'Graph editor' ),
'class' => 'invert_filter' ,
]
) . '</a>' ,
2019-01-30 16:18:44 +01:00
],
];
2020-10-22 12:00:44 +02:00
} else {
$options = [
'graph_list' => [
'active' => false ,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' . html_print_image ( 'images/list.png' , true , [ 'title' => __ ( 'Graph list' )]) . '</a>' ,
],
];
2019-01-30 16:18:44 +01:00
}
$options [ 'view' ][ 'text' ] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=' . $id_graph . '">' . html_print_image (
2021-04-06 18:18:17 +02:00
'images/eye.png' ,
2019-01-30 16:18:44 +01:00
true ,
2021-03-11 15:40:23 +01:00
[
'title' => __ ( 'View graph' ),
'class' => 'invert_filter' ,
]
2019-01-30 16:18:44 +01:00
) . '</a>' ;
$options [ 'view' ][ 'active' ] = true ;
if ( $config [ 'pure' ] == 0 ) {
2021-03-11 15:40:23 +01:00
$options [ 'screen' ][ 'text' ] = " <a href=' $url &pure=1'> " . html_print_image (
'images/full_screen.png' ,
true ,
[
'title' => __ ( 'Full screen mode' ),
'class' => 'invert_filter' ,
]
) . '</a>' ;
2019-01-30 16:18:44 +01:00
} else {
2021-03-11 15:40:23 +01:00
$options [ 'screen' ][ 'text' ] = " <a href=' $url &pure=0'> " . html_print_image (
'images/normal_screen.png' ,
true ,
[
'title' => __ ( 'Back to normal mode' ),
'class' => 'invert_filter' ,
]
) . '</a>' ;
2019-01-30 16:18:44 +01:00
2021-11-23 13:14:56 +01:00
// In full screen, the manage options are not available.
2019-01-30 16:18:44 +01:00
$options = [
'view' => $options [ 'view' ],
'screen' => $options [ 'screen' ],
];
}
2021-11-30 15:56:40 +01:00
if ( ! is_ajax ()) {
// Header.
ui_print_standard_header (
$graph [ 'name' ],
'images/chart.png' ,
false ,
'' ,
false ,
$options ,
2021-06-03 15:37:11 +02:00
[
2021-11-30 15:56:40 +01:00
[
'link' => '' ,
'label' => __ ( 'Reporting' ),
],
[
'link' => '' ,
'label' => __ ( 'Custom graphs' ),
],
]
);
}
2019-01-30 16:18:44 +01:00
$width = null ;
$height = null ;
$params = [
'period' => $period ,
'width' => $width ,
'height' => $height ,
'date' => $unixdate ,
'percentil' => $percentil ,
'fullscale' => $fullscale ,
];
2021-11-23 13:14:56 +01:00
if ( $stacked === CUSTOM_GRAPH_AREA || $stacked === CUSTOM_GRAPH_STACKED_AREA ) {
$params [ 'type_graph' ] = 'area' ;
} else if ( $stacked === CUSTOM_GRAPH_LINE || $stacked === CUSTOM_GRAPH_STACKED_LINE ) {
$params [ 'type_graph' ] = 'line' ;
}
2019-01-30 16:18:44 +01:00
$params_combined = [
'stacked' => $stacked ,
'id_graph' => $id_graph ,
];
$graph_return = graphic_combined_module (
false ,
$params ,
$params_combined
);
2021-11-30 15:56:40 +01:00
if ( is_ajax ()) {
echo $graph_return ;
return ;
}
2019-01-30 16:18:44 +01:00
if ( $graph_return ) {
2021-11-30 15:56:40 +01:00
echo " <table id='graph-container' class='databox filters' cellpadding='0' cellspacing='0' width='100%'> " ;
2019-01-30 16:18:44 +01:00
echo '<tr><td>' ;
2021-11-30 15:56:40 +01:00
if ( ! is_ajax ()) {
2021-12-02 08:52:33 +01:00
echo '<div id="spinner_loading" class="loading invisible" style="display:flex;flex-direction:column-reverse;justify-content:center;align-items:center">' ;
echo html_print_image ( 'images/spinner.gif' , true , [ 'width' => '20px' ]);
2021-11-30 15:56:40 +01:00
echo __ ( 'Loading' ) . '…' ;
echo '</div>' ;
}
2020-03-26 12:29:38 +01:00
if ( $stacked == CUSTOM_GRAPH_VBARS ) {
2021-03-11 15:40:23 +01:00
echo '<div class="w100p height_600px">' ;
2021-12-02 08:52:33 +01:00
echo '<div id="div-container" class="w100p height_600px">' ;
} else {
echo '<div id="div-container">' ;
2020-03-26 12:29:38 +01:00
}
2019-01-30 16:18:44 +01:00
echo $graph_return ;
2021-12-02 08:52:33 +01:00
echo '</div>' ;
2019-01-30 16:18:44 +01:00
if ( $stacked == CUSTOM_GRAPH_VBARS ) {
2021-12-02 08:52:33 +01:00
echo '</div>' ;
2019-01-30 16:18:44 +01:00
}
echo '</td></tr></table>' ;
} else {
ui_print_info_message ([ 'no_close' => true , 'message' => __ ( 'No data.' ) ]);
}
if ( $stacked == CUSTOM_GRAPH_BULLET_CHART_THRESHOLD ) {
$stacked = 4 ;
}
$period_label = human_time_description_raw ( $period );
2021-12-21 15:22:22 +01:00
echo '<form method="POST" action="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=$id_graph">' ;
2021-03-11 15:40:23 +01:00
echo " <table class='databox filters w100p' cellpadding='4' cellspacing='4'> " ;
2019-01-30 16:18:44 +01:00
echo '<tr>' ;
echo '<td>' ;
2021-12-21 15:22:22 +01:00
echo '<b>' . __ ( 'Date' ) . '</b>' ;
2019-01-30 16:18:44 +01:00
echo '</td>' ;
echo '<td>' ;
echo html_print_input_text ( 'date' , $date , '' , 12 , 10 , true ) . ' ' ;
echo '</td>' ;
echo '<td>' ;
echo html_print_input_text ( 'time' , $time , '' , 7 , 7 , true ) . ' ' ;
echo '</td>' ;
echo " <td class='datos'> " ;
echo '<b>' . __ ( 'Time range' ) . '</b>' ;
echo '</td>' ;
echo " <td class='datos'> " ;
echo html_print_extended_select_for_time ( 'period' , $period , '' , '' , '0' , 10 , true );
echo '</td>' ;
echo " <td class='datos'> " ;
$stackeds = [];
$stackeds [ 0 ] = __ ( 'Graph defined' );
$stackeds [ CUSTOM_GRAPH_AREA ] = __ ( 'Area' );
$stackeds [ CUSTOM_GRAPH_STACKED_AREA ] = __ ( 'Stacked area' );
$stackeds [ CUSTOM_GRAPH_LINE ] = __ ( 'Line' );
$stackeds [ CUSTOM_GRAPH_STACKED_LINE ] = __ ( 'Stacked line' );
$stackeds [ CUSTOM_GRAPH_BULLET_CHART ] = __ ( 'Bullet chart' );
$stackeds [ CUSTOM_GRAPH_GAUGE ] = __ ( 'Gauge' );
$stackeds [ CUSTOM_GRAPH_HBARS ] = __ ( 'Horizontal Bars' );
$stackeds [ CUSTOM_GRAPH_VBARS ] = __ ( 'Vertical Bars' );
$stackeds [ CUSTOM_GRAPH_PIE ] = __ ( 'Pie' );
html_print_select ( $stackeds , 'stacked' , $stacked , '' , '' , - 1 , false , false );
echo '</td>' ;
echo " <td class='datos'> " ;
2021-03-11 15:40:23 +01:00
echo " <div class='float-left' id='thresholdDiv' name='thresholdDiv'> <b> " . __ ( 'Equalize maxiddmum thresholds' ) . '</b>' . ui_print_help_tip ( __ ( 'If an option is selected, all graphs will have the highest value from all modules included in the graph as a maximum threshold' ), true );
2019-01-30 16:18:44 +01:00
html_print_checkbox ( 'threshold' , CUSTOM_GRAPH_BULLET_CHART_THRESHOLD , $check , false , false , '' , false );
echo '</div>' ;
echo '</td>' ;
echo " <td class='datos'> " ;
$zooms = [];
$zooms [ 0 ] = __ ( 'Graph defined' );
$zooms [ 1 ] = __ ( 'Zoom x1' );
$zooms [ 2 ] = __ ( 'Zoom x2' );
$zooms [ 3 ] = __ ( 'Zoom x3' );
html_print_select ( $zooms , 'zoom' , $zoom , '' , '' , 0 );
echo '</td>' ;
echo " <td class='datos'> " ;
2021-11-30 15:56:40 +01:00
echo " <input id='submit-refresh' type=submit value=' " . __ ( 'Refresh' ) . " ' class='sub upd'> " ;
2019-01-30 16:18:44 +01:00
echo '</td>' ;
echo '</tr>' ;
echo '</table>' ;
echo '</form>' ;
2021-12-21 15:22:22 +01:00
2019-01-30 16:18:44 +01:00
/*
We must add javascript here . Otherwise , the date picker won ' t
2021-12-21 15:22:22 +01:00
work if the date is not correct because php is returning .
*/
2019-01-30 16:18:44 +01:00
ui_include_time_picker ();
ui_require_jquery_file ( 'ui.datepicker-' . get_user_language (), 'include/javascript/i18n/' );
ui_require_jquery_file ( '' );
?>
< script language = " javascript " type = " text/javascript " >
2021-12-21 15:22:22 +01:00
2019-01-30 16:18:44 +01:00
$ ( document ) . ready ( function () {
2021-12-02 08:52:33 +01:00
$ ( " #spinner_loading " ) . hide ();
2019-01-30 16:18:44 +01:00
$ ( " #loading " ) . slideUp ();
$ ( " #text-time " ) . timepicker ({
showSecond : true ,
timeFormat : '<?php echo TIME_FORMAT_JS; ?>' ,
timeOnlyTitle : '<?php echo __(' Choose time '); ?>' ,
timeText : '<?php echo __(' Time '); ?>' ,
hourText : '<?php echo __(' Hour '); ?>' ,
minuteText : '<?php echo __(' Minute '); ?>' ,
secondText : '<?php echo __(' Second '); ?>' ,
currentText : '<?php echo __(' Now '); ?>' ,
closeText : '<?php echo __(' Close '); ?>' });
2021-12-21 15:22:22 +01:00
2019-01-30 16:18:44 +01:00
$ . datepicker . setDefaults ( $ . datepicker . regional [ " <?php echo get_user_language(); ?> " ]);
2021-12-21 15:22:22 +01:00
2019-01-30 16:18:44 +01:00
$ ( " #text-date " ) . datepicker ({
dateFormat : " <?php echo DATE_FORMAT_JS; ?> " ,
changeMonth : true ,
changeYear : true ,
showAnim : " slideDown " });
if ( $ ( " #stacked " ) . val () == '4' ) {
$ ( " #thresholdDiv " ) . show ();
} else {
$ ( " #thresholdDiv " ) . hide ();
}
2021-12-21 15:22:22 +01:00
$ ( " #submit-refresh " ) . click ( function ( e ) {
2021-11-30 15:56:40 +01:00
e . preventDefault ();
2021-12-02 08:52:33 +01:00
$ ( " #spinner_loading " ) . show ();
2021-11-30 15:56:40 +01:00
var data = {
page : " operation/reporting/graph_viewer " ,
view_graph : 1 ,
id : '<?php echo $id_graph; ?>' ,
2021-12-21 15:22:22 +01:00
zoom : $ ( '#zoom' ) . val (),
date : $ ( '#text-date' ) . val (),
time : $ ( '#text-time' ) . val (),
period : $ ( 'select[id^=period][id$=select]' ) . val (),
stacked : $ ( '#stacked' ) . val (),
}
if ( data [ 'stacked' ] == 4 && $ ( '#checkbox-threshold' ) . is ( ':checked' )) {
data [ 'threshold' ] = 1 ;
2021-11-30 15:56:40 +01:00
}
$ . ajax ({
type : " POST " ,
url : " ajax.php " ,
dataType : " html " ,
data : data ,
success : function ( data ) {
2021-12-02 08:52:33 +01:00
document . getElementById ( " div-container " ) . innerHTML = " " ;
$ ( " #spinner_loading " ) . hide ();
$ ( " #div-container " ) . append ( data );
2021-11-30 15:56:40 +01:00
},
error : function ( data ) {
console . error ( " Fatal error " )
}
});
});
2019-01-30 16:18:44 +01:00
});
$ ( " #stacked " ) . change ( function (){
if ( $ ( this ) . val () == '4' ) {
$ ( " #thresholdDiv " ) . show ();
$ ( " .stacked " ) . show ();
} else {
$ ( " [name=threshold] " ) . prop ( " checked " , false );
$ ( " .stacked " ) . show ();
$ ( " #thresholdDiv " ) . hide ();
}
});
</ script >
2021-12-21 15:22:22 +01:00
2019-01-30 16:18:44 +01:00
< ? php
$datetime = strtotime ( $date . ' ' . $time );
$report [ 'datetime' ] = $datetime ;
if ( $datetime === false || $datetime == - 1 ) {
ui_print_error_message ( __ ( 'Invalid date selected' ));
return ;
}
return ;
2007-04-19 20:50:07 +02:00
}
2010-02-19 Sancho Lerena <slerena@artica.es>
* functions_events.php: Fixed typo (switched meaning) in two labels.
* include/styles/pandora.css: Changed background color of th default style.
* include/functions_reporting.php: Improved function get_group_stats(). Now
supports stats from batch-mode and get realtime stats in a more efficient
way. Fixed get_fired_alerts_reporting_table() to avoid problems in external
reporting (PDF & XML).
* include/functions_servers.php: get_server_performance() now uses batch mode
stats reporting, and improved also the realtime stats generation. Same with
function get_server_info().
* include/functions_config.php: Added new config tokens (not fully
implemented yet) for event, trap, strings and audit automatic purge.
* include/functions_ui.php: Added new print_page_header() function to set
the new standard header in all pages, using the "tabbed" format to show
the title, subtitle and other options like help, or custom-tabs for the page
* pandoradb.sql: Added tserver.stat_utimestamp field. Added indexes to
tsession table. Fixed typo in field name in tgroup_stat: agents_uknown to
agents_unknown.
* extensions/ext_backup: New directory to place "deleted" extensions.
* extensions/dbmanager/dbmanager.css: Table names now are in it's original
lowercase/uppercase format.
* extensions/dbmanager.php: Updated headers, and now return "empty" when
a search is empty, instead "error" as before.
* extensions/users_connected.php
extensions/module_groups.php
extensions/plugin_registration.php
extensions/pandora_logs.php
operation/incidents/incident.php
operation/snmpconsole/snmp_view.php
operation/users/user.php
operation/users/user_edit.php
godmode/agentes/planned_downtime.php
operation/events/events.php
operation/visual_console/index.php
operation/agentes/estado_generalagente.php
operation/agentes/estado_agente.php
operation/agentes/exportdata.php
operation/agentes/ver_agente.php
operation/agentes/status_monitor.php
operation/agentes/alerts_status.php
operation/users/user_statistics.php: Added new header format.
* operation/agentes/estado_grupo.php: Removed old group view.
* operation/agentes/tactical.php: Adapted to use new realtime/batch
statistical system. Placed events above server info. Showing only pending
events and other minor changes.
* operation/agentes/group_view.php: NEW screen, replacing old one. Probably
most ugly, but much more useful than before.
* operation/agentes/networkmap.php: Added title.
* operation/messages/message.php: Added title and adding some exists in
code was missing before.
* operation/reporting/reporting_viewer.php: Added title.
* operation/reporting/graph_viewer.php: Added title.
* operation/reporting/custom_reporting.php: Added title.
* operation/servers/view_server.php:
* operation/menu.php: Replaced old group view with new (this has english
name). Removed autorefresh "by default" in server view.
* extras/pandoradb_migrate_v3.0_to_v3.1.sql: Fixed typo.
* extras/pandora_diag.php: Minor changes, removed some info and added other.
* general/logon_ok.php: Minor aesthetic changes.
* general/header.php: Fixed missing ";"
* operation/extensions.php,
godmode/extensions.php: Added support for delete extensions.
* godmode/menu.php: New setup items.
* godmode/setup/setup.php,
godmode/setup/performance.php,
godmode/setup/setup_visuals.php: Reordered setup options, new setup section
"Performance", added new performance options to set "realtime" statistics
or "batchmode" with it's own interval. Some setup info is now shared with
the servers (but it it's any change in setup, servers should be restarted
anyway).
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2390 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2010-02-19 16:16:03 +01:00
2021-12-21 15:22:22 +01:00
// Header.
2021-03-11 15:40:23 +01:00
ui_print_page_header ( __ ( 'Reporting' ) . ' » ' . __ ( 'Custom graph viewer' ), 'images/op_reporting.png' , false , '' , false , '' );
2019-01-30 16:18:44 +01:00
$graphs = custom_graphs_get_user ();
if ( ! empty ( $graphs )) {
$table = new stdClass ();
$table -> width = '100%' ;
$tale -> class = 'databox_frame' ;
$table -> align = [];
$table -> align [ 2 ] = 'center' ;
$table -> head = [];
$table -> head [ 0 ] = __ ( 'Graph name' );
$table -> head [ 1 ] = __ ( 'Description' );
$table -> data = [];
foreach ( $graphs as $graph ) {
$data = [];
$data [ 0 ] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id=' . $graph [ 'id_graph' ] . '">' . $graph [ 'name' ] . '</a>' ;
$data [ 1 ] = $graph [ 'description' ];
array_push ( $table -> data , $data );
}
html_print_table ( $table );
} else {
echo " <div class='nf'> " . __ ( 'There are no defined reportings' ) . '</div>' ;
2007-04-19 20:50:07 +02:00
}