2009-08-05 Sancho Lerena <slerena@artica.es>
* include/styles/pandora.css: Adjusted head and removed small heigh problems in some tabs (agent and search sections). * include/javascript/pandora.js: winopeng call for module graph is now widther. * index.php: Now defined a default search for agents(). * general/header.php: Redesign of header. * general/pandora_help.php: Some visual changes in background and footer. * godmode/modificar_agente.php: Create button replaced. * fgraph.php: Fixed the string graphs and fixed a lot other issues. * include/functions_visual_map.php: Module images are shown in pure mode (without title) and adding the title defined by user in map definition. * include/pandora_graph.php: Added default colors (up to 9) for combined graphs. * include/pchart_graph.php: Created a new method to render datetime data in X axis legend. Reformatted combined and static graph to remove transparent background, title and other issues reported. Also combined stack graph now works adding data from one series to another. * include/help/en/help_agent_status.php: new help file for agent status. * include/pChart/pChart.class: Added new method for format datetime in two lines with full date and time information. * operation/search_results.php: reformatted tabs. * operation/agentes/estado_agente.php: removed status information legend and added a help icon. * godmode/reporting/graph_builder.php, operation/reporting/graph_viewer.php: Added new graph mode: stacked line. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1829 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
6ef05e688f
commit
99812a16f0
|
@ -1,3 +1,46 @@
|
|||
|
||||
2009-08-05 Sancho Lerena <slerena@artica.es>
|
||||
|
||||
* include/styles/pandora.css: Adjusted head and removed small heigh
|
||||
problems in some tabs (agent and search sections).
|
||||
|
||||
* include/javascript/pandora.js: winopeng call for module graph is now
|
||||
widther.
|
||||
|
||||
* index.php: Now defined a default search for agents().
|
||||
|
||||
* general/header.php: Redesign of header.
|
||||
|
||||
* general/pandora_help.php: Some visual changes in background and footer.
|
||||
|
||||
* godmode/modificar_agente.php: Create button replaced.
|
||||
|
||||
* fgraph.php: Fixed the string graphs and fixed a lot other issues.
|
||||
|
||||
* include/functions_visual_map.php: Module images are shown in pure mode
|
||||
(without title) and adding the title defined by user in map definition.
|
||||
|
||||
* include/pandora_graph.php: Added default colors (up to 9) for combined
|
||||
graphs.
|
||||
|
||||
* include/pchart_graph.php: Created a new method to render datetime
|
||||
data in X axis legend. Reformatted combined and static graph to remove
|
||||
transparent background, title and other issues reported. Also combined
|
||||
stack graph now works adding data from one series to another.
|
||||
|
||||
* include/help/en/help_agent_status.php: new help file for agent status.
|
||||
|
||||
* include/pChart/pChart.class: Added new method for format datetime in two
|
||||
lines with full date and time information.
|
||||
|
||||
* operation/search_results.php: reformatted tabs.
|
||||
|
||||
* operation/agentes/estado_agente.php: removed status information legend
|
||||
and added a help icon.
|
||||
|
||||
* godmode/reporting/graph_builder.php,
|
||||
operation/reporting/graph_viewer.php: Added new graph mode: stacked line.
|
||||
|
||||
2009-07-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/search_results.php: fix a query for search alerts. And changed
|
||||
|
|
|
@ -17,7 +17,7 @@ require_once ("include/functions_messages.php");
|
|||
?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" style="margin:0px; padding:0px;" border="0">
|
||||
<tr>
|
||||
<td><div id="pandora_logo_header"></div></td>
|
||||
<td rowspan=2><div id="pandora_logo_header"></div></td>
|
||||
<td width="20%">
|
||||
<img src="images/user_<?=((is_user_admin ($config["id_user"]) == 1) ? 'suit' : 'green' );?>.png" class="bot" alt="user" />
|
||||
<a href="index.php?sec=usuarios&sec2=operation/users/user_edit" class="white"><?=__('You are');?> [<b><?=$config["id_user"];?></b>]</a>
|
||||
|
@ -35,14 +35,11 @@ require_once ("include/functions_messages.php");
|
|||
echo '</a>';
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<br />
|
||||
<a class="white_bold" href="index.php?bye=bye"><img src="images/log-out.png" alt="<?=__('Logout');?>" class="bot" /> <?=__('Logout');?></a>
|
||||
|
||||
<a class="white_bold" href="index.php?bye=bye"><img src="images/log-out.png" alt="<?=__('Logout');?>" class="bot" /></a>
|
||||
</td>
|
||||
|
||||
<td width="20%">
|
||||
<a class="white_bold" href="index.php?sec=main"><img src="images/information.png" alt="info" class="bot" /><?=__('General information');?></a>
|
||||
<br />
|
||||
<br />
|
||||
<a class="white_bold" href="index.php?sec=estado_server&sec2=operation/servers/view_server&refr=60">
|
||||
<?php
|
||||
$servers["all"] = (int) get_db_value ('COUNT(id_server)','tserver');
|
||||
|
@ -93,26 +90,21 @@ require_once ("include/functions_messages.php");
|
|||
unset ($values);
|
||||
echo '</span>';
|
||||
}
|
||||
?>
|
||||
<br />
|
||||
<br />
|
||||
<a class="white_bold" href="index.php?sec=eventos&sec2=operation/events/events&refr=5">
|
||||
<img src="images/lightning_go.png" alt="lightning_go" class="bot" /> <?=__('Events');?>
|
||||
</a>
|
||||
</td>
|
||||
<td width="20%">
|
||||
<div id="head_r"><span id="logo_text1">Pandora</span> <span id="logo_text2">FMS</span></div>
|
||||
<?php
|
||||
if (file_exists (ENTERPRISE_DIR."/load_enterprise.php"))
|
||||
echo '<div id="logo_text3">Enterprise</div>';
|
||||
else
|
||||
echo '<div id="logo_text3">OpenSource</div>';
|
||||
?>
|
||||
echo "</td>";
|
||||
echo "<td width='20%' rowspan=2>";
|
||||
echo "<a href='index.php?sec=main'>";
|
||||
echo "<div id='head_r'><span id='logo_text1'>Pandora</span> <span id='logo_text2'>FMS</span></div>";
|
||||
if (file_exists (ENTERPRISE_DIR."/load_enterprise.php"))
|
||||
echo '<div id="logo_text3">Enterprise</div>';
|
||||
else
|
||||
echo '<div id="logo_text3">OpenSource</div>';
|
||||
echo "</A>";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="5" style="padding: 0; height: 20px;">
|
||||
<form method="get" style="" valign="middle">
|
||||
<td colspan=2>
|
||||
<form method="get" style="" valign="middle" name="quicksearch">
|
||||
<script type="text/javascript" language="javascript">
|
||||
var fieldKeyWordEmpty = true;
|
||||
</script>
|
||||
|
@ -125,36 +117,13 @@ require_once ("include/functions_messages.php");
|
|||
else echo "value='" . $config['search_keywords'] . "'";
|
||||
?>
|
||||
onfocus="javascript: if (fieldKeyWordEmpty) $('#keywords').val('');"
|
||||
size="119" style="background: white url('images/lupa_15x15.png') no-repeat left; padding: 0; padding-left:15px; margin: 0; width: 70%; margin-left: 2px;" />
|
||||
<?php
|
||||
if (isset($config['search_category']))
|
||||
$selected = $config['search_category'];
|
||||
else
|
||||
$selected = 'all';
|
||||
$values = array (
|
||||
//'adsf' => ((strlen(__("Search")) > 12) ? (substr(__("0123456789AB"), 0, 12) . "…") : __("0123456789AB")),
|
||||
'all' => ((strlen(__("All")) > 12) ? (substr(__("All"), 0, 12) . "…") : __("All")),
|
||||
'users' => ((strlen(__("Users")) > 12) ? (substr(__("Users"), 0, 12) . "…") : __("Users")),
|
||||
'alerts' => ((strlen(__("Alerts")) > 12) ? (substr(__("Alerts"), 0, 12) . "…") : __("Alerts")),
|
||||
'reports' => ((strlen(__("Reports")) > 12) ? (substr(__("Reports"), 0, 12) . "…") : __("Reports"))
|
||||
);
|
||||
|
||||
//INI SECURITY ACL
|
||||
if (check_acl ($config['id_user'], 0, "AW") || check_acl ($config['id_user'], 0, "AR")) {
|
||||
$values['agents'] = ((strlen(__("Agents")) > 12) ? (substr(__("Agents"), 0, 12) . "…") : __("Agents"));
|
||||
$values['graphs'] = ((strlen(__("Graphs")) > 12) ? (substr(__("Graphs"), 0, 12) . "…") : __("Graphs"));
|
||||
}
|
||||
if (give_acl ($config["id_user"], 0, "AR"))
|
||||
$values['maps'] = ((strlen(__("Maps")) > 12) ? (substr(__("Maps"), 0, 12) . "…") : __("Maps"));;
|
||||
//END SECURITY ACL
|
||||
|
||||
print_select_style ($values, 'search_category', $selected, "min-width: 12em;");
|
||||
?>
|
||||
<input id="submit-srcbutton" name="head_search_keywords"
|
||||
value="<?=((strlen(__("Search")) > 12) ? (substr(__("0123456789ABCD"), 0, 12) . "…") : __("Search")); ?>"
|
||||
class="sub" type="submit" style="min-width: 12em; height: 23px;" />
|
||||
</form>
|
||||
</td>
|
||||
size="100" style="background: white url('images/lupa_15x15.png') no-repeat right; padding: 0; padding-left:0px; margin: 0; width: 90%; height: 19px; margin-bottom: 5px; margin-left: 2px;" />
|
||||
<!-- onClick="javascript: document.quicksearch.submit()" -->
|
||||
<input type='hidden' name='head_search_keywords' value='abc'>
|
||||
</form>
|
||||
<td>
|
||||
<a class="white_bold" href="index.php?sec=eventos&sec2=operation/events/events&refr=5"><img src="images/lightning_go.png" alt="lightning_go" class="bot"> Events</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
|
|
|
@ -19,7 +19,7 @@ require_once ("../include/functions.php");
|
|||
|
||||
echo '<html><head><title>'.__('Pandora FMS help system').'</title></head>';
|
||||
echo '<link rel="stylesheet" href="../include/styles/'.$config['style'].'.css" type="text/css">';
|
||||
echo '<body>';
|
||||
echo '<body style="background-color: #fff;">';
|
||||
|
||||
$id = get_parameter ('id');
|
||||
|
||||
|
@ -62,7 +62,7 @@ echo '<div style="font-size: 12px; margin-left: 30px; margin-right:25px;">';
|
|||
require_once ($help_file);
|
||||
echo '</div>';
|
||||
echo '<br /><br /><hr width="100%" size="1" />';
|
||||
echo '<div style="font-family: verdana, arial; font-size: 11px;">';
|
||||
echo '<div style="background-color: #CCC; font-family: verdana, arial; font-size: 11px;">';
|
||||
include ('footer.php');
|
||||
?>
|
||||
</body>
|
||||
|
|
|
@ -185,7 +185,7 @@ if ($id_agente) {
|
|||
echo '<div id="menu_tab_frame"><div id="menu_tab_left"><ul class="mn">';
|
||||
echo '<li class="nomn"><a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">';
|
||||
print_image ("images/setup.png", false, $img_style);
|
||||
echo ' '.mb_substr (get_agent_name ($id_agente), 0, 21).'</a>';
|
||||
echo ' '.mb_substr(get_agent_name ($id_agente), 0, 15) .'</a>';
|
||||
echo "</li></ul></div>";
|
||||
|
||||
echo '<div id="menu_tab"><ul class="mn"><li class="nomn">';
|
||||
|
|
|
@ -63,7 +63,7 @@ if (isset($_POST["ag_group"])){
|
|||
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
|
||||
}
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox' width=700><tr>";
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox' width=770><tr>";
|
||||
echo "<td valign='top'>".__('Group')."</td>";
|
||||
echo "<td valign='top'>";
|
||||
echo "<select name='ag_group' onChange='javascript:this.form.submit();'
|
||||
|
@ -99,6 +99,12 @@ echo "<input type=text name='search' size='15' >";
|
|||
echo "</td><td valign='top'>";
|
||||
echo "<input name='srcbutton' type='submit' class='sub' value='".__('Search')."'>";
|
||||
echo "</form>";
|
||||
echo "<td>";
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
print_input_hidden ('new_agent', 1);
|
||||
print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
echo "</form>";
|
||||
|
||||
echo "</td></table>";
|
||||
|
||||
$search_sql = '';
|
||||
|
@ -148,13 +154,6 @@ echo "<div style='height: 20px'> </div>";
|
|||
|
||||
if ($agents !== false) {
|
||||
|
||||
// Create agent button
|
||||
echo "<table width='95%'><tr><td align='right'>";
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
print_input_hidden ('new_agent', 1);
|
||||
print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
echo "</form></td></tr></table>";
|
||||
|
||||
echo "<table cellpadding='4' id='agent_list' cellspacing='4' width='95%' class='databox'>";
|
||||
echo "<th>".__('Agent name')."</th>";
|
||||
echo "<th title='".__('Remote agent configuration')."'>".__('R')."</th>";
|
||||
|
@ -184,7 +183,7 @@ if ($agents !== false) {
|
|||
echo '<span class="left">';
|
||||
echo "<strong><a href='index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=main&
|
||||
id_agente=".$agent["id_agente"]."'>".substr(strtoupper($agent["nombre"]),0,20)."</a></strong>";
|
||||
id_agente=".$agent["id_agente"]."'>".substr(salida_limpia($agent["nombre"]),0,20)."</a></strong>";
|
||||
if ($agent["disabled"]) {
|
||||
echo "</em>";
|
||||
}
|
||||
|
@ -241,6 +240,7 @@ if ($agents !== false) {
|
|||
}
|
||||
|
||||
// Create agent button
|
||||
echo '<a name="bottom">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
print_input_hidden ('new_agent', 1);
|
||||
print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
|
|
|
@ -396,6 +396,7 @@ echo "<option value=21600>"."6 ".__('hours')."</option>";
|
|||
echo "<option value=43200>"."12 ".__('hours')."</option>";
|
||||
echo "<option value=86400>".__('Last day')."</option>";
|
||||
echo "<option value=172800>"."2 ".__('days')."</option>";
|
||||
echo "<option value=345600>"."4 ".__('days')."</option>";
|
||||
echo "<option value=604800>".__('Last week')."</option>";
|
||||
echo "<option value=1296000>"."15 ".__('15 days')."</option>";
|
||||
echo "<option value=2592000>".__('Last month')."</option>";
|
||||
|
@ -425,6 +426,7 @@ echo "<td class='datos2'>";
|
|||
$stackeds[0] = __('Area');
|
||||
$stackeds[1] = __('Stacked area');
|
||||
$stackeds[2] = __('Line');
|
||||
$stackeds[3] = __('Stacked line');
|
||||
print_select ($stackeds, 'stacked', $stacked, '', '', 0);
|
||||
echo "</td>";
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
|
||||
|
||||
if ($config) {
|
||||
if (isset($config)) {
|
||||
require_once ($config['homedir'].'/include/config.php');
|
||||
require_once ($config['homedir'].'/include/pandora_graph.php');
|
||||
require_once ($config['homedir'].'/include/functions_fsgraph.php');
|
||||
|
@ -277,7 +277,7 @@ function graphic_combined_module ($module_list, $weight_list, $period, $width, $
|
|||
$engine->data = &$real_data;
|
||||
$engine->legend = $module_list_name;
|
||||
$engine->fontpath = $config['fontpath'];
|
||||
$engine->title = ' '.strtoupper ($nombre_agente)." - ".__('Module').' '.$title;
|
||||
$engine->title = "";
|
||||
$engine->subtitle = ' '.__('Period').': '.$title_period;
|
||||
$engine->show_title = !$pure;
|
||||
$engine->stacked = $stacked;
|
||||
|
@ -1046,7 +1046,7 @@ function grafico_db_agentes_purge ($id_agent, $width, $height) {
|
|||
|
||||
function progress_bar ($progress, $width, $height, $mode = 1) {
|
||||
global $config;
|
||||
|
||||
|
||||
if ($progress > 100 || $progress < 0) {
|
||||
graphic_error ('outof.png');
|
||||
}
|
||||
|
@ -1254,120 +1254,58 @@ function grafico_modulo_string ($id_agente_modulo, $period, $show_event,
|
|||
global $config;
|
||||
global $graphic_type;
|
||||
|
||||
$resolution = $config['graph_res'] * 50; // Number of "slices" we want in graph
|
||||
|
||||
if (! $date)
|
||||
$date = get_system_time ();
|
||||
|
||||
$datelimit = $date - $period; // limit date
|
||||
$interval = (int) ($period / $resolution); // Each interval is $interval seconds length
|
||||
$nombre_agente = get_agentmodule_agent_name ($id_agente_modulo);
|
||||
$id_agente = get_agent_id ($nombre_agente);
|
||||
$nombre_modulo = get_agentmodule_name ($id_agente_modulo);
|
||||
// This code has been rewritten, taking code from 2.x and adjusted to work
|
||||
// with new code for flash and new pchart functions. (slerena/ago09)
|
||||
|
||||
if ($show_event == 1)
|
||||
$real_event = array ();
|
||||
if ($date == "")
|
||||
$date = time ();
|
||||
$resolution = $config["graph_res"] * 5; // Number of "slices" we want in graph
|
||||
$fechatope = $date - $period;
|
||||
$horasint = $period / $resolution; // Each intervalo is $horasint seconds length
|
||||
|
||||
if ($show_alert == 1) {
|
||||
$alert_high = false;
|
||||
$alert_low = false;
|
||||
// If we want to show alerts limits
|
||||
// Creamos la tabla (array) con los valores para el grafico. Inicializacion
|
||||
for ($i = 0; $i <$resolution; $i++) {
|
||||
$valores[$i][0] = 0; // [0] Valor (contador)
|
||||
$valores[$i][1] = $fechatope + ($horasint * $i);
|
||||
$valores[$i][2] = $fechatope + ($horasint * $i); // [2] Top limit for this range
|
||||
$valores[$i][3] = $fechatope + ($horasint * ($i + 1)); // [3] Botom limit
|
||||
}
|
||||
|
||||
|
||||
$sql1="SELECT utimestamp FROM tagente_datos_string WHERE id_agente_modulo = ".$id_agente_modulo." and utimestamp > '".$fechatope."'";
|
||||
|
||||
$result=mysql_query($sql1);
|
||||
while ($row=mysql_fetch_array($result)){
|
||||
for ($i = 0; $i < $resolution; $i++){
|
||||
if (($row[0] < $valores[$i][3]) and ($row[0] >= $valores[$i][2]) ){
|
||||
// entra en esta fila
|
||||
$valores[$i][0]++;
|
||||
}
|
||||
}
|
||||
|
||||
$alert_high = get_db_value ('MAX(max_value)', 'talert_template_modules', 'id_agent_module', (int) $id_agente_modulo);
|
||||
$alert_low = get_db_value ('MIN(min_value)', 'talert_template_modules', 'id_agent_module', (int) $id_agente_modulo);
|
||||
|
||||
// if no valid alert defined to render limits, disable it
|
||||
if (($alert_low === false || $alert_low === NULL) &&
|
||||
($alert_high === false || $alert_high === NULL)) {
|
||||
$show_alert = 0;
|
||||
}
|
||||
}
|
||||
$valor_maximo = 0;
|
||||
for ($i = 0; $i < $resolution; $i++) { // 30 entries in graph, one by day
|
||||
$grafica[$valores[$i][1]]=$valores[$i][0];
|
||||
if ($valores[$i][0] > $valor_maximo)
|
||||
$valor_maximo = $valores[$i][0];
|
||||
}
|
||||
|
||||
// interval - This is the number of "rows" we are divided the time
|
||||
// to fill data. more interval, more resolution, and slower.
|
||||
// periodo - Gap of time, in seconds. This is now to (now-periodo) secs
|
||||
// Rewrite data in format understable by flash charts
|
||||
|
||||
// Init tables
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
$data[$i]['sum'] = 0; // SUM of all values for this interval
|
||||
$data[$i]['count'] = 0; // counter
|
||||
$data[$i]['timestamp_bottom'] = $datelimit + ($interval * $i); // [2] Top limit for this range
|
||||
$data[$i]['timestamp_top'] = $datelimit + ($interval * ($i + 1)); // [3] Botom limit
|
||||
$data[$i]['min'] = 1; // MIN
|
||||
$data[$i]['max'] = 0; // MAX
|
||||
$data[$i]['last'] = 0; // Last value
|
||||
for ($i = 0; $i < $resolution; $i++) { // 30 entries in graph, one by day
|
||||
$data[$i]['sum'] = $valores[$i][0];
|
||||
$data[$i]['count'] = $valores[$i][0];
|
||||
$data[$i]['timestamp_bottom'] = $valores[$i][2];
|
||||
$data[$i]['timestamp_top'] = $valores[$i][3];
|
||||
$data[$i]['min'] = 0; // MIN
|
||||
$data[$i]['max'] = $valores[$i][0];
|
||||
$data[$i]['events'] = 0; // Event
|
||||
}
|
||||
// Init other general variables
|
||||
if ($show_event == 1) {
|
||||
// If we want to show events in graphs
|
||||
$sql = "SELECT utimestamp FROM tevento WHERE id_agente = $id_agente AND utimestamp > $datelimit";
|
||||
$result = get_db_all_rows_sql ($sql);
|
||||
foreach ($result as $row) {
|
||||
$utimestamp = $row['utimestamp'];
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
if ($utimestamp <= $data[$i]['timestamp_top'] && $utimestamp >= $data[$i]['timestamp_bottom']) {
|
||||
$data['events']++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Init other general variables
|
||||
$max_value = 0;
|
||||
|
||||
$all_data = get_db_all_rows_filter ('tagente_datos_string',
|
||||
array ('id_agente_modulo' => $id_agente_modulo,
|
||||
"utimestamp > $datelimit",
|
||||
"utimestamp < $date",
|
||||
'order' => 'utimestamp ASC'),
|
||||
array ('datos', 'utimestamp'));
|
||||
|
||||
if ($all_data === false) {
|
||||
$all_data = array ();
|
||||
}
|
||||
|
||||
foreach ($all_data as $module_data) {
|
||||
$real_data = 1;
|
||||
$utimestamp = $module_data["utimestamp"];
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
if ($utimestamp <= $data[$i]['timestamp_top'] && $utimestamp >= $data[$i]['timestamp_bottom']) {
|
||||
$data[$i]['sum'] += $real_data;
|
||||
$data[$i]['count']++;
|
||||
|
||||
$data[$i]['last'] = $real_data;
|
||||
|
||||
$data[$i]['min'] = min ($data[$i]['min'], $real_data);
|
||||
$data[$i]['max'] = max ($data[$i]['max'], $real_data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$previous = (float) get_previous_data ($id_agente_modulo, $datelimit);
|
||||
// Calculate Average value for $data[][0]
|
||||
for ($i = 0; $i <= $resolution; $i++) {
|
||||
if ($data[$i]['count'] == 0) {
|
||||
$data[$i]['sum'] = $previous;
|
||||
$data[$i]['min'] = $previous;
|
||||
$data[$i]['max'] = $previous;
|
||||
$data[$i]['last'] = $previous;
|
||||
|
||||
$previous = $data[$i]['sum'];
|
||||
} else {
|
||||
$previous = $data[$i]['sum'];
|
||||
if ($data[$i]['count'] > 1) {
|
||||
$previous = $data[$i]['last'];
|
||||
$data[$i]['sum'] = floor ($data[$i]['sum'] / $data[$i]['count']);
|
||||
}
|
||||
}
|
||||
|
||||
// Get max value for all graph
|
||||
$max_value = max ($max_value, $data[$i]['max']);
|
||||
}
|
||||
|
||||
$grafica = array ();
|
||||
foreach ($data as $d) {
|
||||
$grafica[$d['timestamp_bottom']] = $d['sum'];
|
||||
|
||||
if ($valor_maximo <= 0) {
|
||||
graphic_error ();
|
||||
return;
|
||||
}
|
||||
|
||||
if ($period <= 3600) {
|
||||
|
@ -1396,7 +1334,12 @@ function grafico_modulo_string ($id_agente_modulo, $period, $show_event,
|
|||
$engine->width = $width;
|
||||
$engine->height = $height;
|
||||
$engine->data = &$grafica;
|
||||
$engine->max_value = $max_value;
|
||||
$engine->max_value = $valor_maximo;
|
||||
|
||||
$nombre_agente = get_agentmodule_agent_name ($id_agente_modulo);
|
||||
$nombre_modulo = get_agentmodule_name ($id_agente_modulo);
|
||||
$id_agente = get_agent_id ($nombre_agente);
|
||||
|
||||
$engine->legend = array ($nombre_modulo);
|
||||
$engine->title = ' '.strtoupper ($nombre_agente)." - ".__('Module').' '.$title;
|
||||
$engine->subtitle = ' '.__('Period').': '.$title_period;
|
||||
|
@ -1406,15 +1349,11 @@ function grafico_modulo_string ($id_agente_modulo, $period, $show_event,
|
|||
$engine->alert_top = $show_alert ? $alert_high : false;
|
||||
$engine->alert_bottom = $show_alert ? $alert_low : false;;
|
||||
|
||||
if ($period < 10000)
|
||||
$engine->xaxis_interval = 20;
|
||||
else
|
||||
$engine->xaxis_interval = $resolution * 4;
|
||||
$engine->xaxis_interval = $resolution/5;
|
||||
$engine->yaxis_interval = 1;
|
||||
$engine->xaxis_format = 'date';
|
||||
|
||||
$engine->xaxis_format = 'datetime';
|
||||
|
||||
$engine->single_graph ();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1555,6 +1494,10 @@ if ($graphic_type) {
|
|||
generic_pie_graph ($width, $height, $data);
|
||||
|
||||
break;
|
||||
case 'string':
|
||||
grafico_modulo_string ($id, $period, $draw_events, $width, $height, $label, $unit_name, $draw_alerts, $avg_only, $pure, $date);
|
||||
break;
|
||||
|
||||
default:
|
||||
graphic_error ();
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ function safe_int ($value, $min = false, $max = false) {
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use get_parameter or safe_input functions
|
||||
* Use to clean HTML entities when get_parameter or safe_input functions dont work
|
||||
*
|
||||
* @param string String to be cleaned
|
||||
*
|
||||
|
@ -1002,4 +1002,6 @@ function index_array ($array, $index = 'id', $value = 'name') {
|
|||
|
||||
return $retval;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
|
@ -222,6 +222,10 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
|
|||
else
|
||||
echo '<div style="z-index: 1; color: '.$layout_data['label_color'].'; position: absolute; margin-left: '.$layout_data['pos_x'].'px; margin-top:'.$layout_data['pos_y'].'px;" id="layout-data-'.$layout_data['id'].'" class="layout-data">';
|
||||
|
||||
echo $layout_data['label'];
|
||||
echo "<br>";
|
||||
|
||||
|
||||
if ($show_links) {
|
||||
if (($layout_data['id_layout_linked'] == "") || ($layout_data['id_layout_linked'] == 0)) {
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agent.'&tab=data">';
|
||||
|
@ -230,9 +234,9 @@ function print_pandora_visual_map ($id_layout, $show_links = true, $draw_lines =
|
|||
}
|
||||
}
|
||||
if ($resizedMap)
|
||||
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0));
|
||||
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".((integer)($proportion * $layout_data['height']))."&pure=1&width=".((integer)($proportion * $layout_data['width']))."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0));
|
||||
else
|
||||
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".$layout_data['height']."&width=".$layout_data['width']."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0));
|
||||
print_image ("include/fgraph.php?tipo=sparse&id=".$layout_data['id_agente_modulo']."&label=".safe_input ($layout_data['label'])."&height=".$layout_data['height']."&pure=1&width=".$layout_data['width']."&period=".$layout_data['period'], false, array ("title" => $layout_data['label'], "border" => 0));
|
||||
echo "</a>";
|
||||
echo "</div>";
|
||||
break;
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<h1>Agent status view </h1>
|
||||
|
||||
Possible values of an agent status are:
|
||||
|
||||
<br><br>
|
||||
|
||||
<table width=750px><tr>
|
||||
<td class="f9i"><img src="../images/status_sets/default/agent_ok.png" title="All Monitors OK" alt="All Monitors OK"><td>All Monitors OK</td>
|
||||
<td class="f9i"><img src="../images/status_sets/default/module_critical.png" title="At least one monitor fails" alt="At least one monitor fails"><td>At least one monitor fails</td>
|
||||
<td class="f9i"><img src="../images/status_sets/default/module_warning.png" title="Change between Green/Red state" alt="Change between Green/Red state"><td>Change between Green/Red state</td>
|
||||
|
||||
<td class="f9i"><img src="../images/status_sets/default/alert_fired.png" title="Alert fired" alt="Alert fired"><td>Alert fired</td>
|
||||
<td class="f9i"><img src="../images/status_sets/default/alert_disabled.png" title="Alert disabled" alt="Alert disabled"><td>Alerts disabled</td>
|
||||
|
||||
</tr><tr>
|
||||
|
||||
<td class="f9i"><img src="../images/status_sets/default/agent_no_monitors.png" title="Agent without monitors" alt="Agent without monitors"><td>Agent without monitors</td>
|
||||
<td class="f9i"><img src="../images/status_sets/default/agent_no_data.png" title="Agent without data" alt="Agent without data"><td>Agent without data</td>
|
||||
<td class="f9i"><img src="../images/status_sets/default/agent_down.png" title="Agent down" alt="Agent down"><td>Agent down</td>
|
||||
|
||||
<td class="f9i"><img src="../images/status_sets/default/alert_not_fired.png" title="Alert not fired" alt="Alert not fired"><td>Alert not fired</td>
|
||||
|
||||
</tr>
|
||||
</table>
|
|
@ -10,7 +10,7 @@ function toggleDiv (divid){
|
|||
}
|
||||
|
||||
function winopeng (url, wid) {
|
||||
open (url, wid,"width=570,height=310,status=no,toolbar=no,menubar=no,scrollbar=no");
|
||||
open (url, wid,"width=590,height=310,status=no,toolbar=no,menubar=no,scrollbar=no");
|
||||
// WARNING !! Internet Explorer DOESNT SUPPORT "-" CARACTERS IN WINDOW HANDLE VARIABLE
|
||||
status =wid;
|
||||
}
|
||||
|
|
|
@ -561,6 +561,9 @@
|
|||
$Value = $this->ToMetric($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "currency" )
|
||||
$Value = $this->ToCurrency($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "datetime" )
|
||||
$Value = $this->ToDateTime($Value);
|
||||
|
||||
|
||||
$Position = imageftbbox($this->FontSize,0,$this->FontName,$Value);
|
||||
$TextWidth = $Position[2]-$Position[0];
|
||||
|
@ -611,7 +614,9 @@
|
|||
$Value = $this->ToMetric($Value);
|
||||
if ( $DataDescription["Format"]["X"] == "currency" )
|
||||
$Value = $this->ToCurrency($Value);
|
||||
|
||||
if ( $DataDescription["Format"]["X"] == "datetime" )
|
||||
$Value = $this->ToDateTime($Value);
|
||||
|
||||
$Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value);
|
||||
$TextWidth = abs($Position[2])+abs($Position[0]);
|
||||
$TextHeight = abs($Position[1])+abs($Position[3]);
|
||||
|
@ -753,7 +758,11 @@
|
|||
if ( $DataDescription["Format"]["Y"] == "metric" )
|
||||
$Value = $this->ToMetric($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "currency" )
|
||||
$Value = $this->ToCurrency($Value);
|
||||
$Value = $this->ToCurrency($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "datetime" )
|
||||
$Value = $this->ToDateTime($Value);
|
||||
|
||||
|
||||
|
||||
$Position = imageftbbox($this->FontSize,0,$this->FontName,$Value);
|
||||
$TextWidth = $Position[2]-$Position[0];
|
||||
|
@ -863,6 +872,8 @@
|
|||
$Value = $this->ToMetric($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "currency" )
|
||||
$Value = $this->ToCurrency($Value);
|
||||
if ( $DataDescription["Format"]["Y"] == "datetime" )
|
||||
$Value = $this->ToDateTime($Value);
|
||||
|
||||
$Position = imageftbbox($this->FontSize,$Angle,$this->FontName,$Value);
|
||||
$TextWidth = abs($Position[2])+abs($Position[0]);
|
||||
|
@ -907,7 +918,7 @@
|
|||
}
|
||||
|
||||
/* Compute and draw the scale */
|
||||
function drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=100,$DrawVerticals=FALSE)
|
||||
function drawGrid($LineWidth,$Mosaic=TRUE,$R=220,$G=220,$B=220,$Alpha=100, $DrawVerticals=FALSE)
|
||||
{
|
||||
/* Draw mosaic */
|
||||
if ( $Mosaic )
|
||||
|
@ -3550,6 +3561,13 @@
|
|||
return(date($this->DateFormat,$Value));
|
||||
}
|
||||
|
||||
/* Convert TS to a datetime format string */
|
||||
/* Added for PandoraFMS, slerena@Ago09 */
|
||||
function ToDateTime($Value)
|
||||
{
|
||||
return(date("Y/m/d\nh:m:s",$Value));
|
||||
}
|
||||
|
||||
/* Check if a number is a full integer (for scaling) */
|
||||
function isRealInt($Value)
|
||||
{
|
||||
|
|
|
@ -66,10 +66,18 @@ function get_graph_engine ($period = 3600) {
|
|||
} else {
|
||||
exit;
|
||||
}
|
||||
|
||||
$engine->graph_color[1] = $config['graph_color1'];
|
||||
$engine->graph_color[2] = $config['graph_color2'];
|
||||
$engine->graph_color[3] = $config['graph_color3'];
|
||||
|
||||
$engine->graph_color[4] = "#FED000"; // Yellow
|
||||
$engine->graph_color[5] = "#00FEF0"; // Cyan
|
||||
$engine->graph_color[6] = "#FF81EC"; // Pink
|
||||
$engine->graph_color[7] = "#FF8D00"; // Orange
|
||||
$engine->graph_color[8] = "#7E7E7E"; // Grey
|
||||
$engine->graph_color[9] = "#000000"; // Black
|
||||
|
||||
if ($period <= 86400)
|
||||
$engine->date_format = 'g:iA';
|
||||
elseif ($period <= 604800)
|
||||
|
|
|
@ -106,7 +106,7 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
public function single_graph () {
|
||||
// Dataset definition
|
||||
$this->dataset = new pData;
|
||||
$this->graph = new pChart ($this->width, $this->height);
|
||||
$this->graph = new pChart ($this->width, $this->height+2);
|
||||
|
||||
foreach ($this->data as $x => $y) {
|
||||
$this->dataset->AddPoint ($y, "Serie1", $x);
|
||||
|
@ -121,10 +121,13 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
$this->graph->loadColorPalette ($this->palette_path);
|
||||
|
||||
$this->graph->setFontProperties ($this->fontpath, 8);
|
||||
|
||||
// White background
|
||||
$this->graph->drawFilledRoundedRectangle(1,1,$this->width,$this->height,0,254,254,254);
|
||||
$this->add_background ();
|
||||
$this->dataset->SetXAxisFormat ($this->xaxis_format);
|
||||
$this->dataset->SetYAxisFormat ($this->yaxis_format);
|
||||
$this->graph->drawGraphArea (255, 255, 255, true);
|
||||
$this->graph->drawGraphArea (254, 254, 254, true);
|
||||
|
||||
if ($this->max_value == 0 || $this->max_value == 1)
|
||||
$this->graph->setFixedScale (0, 1, 1);
|
||||
|
@ -136,7 +139,7 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
$this->xaxis_interval);
|
||||
|
||||
if ($this->show_grid)
|
||||
$this->graph->drawGrid (4, false, 0, 0, 0);
|
||||
$this->graph->drawGrid (1, false, 200, 200, 200);
|
||||
if ($this->max_value > 0) {
|
||||
// Draw the graph
|
||||
$this->graph->drawFilledLineGraph ($this->dataset->GetData (),
|
||||
|
@ -145,7 +148,7 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
}
|
||||
|
||||
// Finish the graph
|
||||
$this->add_legend ();
|
||||
// $this->add_legend ();
|
||||
$this->add_events ();
|
||||
$this->add_alert_levels ();
|
||||
|
||||
|
@ -155,7 +158,7 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
public function sparse_graph ($period, $avg_only, $min_value, $max_value, $unit_name) {
|
||||
// Dataset definition
|
||||
$this->dataset = new pData;
|
||||
$this->graph = new pChart ($this->width, $this->height);
|
||||
$this->graph = new pChart ($this->width, $this->height+5);
|
||||
$this->graph->setFontProperties ($this->fontpath, 8);
|
||||
$this->legend = array ();
|
||||
|
||||
|
@ -179,7 +182,7 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
$this->dataset->SetSerieName (__("Max. Value"), "MAX");
|
||||
$this->set_colors ();
|
||||
}
|
||||
$this->dataset->SetXAxisFormat ('date');
|
||||
$this->dataset->SetXAxisFormat ('datetime');
|
||||
$this->graph->setDateFormat ("Y");
|
||||
$this->dataset->SetYAxisFormat ('metric');
|
||||
$this->dataset->AddAllSeries ();
|
||||
|
@ -189,21 +192,30 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
if ($this->palette_path) {
|
||||
$this->graph->loadColorPalette ($this->palette_path);
|
||||
}
|
||||
|
||||
// White background
|
||||
$this->graph->drawFilledRoundedRectangle(1,1,$this->width,$this->height,0,254,254,254);
|
||||
|
||||
$this->add_background ();
|
||||
$this->graph->drawGraphArea (255, 255, 255, true);
|
||||
|
||||
// Graph border
|
||||
$this->graph->drawRoundedRectangle(1,1,$this->width-1,$this->height+4,5,230,230,230);
|
||||
|
||||
|
||||
$this->add_background ();
|
||||
$this->graph->drawGraphArea (254, 254, 254, false);
|
||||
|
||||
$this->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10;
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (), SCALE_START0,
|
||||
80, 80, 80, $this->show_axis, 0, 0, false,
|
||||
80, 80, 80, $this->show_axis, 0, 50, false,
|
||||
$this->xaxis_interval);
|
||||
|
||||
/* NOTICE: The final "false" is a Pandora modificaton of pChart to avoid showing vertical lines. */
|
||||
if ($this->show_grid)
|
||||
$this->graph->drawGrid (1, true, 225, 225, 225, 100, false);
|
||||
|
||||
// Draw the graph
|
||||
$this->graph->drawFilledLineGraph ($this->dataset->GetData(), $this->dataset->GetDataDescription(), 50, true);
|
||||
|
||||
|
||||
$this->add_legend ();
|
||||
$this->add_events ("AVG");
|
||||
$this->add_alert_levels ();
|
||||
|
@ -254,54 +266,95 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
set_time_limit (0);
|
||||
// Dataset definition
|
||||
$this->dataset = new pData;
|
||||
$this->graph = new pChart ($this->width, $this->height);
|
||||
$this->graph = new pChart ($this->width, $this->height+5);
|
||||
|
||||
|
||||
// $previo stores values from last series to made the stacked graph
|
||||
foreach ($this->data as $i => $data) {
|
||||
foreach ($data as $j => $value) {
|
||||
$this->dataset->AddPoint ($value, $this->legend[$i],
|
||||
// New code for stacked. Due pchart doesnt not support stacked
|
||||
// area graph, we "made it", adding to a series the values of the
|
||||
// previous one consecutive sum.
|
||||
if ((($stacked == 1) OR ($stacked==3)) AND ($i >0)){
|
||||
$this->dataset->AddPoint ($value+$previo[$j], $this->legend[$i],
|
||||
$values[$j]['timestamp_bottom']);
|
||||
}
|
||||
} else {
|
||||
$this->dataset->AddPoint ($value, $this->legend[$i],
|
||||
$values[$j]['timestamp_bottom']);
|
||||
}
|
||||
if ($i == 0)
|
||||
$previo[$j] = $value;
|
||||
else
|
||||
$previo[$j] = $previo[$j] + $value;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
foreach ($this->legend as $name) {
|
||||
$this->dataset->setSerieName ($name, $name);
|
||||
$this->dataset->AddSerie ($name);
|
||||
}
|
||||
|
||||
// Set different colors for combined graphs because need to be
|
||||
// very different.
|
||||
|
||||
$this->graph_color[1] = "#FF0000"; // Red
|
||||
$this->graph_color[2] = "#00FF00"; // Green
|
||||
$this->graph_color[3] = "#0000FF"; // Blue
|
||||
|
||||
// White background
|
||||
$this->graph->drawFilledRoundedRectangle(1,1,$this->width,$this->height,0,254,254,254);
|
||||
|
||||
$this->set_colors ();
|
||||
$this->graph->setFontProperties ($this->fontpath, 8);
|
||||
$this->dataset->SetXAxisFormat ('date');
|
||||
$this->dataset->SetXAxisFormat ('datetime');
|
||||
$this->dataset->SetYAxisFormat ('metric');
|
||||
$this->dataset->AddAllSeries ();
|
||||
$this->add_background ();
|
||||
$this->graph->drawGraphArea (255, 255, 255, true);
|
||||
$this->graph->drawGraphArea (254, 254, 254, false);
|
||||
|
||||
|
||||
// Fixed missing X-labels (6Ago09)
|
||||
$this->xaxis_interval = ($this->xaxis_interval / 7 >= 1) ? ($this->xaxis_interval / 7) : 10;
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (), SCALE_START0,
|
||||
80, 80, 80, $this->show_axis, 0, 50, false,
|
||||
$this->xaxis_interval);
|
||||
|
||||
$this->graph->drawGrid (1, true, 225, 225, 225, 100, false);
|
||||
|
||||
// Draw the graph
|
||||
if ($stacked == 1) {
|
||||
if ($stacked == 1) { // Stacked solid
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (),
|
||||
SCALE_ADDALL, 80, 80, 80, $this->show_axis,
|
||||
0, 0, false,
|
||||
SCALE_START0, 80, 80, 80, $this->show_axis, 0, 0, false,
|
||||
$this->xaxis_interval);
|
||||
/* Stacked mode are only supported in bar charts */
|
||||
//$this->graph->DivisionWidth = ($this->x2 - $this->x1) / sizeof ($this->data[0]);
|
||||
$this->graph->drawStackedBarGraph ($this->dataset->GetData (),
|
||||
$this->graph->drawFilledCubicCurve ($this->dataset->GetData(),
|
||||
$this->dataset->GetDataDescription(), 1, 30, true);
|
||||
}
|
||||
elseif ($stacked == 3) { // Stacked wired
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (),
|
||||
50);
|
||||
} else if ($stacked == 2) {
|
||||
SCALE_START0, 80, 80, 80, $this->show_axis, 0, 0, false,
|
||||
$this->xaxis_interval);
|
||||
$this->graph->drawFilledCubicCurve ($this->dataset->GetData(),
|
||||
$this->dataset->GetDataDescription(), 1, 0, true);
|
||||
|
||||
} else if ($stacked == 2) { // Wired mode
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (),
|
||||
SCALE_START0, 80, 80, 80, $this->show_axis, 0, 0, false,
|
||||
$this->xaxis_interval);
|
||||
$this->graph->drawLineGraph ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription ());
|
||||
} else {
|
||||
} else { // Non-stacked, area overlapped
|
||||
$this->graph->drawScale ($this->dataset->GetData (),
|
||||
$this->dataset->GetDataDescription (),
|
||||
SCALE_START0, 80, 80, 80, $this->show_axis, 0, 0, false,
|
||||
$this->xaxis_interval);
|
||||
$this->graph->drawFilledCubicCurve ($this->dataset->GetData(),
|
||||
$this->dataset->GetDataDescription(), 0.1, 50, true);
|
||||
$this->dataset->GetDataDescription(), 1, 30, true);
|
||||
}
|
||||
$this->add_legend ();
|
||||
$this->add_events ($this->legend[0]);
|
||||
|
@ -312,7 +365,6 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
|
||||
public function progress_bar ($value, $color) {
|
||||
set_time_limit (0);
|
||||
|
||||
// Dataset definition
|
||||
$this->graph = new pChart ($this->width, $this->height);
|
||||
$this->graph->setFontProperties ($this->fontpath, 8);
|
||||
|
@ -438,76 +490,95 @@ class PchartGraph extends PandoraGraphAbstract {
|
|||
$this->graph->setDateFormat ($this->date_format);
|
||||
|
||||
$this->x1 = ($this->width > 300) ? 30 : 35;
|
||||
$this->y1 = ($this->height > 200) ? 25 : 10;
|
||||
$this->x2 = ($this->width > 300) ? $this->width - 30 : $this->width - 15;
|
||||
// $this->y1 = ($this->height > 200) ? 25 : 10;
|
||||
$this->x2 = ($this->width > 300) ? $this->width - 15 : $this->width - 15;
|
||||
$this->y2 = ($this->height > 200) ? $this->height - 25 : $this->height - 25;
|
||||
|
||||
if ($this->max_value > 10000 && $this->show_axis)
|
||||
$this->x1 += 20;
|
||||
|
||||
if ($this->background_gradient)
|
||||
$this->graph->drawGraphAreaGradient (233, 243, 210, 50, TARGET_BACKGROUND);
|
||||
else
|
||||
$this->graph->drawGraphArea (255, 255, 255, true);
|
||||
|
||||
if ($this->show_title) {
|
||||
$this->y1 += 30;
|
||||
}
|
||||
|
||||
$this->graph->setFontProperties ($this->fontpath, 6);
|
||||
|
||||
$this->graph->drawGraphArea (255, 255, 255, true);
|
||||
|
||||
$this->graph->setFontProperties ($this->fontpath, 7);
|
||||
$size = $this->graph->getLegendBoxSize ($this->dataset->GetDataDescription ());
|
||||
|
||||
/* Old resize code for graph area, discard, we need all area in pure mode
|
||||
if (is_array ($size)) {
|
||||
while ($size[1] > $this->y1)
|
||||
$this->y1 += (int) $size[1] / 2;
|
||||
if ($this->y1 > $this->y2)
|
||||
$this->y1 = $this->y2;
|
||||
}
|
||||
*/
|
||||
|
||||
if ($this->show_title == 1){
|
||||
$this->y1=40;
|
||||
} else {
|
||||
$this->y1=10;
|
||||
}
|
||||
|
||||
// No title for combined
|
||||
if ($this->stacked !== false){
|
||||
$this->y1=10;
|
||||
}
|
||||
|
||||
|
||||
$this->graph->setGraphArea ($this->x1, $this->y1, $this->x2, $this->y2);
|
||||
|
||||
if ($this->show_title) {
|
||||
$this->graph->setFontProperties ($this->fontpath, 10);
|
||||
$this->graph->drawTextBox (0, 0, $this->width, 20, $this->title, 0,
|
||||
255, 255, 255, ALIGN_LEFT, true, 0, 0, 0, 30);
|
||||
|
||||
$this->graph->setFontProperties ($this->fontpath, 12);
|
||||
$this->graph->drawTextBox (2, 7, $this->width, 20, $this->title, 0, 0, 0, 0, ALIGN_LEFT, false);
|
||||
$this->graph->setFontProperties ($this->fontpath, 9);
|
||||
$this->graph->drawTextBox (0, 20, $this->width, 40, $this->subtitle,
|
||||
0, 255, 255, 255, ALIGN_LEFT, true, 0, 0, 0, 0);
|
||||
$this->graph->setFontProperties ($this->fontpath, 8);
|
||||
$this->graph->drawTextBox ($this->width-150, 10, $this->width, 20, $this->subtitle,
|
||||
0, 0, 0, 0, ALIGN_LEFT, false);
|
||||
|
||||
$this->graph->setFontProperties ($this->fontpath, 6);
|
||||
}
|
||||
|
||||
/* This is a tiny watermark. Remove safely */
|
||||
/* This is a tiny watermark */
|
||||
if ($this->watermark) {
|
||||
$this->graph->setFontProperties ($this->fontpath, 7);
|
||||
$this->graph->drawTextBox ($this->width - 5, $this->height - 0,
|
||||
$this->width - 240, $this->height - 0, 'Pandora FMS', 90,
|
||||
154, 154, 154, ALIGN_BOTTOM_LEFT, false);
|
||||
if ($this->show_title){
|
||||
$this->graph->setFontProperties ($this->fontpath, 6);
|
||||
$this->graph->drawTextBox ($this->width - 5, 40,
|
||||
$this->width - 240, 90, 'PandoraFMS', 90,
|
||||
214, 214, 214, ALIGN_BOTTOM_LEFT, false);
|
||||
} else {
|
||||
$this->graph->setFontProperties ($this->fontpath, 6);
|
||||
$this->graph->drawTextBox ($this->width - 5, 50,
|
||||
$this->width - 240, 60, 'PandoraFMS', 90,
|
||||
214, 214, 214, ALIGN_BOTTOM_LEFT, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function add_legend () {
|
||||
if (! $this->show_title || $this->legend === false) {
|
||||
if ((! $this->show_title || $this->legend === false) && ($this->stacked === false)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Add legend */
|
||||
$this->graph->setFontProperties ($this->fontpath, 6);
|
||||
$size = $this->graph->getLegendBoxSize ($this->dataset->GetDataDescription ());
|
||||
$this->graph->drawLegend ($this->width - $size[0] - 32, 5,
|
||||
|
||||
// No title for combined, so legends goes up
|
||||
if ($this->stacked !== false)
|
||||
$this->graph->drawLegend ( 35, 12,
|
||||
$this->dataset->GetDataDescription (),
|
||||
240, 240, 240);
|
||||
245, 245, 245);
|
||||
else
|
||||
$this->graph->drawLegend ( 35, 52,
|
||||
$this->dataset->GetDataDescription (),
|
||||
245, 245, 245);
|
||||
}
|
||||
|
||||
private function set_colors () {
|
||||
if ($this->graph == NULL)
|
||||
return;
|
||||
|
||||
$color = $this->get_rgb_values ($this->graph_color[1]);
|
||||
$this->graph->setColorPalette (0, $color['r'], $color['g'], $color['b']);
|
||||
$color = $this->get_rgb_values ($this->graph_color[2]);
|
||||
$this->graph->setColorPalette (1, $color['r'], $color['g'], $color['b']);
|
||||
$color = $this->get_rgb_values ($this->graph_color[3]);
|
||||
$this->graph->setColorPalette (2, $color['r'], $color['g'], $color['b']);
|
||||
for ($a = 0; $a<9; $a++){
|
||||
$color = $this->get_rgb_values ($this->graph_color[$a+1]);
|
||||
$this->graph->setColorPalette ($a, $color['r'], $color['g'], $color['b']);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -209,9 +209,10 @@ div#menu {
|
|||
div#head {
|
||||
font-size: 8pt;
|
||||
width: 960px;
|
||||
height: 87px;/*84px;*/ /*height: 60px;*/
|
||||
height: 60px;/*84px;*/ /*height: 60px;*/
|
||||
padding-top: 1px;
|
||||
background: url(../../images/header.jpg);
|
||||
border-bottom: solid 2px #555;
|
||||
border-bottom: solid 1px #000;
|
||||
}
|
||||
|
||||
div#foot {
|
||||
|
@ -361,7 +362,7 @@ td.datos_id {
|
|||
font-style: italic;
|
||||
}
|
||||
.tit {
|
||||
padding: 3px 1px;
|
||||
padding: 3px 1px;
|
||||
}
|
||||
.tit, .titb {
|
||||
font-weight: bold;
|
||||
|
@ -490,7 +491,7 @@ div.title_line {
|
|||
color: #333;
|
||||
border-left: 2px solid #778866;
|
||||
font-weight: bold;
|
||||
line-height: 19px;
|
||||
line-height: 18px;
|
||||
}
|
||||
#menu_tab li.nomn_high a {
|
||||
background: #799E48;
|
||||
|
|
|
@ -115,7 +115,8 @@ $searchPage = false;
|
|||
$search = get_parameter_get("head_search_keywords");
|
||||
if (strlen($search) > 0) {
|
||||
$config['search_keywords'] = trim(get_parameter('keywords'));
|
||||
$config['search_category'] = get_parameter('search_category');
|
||||
// If not search category providad, we'll use an agent search
|
||||
$config['search_category'] = get_parameter('search_category', 'agents');
|
||||
if (($config['search_keywords'] != 'Enter keywords to search') && (strlen($config['search_keywords']) > 0))
|
||||
$searchPage = true;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,9 @@ if (is_ajax ()) {
|
|||
$group_id = get_parameter ("group_id", 0);
|
||||
$search = get_parameter ("search", "");
|
||||
|
||||
echo "<h2>".__('Pandora agents')." » ".__('Summary')."</h2>";
|
||||
echo "<h2>".__('Pandora agents')." » ".__('Summary').
|
||||
print_help_icon ("agent_status", true);
|
||||
echo "</h2>";
|
||||
|
||||
if ($group_id > 1) {
|
||||
echo '<form method="post" action="'.get_url_refresh (array ('group_id' => $group_id)).'">';
|
||||
|
@ -192,11 +194,12 @@ foreach ($agents as $agent) {
|
|||
if (!empty ($table->data)) {
|
||||
print_table ($table);
|
||||
unset ($table);
|
||||
require ("bulbs.php");
|
||||
} else {
|
||||
echo '<div class="nf">'.__('There are no agents included in this group').'</div>';
|
||||
}
|
||||
|
||||
/* Godmode controls SHOULD NOT BE HERE
|
||||
|
||||
if (give_acl ($config['id_user'], 0, "LM") || give_acl ($config['id_user'], 0, "AW")
|
||||
|| give_acl ($config['id_user'], 0, "PM") || give_acl ($config['id_user'], 0, "DM")
|
||||
|| give_acl ($config['id_user'], 0, "UM")) {
|
||||
|
@ -206,4 +209,5 @@ if (give_acl ($config['id_user'], 0, "LM") || give_acl ($config['id_user'], 0, "
|
|||
print_submit_button (__('Create agent'), 'crt', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
}
|
||||
*/
|
||||
?>
|
||||
|
|
|
@ -30,10 +30,7 @@ if (! isset($_SESSION["id_user"])) {
|
|||
|
||||
require_once ($config["homedir"] . '/include/functions.php');
|
||||
require_once ($config["homedir"] . '/include/functions_db.php');
|
||||
|
||||
if ($config['flash_charts']) {
|
||||
require_once ($config["homedir"] . '/include/fgraph.php');
|
||||
}
|
||||
require_once ($config["homedir"] . '/include/fgraph.php');
|
||||
|
||||
check_login ();
|
||||
|
||||
|
@ -97,7 +94,7 @@ function getTermEle(ele) {
|
|||
}
|
||||
//-->
|
||||
</script>
|
||||
</head><body>
|
||||
</head><body bgcolor="#ffffff">
|
||||
<?php
|
||||
|
||||
// Get input parameters
|
||||
|
|
|
@ -111,6 +111,7 @@ if ($view_graph) {
|
|||
$stackeds[0] = __('Area');
|
||||
$stackeds[1] = __('Stacked area');
|
||||
$stackeds[2] = __('Line');
|
||||
$stackeds[3] = __('Stacked line');
|
||||
print_select ($stackeds, 'stacked', $stacked , '', '', -1, false, false);
|
||||
|
||||
echo "<td class='datos'>";
|
||||
|
|
|
@ -144,7 +144,7 @@ foreach ($contents as $content) {
|
|||
}
|
||||
|
||||
$data = array ();
|
||||
$data[0] = '<img src="include/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=720&period='.$content['period'].'&date='.$datetime.'&avg_only=1&pure=1" border="0" alt="">';
|
||||
$data[0] = '<img src="include/fgraph.php?tipo=sparse&id='.$content['id_agent_module'].'&height=230&width=750&period='.$content['period'].'&date='.$datetime.'&avg_only=1&pure=1" border="0" alt="">';
|
||||
array_push ($table->data, $data);
|
||||
|
||||
break;
|
||||
|
@ -159,7 +159,7 @@ foreach ($contents as $content) {
|
|||
|
||||
// Put description at the end of the module (if exists)
|
||||
if ($content["description"] != ""){
|
||||
$table->colspan[0][0] = 4;
|
||||
$table->colspan[1][0] = 3;
|
||||
$data_desc = array();
|
||||
$data_desc[0] = $content["description"];
|
||||
array_push ($table->data, $data_desc);
|
||||
|
@ -180,11 +180,11 @@ foreach ($contents as $content) {
|
|||
$graph_height= get_db_sql ("SELECT height FROM tgraph WHERE id_graph = ".$content["id_gs"]);
|
||||
|
||||
|
||||
$table->colspan[1][0] = 4;
|
||||
$table->colspan[2][0] = 3;
|
||||
$data = array ();
|
||||
$data[0] = '<img src="include/fgraph.php?tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height='.$graph_height.'&width='.$graph_width.'&period='.$content['period'].'&date='.$datetime.'&stacked='.$graph["stacked"].'&pure=1" border="1" alt="">';
|
||||
$data[0] = '<img src="include/fgraph.php?tipo=combined&id='.implode (',', $modules).'&weight_l='.implode (',', $weights).'&height=235&width=750&period='.$content['period'].'&date='.$datetime.'&stacked='.$graph["stacked"].'&pure=1" border="1" alt="">';
|
||||
array_push ($table->data, $data);
|
||||
|
||||
|
||||
break;
|
||||
case 3:
|
||||
case 'SLA':
|
||||
|
|
|
@ -153,6 +153,24 @@ if (($config['search_category'] == 'all') || ($config['search_category'] == 'map
|
|||
|
||||
///////// INI MENU AND TABS /////////////
|
||||
|
||||
$img_style = array ("class" => "top", "width" => 16);
|
||||
|
||||
/*
|
||||
echo '<div id="menu_tab_frame"><div id="menu_tab_left"><ul class="mn">';
|
||||
echo '<li class="nomn"><a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'">';
|
||||
print_image ("images/setup.png", false, $img_style);
|
||||
echo ' '.mb_substr (get_agent_name ($id_agente), 0, 21).'</a>';
|
||||
echo "</li></ul></div>";
|
||||
|
||||
echo '<div id="menu_tab"><ul class="mn"><li class="nomn">';
|
||||
echo '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">';
|
||||
print_image ("images/zoom.png", false, $img_style);
|
||||
echo ' '.__('View').'</a></li>';
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
echo "
|
||||
<div id='menu_tab_frame_view'>
|
||||
<div id='menu_tab_left'>
|
||||
|
@ -169,7 +187,9 @@ if ($searchAgents)
|
|||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Agents')." <img src='images/bricks.png' /></a>";
|
||||
echo "<a href='?search_category=agents&keywords=".$config['search_keywords']."&head_search_keywords=Search'>";
|
||||
print_image ("images/bricks.png", false, $img_style);
|
||||
echo " ".__('Agents')."</a>";
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
|
@ -177,14 +197,18 @@ if ($searchTab == "users")
|
|||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=users&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Users')." <img src='images/group.png' /></a>";
|
||||
echo "<a href='?search_category=users&keywords=".$config['search_keywords']. "&head_search_keywords=Search'> ";
|
||||
print_image ("images/group.png", false, $img_style);
|
||||
echo " ".__('Users')."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($searchTab == "alerts")
|
||||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Alerts')." <img src='images/god2.png' /></a>";
|
||||
echo "<a href='?search_category=alerts&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
||||
print_image ("images/god2.png", false, $img_style);
|
||||
echo " ".__('Alerts')."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($searchGraphs)
|
||||
|
@ -193,7 +217,9 @@ if ($searchGraphs)
|
|||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Graphs')." <img src='images/chart_curve.png' /></a>";
|
||||
echo "<a href='?search_category=graphs&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
||||
print_image ("images/chart_curve.png", false, $img_style);
|
||||
echo " ".__('Graphs'). "</a>";
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
|
@ -202,7 +228,9 @@ if ($searchTab == "reports")
|
|||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Reports')." <img src='images/reporting.png' /></a>";
|
||||
echo "<a href='?search_category=reports&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
||||
print_image ("images/reporting.png", false, $img_style);
|
||||
echo " ".__('Reports')."</a>";
|
||||
echo "</li>";
|
||||
|
||||
if ($searchMaps)
|
||||
|
@ -211,7 +239,9 @@ if ($searchMaps)
|
|||
echo "<li class='nomn_high'>";
|
||||
else
|
||||
echo "<li class='nomn'>";
|
||||
echo "<a href='?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'>".__('Maps')." <img src='images/camera.png' /></a>";
|
||||
echo "<a href='?search_category=maps&keywords=".$config['search_keywords']."&head_search_keywords=Search'> ";
|
||||
print_image ("images/camera.png", false, $img_style);
|
||||
echo " ".__('Maps')."</a>";
|
||||
echo "</li>";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue