2007-05-20 19:12:31 +02:00
|
|
|
<?PHP
|
2007-03-28 18:07:29 +02:00
|
|
|
// Pandora FMS - the Free monitoring system
|
|
|
|
// ========================================
|
|
|
|
// Copyright (c) 2004-2007 Sancho Lerena, slerena@gmail.com
|
|
|
|
// Main PHP/SQL code development and project architecture and management
|
|
|
|
// Copyright (c) 2005-2007 Artica Soluciones Tecnologicas, info@artica.es
|
|
|
|
//
|
|
|
|
// 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; 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.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
$id_agent = 0;
|
|
|
|
$id_module = 0;
|
|
|
|
$name = "Pandora FMS combined graph";
|
|
|
|
$width = 550;
|
|
|
|
$height = 210;
|
2007-05-30 19:32:35 +02:00
|
|
|
$period = 86401;
|
2007-04-19 20:50:07 +02:00
|
|
|
//$alerts= "";
|
2007-03-28 18:07:29 +02:00
|
|
|
$events = "";
|
|
|
|
$factor = 1;
|
2007-04-19 20:50:07 +02:00
|
|
|
$render=1; // by default
|
2008-04-24 01:29:50 +02:00
|
|
|
$stacked = 0;
|
2007-04-19 20:50:07 +02:00
|
|
|
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
$add_module = (bool) get_parameter ('add_module');
|
|
|
|
|
2007-04-19 20:50:07 +02:00
|
|
|
// Login check
|
|
|
|
$id_usuario=$_SESSION["id_usuario"];
|
|
|
|
global $REMOTE_ADDR;
|
|
|
|
|
|
|
|
if (comprueba_login() != 0) {
|
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
|
|
|
|
include ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2008-07-07 15:16:13 +02:00
|
|
|
if ((give_acl($id_user,0,"AW") != 1 ) && (dame_admin($id_user)!=1)) {
|
2007-06-12 13:57:03 +02:00
|
|
|
audit_db($id_usuario,$REMOTE_ADDR, "ACL Violation","Trying to access graph builder");
|
|
|
|
include ("general/noaccess.php");
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
2008-07-07 15:16:13 +02:00
|
|
|
if (isset($_GET["store_graph"])) {
|
2007-04-19 20:50:07 +02:00
|
|
|
$name = entrada_limpia($_POST["name"]);
|
|
|
|
$description = entrada_limpia($_POST["description"]);
|
|
|
|
$module_number = entrada_limpia($_POST["module_number"]);
|
|
|
|
$private = entrada_limpia($_POST["private"]);
|
|
|
|
$width = entrada_limpia($_POST["width"]);
|
|
|
|
$height = entrada_limpia($_POST["height"]);
|
|
|
|
$events = entrada_limpia($_POST["events"]);
|
2008-04-24 01:29:50 +02:00
|
|
|
$stacked = get_parameter ("stacked",0);
|
2008-07-07 15:16:13 +02:00
|
|
|
if ($events == "") // Temporal workaround
|
|
|
|
$events = 0;
|
2007-04-19 20:50:07 +02:00
|
|
|
$period = entrada_limpia($_POST["period"]);
|
|
|
|
// Create graph
|
|
|
|
$sql = "INSERT INTO tgraph
|
2008-04-24 01:29:50 +02:00
|
|
|
(id_user, name, description, period, width, height, private, events, stacked) VALUES
|
2007-04-19 20:50:07 +02:00
|
|
|
('$id_user',
|
|
|
|
'$name',
|
|
|
|
'$description',
|
|
|
|
$period,
|
|
|
|
$width,
|
|
|
|
$height,
|
|
|
|
$private,
|
2008-04-24 01:29:50 +02:00
|
|
|
$events,
|
2008-07-07 15:16:13 +02:00
|
|
|
$stacked)";
|
2007-04-19 20:50:07 +02:00
|
|
|
//echo "DEBUG $sql<br>";
|
|
|
|
$res = mysql_query($sql);
|
|
|
|
if ($res){
|
|
|
|
$id_graph = mysql_insert_id();
|
|
|
|
if ($id_graph){
|
|
|
|
for ($a=0; $a < $module_number; $a++){
|
|
|
|
$id_agentemodulo = entrada_limpia($_POST["module_".$a]);
|
|
|
|
$id_agentemodulo_w = entrada_limpia($_POST["module_weight_".$a]);
|
|
|
|
$sql = "INSERT INTO tgraph_source (id_graph, id_agent_module, weight) VALUES
|
|
|
|
($id_graph, $id_agentemodulo, $id_agentemodulo_w)";
|
|
|
|
//echo "DEBUG $sql<br>";
|
|
|
|
mysql_query($sql);
|
|
|
|
}
|
|
|
|
echo "<h3 class='suc'>".$lang_label["store_graph_suc"]."</h3>";
|
|
|
|
} else
|
|
|
|
echo "<h3 class='error'>".$lang_label["store_graph_error"]."</h3>";
|
|
|
|
} else
|
|
|
|
echo "<h3 class='error'>".$lang_label["store_graph_error"]."</h3>";
|
|
|
|
}
|
2007-03-28 18:07:29 +02:00
|
|
|
|
|
|
|
if (isset($_GET["get_agent"])) {
|
2008-07-07 15:16:13 +02:00
|
|
|
$id_agent = $_POST["id_agent"];
|
2007-04-19 20:50:07 +02:00
|
|
|
if (isset($_POST["chunk"]))
|
2007-05-30 19:32:35 +02:00
|
|
|
$chunkdata = $_POST["chunk"];
|
2007-03-28 18:07:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($_GET["delete_module"] )) {
|
|
|
|
$chunkdata = $_POST["chunk"];
|
|
|
|
if (isset($chunkdata)) {
|
|
|
|
$chunk1 = array();
|
|
|
|
$chunk1 = split ("\|", $chunkdata);
|
|
|
|
$modules="";$weights="";
|
|
|
|
for ($a=0; $a < count($chunk1); $a++){
|
|
|
|
if (isset($_POST["delete_$a"])){
|
|
|
|
$id_module = $_POST["delete_$a"];
|
|
|
|
$deleted_id[]=$id_module;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$chunkdata2 = "";
|
|
|
|
$module_array = array();
|
|
|
|
$weight_array = array();
|
|
|
|
$agent_array = array();
|
|
|
|
for ($a=0; $a < count($chunk1); $a++){
|
|
|
|
$chunk2[$a] = array();
|
|
|
|
$chunk2[$a] = split ( ",", $chunk1[$a]);
|
|
|
|
$skip_module =0;
|
|
|
|
for ($b=0; $b < count($deleted_id); $b++){
|
|
|
|
if ($deleted_id[$b] == $chunk2[$a][1]){
|
|
|
|
$skip_module = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (($skip_module == 0) && (strpos($modules, $chunk2[$a][1]) == 0)){ // Skip
|
|
|
|
$module_array[] = $chunk2[$a][1];
|
|
|
|
$agent_array[] = $chunk2[$a][0];
|
|
|
|
$weight_array[] = $chunk2[$a][2];
|
|
|
|
if ($chunkdata2 == "")
|
|
|
|
$chunkdata2 .= $chunk2[$a][0].",".$chunk2[$a][1].",".$chunk2[$a][2];
|
|
|
|
else
|
|
|
|
$chunkdata2 .= "|".$chunk2[$a][0].",".$chunk2[$a][1].",".$chunk2[$a][2];
|
|
|
|
if ($modules !="")
|
|
|
|
$modules = $modules.",".$chunk2[$a][1];
|
|
|
|
else
|
|
|
|
$modules = $chunk2[$a][1];
|
|
|
|
if ($weights !="")
|
|
|
|
$weights = $weights.",".$chunk2[$a][2];
|
|
|
|
else
|
|
|
|
$weights = $chunk2[$a][2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$chunkdata = $chunkdata2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
if ($add_module) {
|
2008-07-07 15:16:13 +02:00
|
|
|
$id_agent = $_POST["id_agent"];
|
|
|
|
$id_module = $_POST["id_module"];
|
|
|
|
if (isset($_POST["factor"]))
|
|
|
|
$factor = $_POST["factor"];
|
|
|
|
else
|
|
|
|
$factor = 1;
|
|
|
|
$period = $_POST["period"];
|
|
|
|
$render = $_POST["render"];
|
|
|
|
$stacked = get_parameter ("stacked",0);
|
2007-04-19 20:50:07 +02:00
|
|
|
// $alerts = $_POST["alerts"];
|
|
|
|
if (isset($_POST["chunk"]))
|
2008-07-07 15:16:13 +02:00
|
|
|
$chunkdata = $_POST["chunk"];
|
2007-03-28 18:07:29 +02:00
|
|
|
$events = $_POST["events"];
|
|
|
|
$factor = $_POST["factor"];
|
2008-07-07 15:16:13 +02:00
|
|
|
if ($_POST["width"]!= "")
|
|
|
|
$width = $_POST["width"];
|
|
|
|
if ($_POST["height"]!= "")
|
|
|
|
$height = $_POST["height"];
|
|
|
|
if ($id_module > 0){
|
2007-04-19 20:50:07 +02:00
|
|
|
if (!isset($chunkdata) OR ($chunkdata == ""))
|
2007-03-28 18:07:29 +02:00
|
|
|
$chunkdata = "$id_agent,$id_module,$factor";
|
|
|
|
else
|
|
|
|
$chunkdata = $chunkdata."|$id_agent,$id_module,$factor";
|
|
|
|
}
|
|
|
|
}
|
2008-07-07 15:16:13 +02:00
|
|
|
|
2007-03-28 18:07:29 +02:00
|
|
|
// Parse CHUNK information into showable information
|
|
|
|
// Split id to get all parameters
|
|
|
|
if (! isset($_GET["delete_module"])){
|
2007-05-30 19:32:35 +02:00
|
|
|
if (isset($_POST["period"]))
|
|
|
|
$period = $_POST["period"];
|
|
|
|
if ((isset($chunkdata) )&& ($chunkdata != "")) {
|
2007-03-28 18:07:29 +02:00
|
|
|
$module_array = array();
|
|
|
|
$weight_array = array();
|
|
|
|
$agent_array = array();
|
|
|
|
$chunk1 = array();
|
|
|
|
$chunk1 = split ("\|", $chunkdata);
|
|
|
|
$modules="";$weights="";
|
|
|
|
for ($a=0; $a < count($chunk1); $a++){
|
|
|
|
$chunk2[$a] = array();
|
|
|
|
$chunk2[$a] = split ( ",", $chunk1[$a]);
|
|
|
|
if (strpos($modules, $chunk2[$a][1]) == 0){ // Skip dupes
|
|
|
|
$module_array[] = $chunk2[$a][1];
|
|
|
|
$agent_array[] = $chunk2[$a][0];
|
|
|
|
$weight_array[] = $chunk2[$a][2];
|
|
|
|
if ($modules !="")
|
|
|
|
$modules = $modules.",".$chunk2[$a][1];
|
|
|
|
else
|
|
|
|
$modules = $chunk2[$a][1];
|
|
|
|
if ($weights !="")
|
|
|
|
$weights = $weights.",".$chunk2[$a][2];
|
|
|
|
else
|
|
|
|
$weights = $chunk2[$a][2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-05-27 04:55:55 +02:00
|
|
|
echo "<h2>".$lang_label["reporting"]." > ";
|
2007-03-28 18:07:29 +02:00
|
|
|
if (isset($chunk1)) {
|
2007-05-27 04:55:55 +02:00
|
|
|
echo $lang_label["graph_builder_modulelist"]."</h2>";
|
2007-06-07 19:46:38 +02:00
|
|
|
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder&delete_module=1'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
if (isset($chunkdata))
|
|
|
|
echo "<input type='hidden' name='chunk' value='$chunkdata'>";
|
2008-07-21 15:43:33 +02:00
|
|
|
if ($id_agent)
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<input type='hidden' name='id_agent' value='$id_agent'>";
|
2008-07-21 15:43:33 +02:00
|
|
|
if ($period)
|
2008-07-07 15:16:13 +02:00
|
|
|
echo "<input type='hidden' name='period' value='$period'>";
|
2007-05-30 19:32:35 +02:00
|
|
|
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<tr>
|
|
|
|
<th>".$lang_label["agent"]."</th>
|
|
|
|
<th>".$lang_label["module"]."</th>
|
|
|
|
<th>Weight</th>
|
|
|
|
<th>".$lang_label["delete"]."</th>";
|
2007-04-19 20:50:07 +02:00
|
|
|
$color=0;
|
2007-03-28 18:07:29 +02:00
|
|
|
for ($a=0; $a < count($module_array); $a++){
|
|
|
|
// Calculate table line color
|
|
|
|
if ($color == 1){
|
|
|
|
$tdcolor = "datos";
|
|
|
|
$color = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
$tdcolor = "datos2";
|
|
|
|
$color = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
echo "<tr><td class='$tdcolor'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo dame_nombre_agente($agent_array[$a])."</td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='$tdcolor'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo dame_nombre_modulo_agentemodulo($module_array[$a])."</td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='$tdcolor'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo $weight_array[$a]."</td>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<td class='$tdcolor' align='center'>";
|
|
|
|
echo "<input type=checkbox name='delete_$a' value='".$module_array[$a]."'></td></tr>";
|
2007-03-28 18:07:29 +02:00
|
|
|
}
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "</table>";
|
|
|
|
echo "<table width='500px'>";
|
|
|
|
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub delete' value='".$lang_label["delete"]."'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "</table>";
|
|
|
|
echo "</form>";
|
|
|
|
}
|
|
|
|
|
2007-05-20 19:12:31 +02:00
|
|
|
// --------------------------------------
|
|
|
|
// Parse chunkdata and render graph
|
|
|
|
// --------------------------------------
|
|
|
|
if (($render == 1) && (isset($modules))) {
|
|
|
|
// parse chunk
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<h3>".$lang_label["combined_image"]."</h3>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<table class='databox'>";
|
2007-05-20 19:12:31 +02:00
|
|
|
echo "<tr><td>";
|
2008-04-24 01:29:50 +02:00
|
|
|
echo "<img src='reporting/fgraph.php?tipo=combined&id=$modules&weight_l=$weights&label=Combined%20Sample%20Graph&height=$height&width=$width&stacked=$stacked&period=$period' border=1 alt=''>";
|
2007-05-20 19:12:31 +02:00
|
|
|
echo "</td></tr></table>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2007-03-28 18:07:29 +02:00
|
|
|
// -----------------------
|
|
|
|
// SOURCE AGENT TABLE/FORM
|
|
|
|
// -----------------------
|
2007-06-08 12:22:44 +02:00
|
|
|
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
if ($add_module) {
|
2007-06-08 12:22:44 +02:00
|
|
|
echo $lang_label["graph_builder"]."</h2>";
|
|
|
|
} else {
|
|
|
|
echo "<h3>".$lang_label["graph_builder"]."</h3>";
|
|
|
|
}
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_color'>";
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder'>";
|
|
|
|
print_input_hidden ('add_module', 1);
|
2007-05-30 19:32:35 +02:00
|
|
|
if (isset($period))
|
|
|
|
echo "<input type='hidden' name='period' value='$period'>";
|
|
|
|
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<tr>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<td class='datos'><b>".$lang_label["source_agent"]."</td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "</b>";
|
|
|
|
|
|
|
|
// Show combo with agents
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
echo "<td class='datos' colspan=2>";
|
|
|
|
|
2008-07-08 22:06:44 +02:00
|
|
|
print_select_from_sql ('SELECT id_agente, nombre FROM tagente WHERE disabled = 0 ORDER BY nombre', 'id_agent', $id_agent, '', '--', 0);
|
2007-03-28 18:07:29 +02:00
|
|
|
|
|
|
|
// SOURCE MODULE FORM
|
2008-07-21 15:43:33 +02:00
|
|
|
if (isset ($chunkdata))
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<input type='hidden' name='chunk' value='$chunkdata'>";
|
|
|
|
|
|
|
|
echo "<tr><td class='datos2'>";
|
|
|
|
echo "<b>".$lang_label["modules"]."</b>";
|
|
|
|
echo "<td class='datos2' colspan=3>";
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
echo "<select id='id_module' name='id_module' size=1 style='width:180px;'>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<option value=-1> -- </option>";
|
2007-03-28 18:07:29 +02:00
|
|
|
if ($id_agent != 0){
|
|
|
|
// Populate Module/Agent combo
|
2007-06-16 18:04:01 +02:00
|
|
|
$sql1="SELECT * FROM tagente_modulo WHERE id_agente = ".$id_agent. " ORDER BY nombre";
|
2007-03-28 18:07:29 +02:00
|
|
|
$result = mysql_query($sql1);
|
|
|
|
while ($row=mysql_fetch_array($result)){
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<option value=".$row["id_agente_modulo"].">".$row["nombre"]."</option>";
|
2007-03-28 18:07:29 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</select>";
|
|
|
|
|
|
|
|
echo "<tr><td class='datos'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["Factor"]."</b></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<input type='text' name='factor' value='$factor' size=6></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["width"]."</b>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<input type='text' name='width' value='$width' size=6></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo "<tr><td class='datos2'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["render_now"]."</b></td>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<td class='datos2'>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "<select name='render'>";
|
|
|
|
if ($render == 1){
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<option value=1>Yes</option>";
|
|
|
|
echo "<option value=0>No</option>";
|
2007-04-19 20:50:07 +02:00
|
|
|
} else {
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<option value=0>No</option>";
|
|
|
|
echo "<option value=1>Yes</option>";
|
2007-04-19 20:50:07 +02:00
|
|
|
}
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "</select></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos2'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["height"]."</b></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos2'>";
|
|
|
|
echo "<input type='text' name='height' value='$height' size=6>";
|
|
|
|
|
|
|
|
|
2007-04-19 20:50:07 +02:00
|
|
|
switch ($period) {
|
2008-07-07 15:16:13 +02:00
|
|
|
case 3600:
|
|
|
|
$period_label = "Hour";
|
|
|
|
break;
|
|
|
|
case 7200:
|
|
|
|
$period_label = "2 Hours";
|
|
|
|
break;
|
|
|
|
case 10800:
|
|
|
|
$period_label = "3 Hours";
|
|
|
|
break;
|
|
|
|
case 21600:
|
|
|
|
$period_label = "6 Hours";
|
|
|
|
break;
|
|
|
|
case 43200:
|
|
|
|
$period_label = "12 Hours";
|
|
|
|
break;
|
|
|
|
case 86400:
|
|
|
|
$period_label = "Day";
|
|
|
|
break;
|
|
|
|
case 172800:
|
|
|
|
$period_label = "Two days";
|
|
|
|
break;
|
|
|
|
case 345600:
|
|
|
|
$period_label = "Four days";
|
|
|
|
break;
|
|
|
|
case 604800:
|
|
|
|
$period_label = "Last Week";
|
|
|
|
break;
|
|
|
|
case 1296000:
|
|
|
|
$period_label = "15 Days";
|
|
|
|
break;
|
|
|
|
case 2592000:
|
|
|
|
$period_label = "Last Month";
|
|
|
|
break;
|
|
|
|
case 5184000:
|
|
|
|
$period_label = "Two Month";
|
|
|
|
break;
|
|
|
|
case 15552000:
|
|
|
|
$period_label = "Six Months";
|
|
|
|
break;
|
|
|
|
case 31104000:
|
|
|
|
$period_label = "One year";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$period_label = "Day";
|
2007-04-19 20:50:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<tr><td class='datos'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["period"]."</b></td>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<td class='datos'>";
|
|
|
|
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "<select name='period'>";
|
2007-06-08 12:12:57 +02:00
|
|
|
if ($period==0) {
|
|
|
|
echo "<option value=86400>".$period_label."</option>";
|
|
|
|
} else {
|
|
|
|
echo "<option value=$period>".$period_label."</option>";
|
|
|
|
}
|
|
|
|
echo "<option value=3600>"."Hour</option>";
|
|
|
|
echo "<option value=7200>"."2 Hours</option>";
|
|
|
|
echo "<option value=10800>"."3 Hours</option>";
|
|
|
|
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>"."Two days</option>";
|
|
|
|
echo "<option value=604800>"."Last Week</option>";
|
|
|
|
echo "<option value=1296000>"."15 days</option>";
|
|
|
|
echo "<option value=2592000>"."Last Month</option>";
|
|
|
|
echo "<option value=5184000>"."Two Month</option>";
|
|
|
|
echo "<option value=15552000>"."Six Months</option>";
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "</select>";
|
|
|
|
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<td class='datos'>";
|
2007-08-30 12:49:50 +02:00
|
|
|
echo "<b>".$lang_label["view_events"]."</b></td>";
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<td class='datos'>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "<select name='events'>";
|
|
|
|
if ($events == 1){
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<option value=1>Yes</option>";
|
|
|
|
echo "<option value=0>No</option>";
|
2007-03-28 18:07:29 +02:00
|
|
|
} else {
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "<option value=0>No</option>";
|
|
|
|
echo "<option value=1>Yes</option>";
|
2007-03-28 18:07:29 +02:00
|
|
|
}
|
2007-06-08 12:12:57 +02:00
|
|
|
echo "</select></td>";
|
2007-04-19 20:50:07 +02:00
|
|
|
|
2008-04-24 01:29:50 +02:00
|
|
|
echo "<tr>";
|
|
|
|
echo "<td class='datos2'>";
|
|
|
|
echo "<b>".lang_string ("Stacked")."</b></td>";
|
|
|
|
echo "<td class='datos2'>";
|
2008-07-08 22:06:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
$stackeds[0] = lang_string ('Area');
|
|
|
|
$stackeds[1] = lang_string ('Stacked area');
|
|
|
|
$stackeds[2] = lang_string ('Line');
|
|
|
|
print_select ($stackeds, 'stacked', $stacked, '', '', 0);
|
|
|
|
echo "</td>";
|
2008-04-24 01:29:50 +02:00
|
|
|
|
|
|
|
|
2007-04-19 20:50:07 +02:00
|
|
|
/*
|
|
|
|
echo "<td class='datos'>";
|
|
|
|
echo "<b>Show alert limit</b>";
|
|
|
|
echo "<td class='datos'>";
|
|
|
|
echo "<select name='alerts'>";
|
|
|
|
if ($alerts == 1){
|
2007-03-28 18:07:29 +02:00
|
|
|
echo "<option value=1>Yes";
|
|
|
|
echo "<option value=0>No";
|
|
|
|
} else {
|
|
|
|
echo "<option value=0>No";
|
|
|
|
echo "<option value=1>Yes";
|
|
|
|
}
|
|
|
|
echo "</select>";
|
2007-04-19 20:50:07 +02:00
|
|
|
*/
|
2008-07-08 22:06:44 +02:00
|
|
|
|
|
|
|
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "</tr></table>";
|
|
|
|
echo "<table width='500px'>";
|
|
|
|
echo "<tr><td align='right'><input type=submit name='update_agent' class='sub upd' value='".$lang_label["add"]."/".$lang_label["redraw"]."'>";
|
2007-03-28 18:07:29 +02:00
|
|
|
|
|
|
|
echo "</form>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "</td></tr></table>";
|
2007-03-28 18:07:29 +02:00
|
|
|
|
2007-04-19 20:50:07 +02:00
|
|
|
// -----------------------
|
|
|
|
// STORE GRAPH FORM
|
|
|
|
// -----------------------
|
|
|
|
|
|
|
|
// If we have something to save..
|
|
|
|
if (isset($module_array)){
|
|
|
|
echo "<h3>".$lang_label["graph_store"]."</h3>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<table width='500' cellpadding=4 cellpadding=4 class='databox_color'>";
|
2007-06-07 19:46:38 +02:00
|
|
|
echo "<form method='post' action='index.php?sec=greporting&sec2=godmode/reporting/graph_builder&store_graph=1'>";
|
2007-04-19 20:50:07 +02:00
|
|
|
|
|
|
|
// hidden fields with data begin
|
|
|
|
echo "<input type='hidden' name='module_number' value='".count($module_array)."'>";
|
|
|
|
echo "<input type='hidden' name='width' value='$width'>";
|
|
|
|
echo "<input type='hidden' name='height' value='$height'>";
|
|
|
|
echo "<input type='hidden' name='period' value='$period'>";
|
|
|
|
echo "<input type='hidden' name='events' value='$events'>";
|
2008-04-24 01:29:50 +02:00
|
|
|
echo "<input type='hidden' name='stacked' value='$stacked'>";
|
2007-04-19 20:50:07 +02:00
|
|
|
|
|
|
|
for ($a=0; $a < count($module_array); $a++){
|
|
|
|
$id_agentemodulo = $module_array[$a];
|
|
|
|
$id_agentemodulo_w = $weight_array[$a];
|
|
|
|
echo "<input type='hidden' name='module_$a' value='$id_agentemodulo'>";
|
|
|
|
echo "<input type='hidden' name='module_weight_$a' value='$id_agentemodulo_w'>";
|
|
|
|
}
|
|
|
|
// hidden fields end
|
|
|
|
|
|
|
|
echo "<tr>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<td class='datos'><b>".$lang_label["name"]."</b></td>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "</b>";
|
|
|
|
echo "<td class='datos'><input type='text' name='name' size='35'>";
|
|
|
|
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<td class='datos'><b>".$lang_label["private"]."</b></td>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "</b>";
|
|
|
|
echo "<td class='datos'><select name='private'>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<option value=0>".$lang_label["no"]."</option>";
|
|
|
|
echo "<option value=1>".$lang_label["yes"]."</option>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "</select>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "</td></tr>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "<tr>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "<td class='datos2'><b>".$lang_label["description"]."</b></td>";
|
2007-04-19 20:50:07 +02:00
|
|
|
echo "</b>";
|
|
|
|
echo "<td class='datos2' colspan=4><textarea name='description' style='height:45px;' cols=55 rows=2>";
|
|
|
|
echo "</textarea>";
|
2007-06-16 18:04:01 +02:00
|
|
|
echo "</td></tr></table>";
|
|
|
|
echo "<table width='500px'>";
|
|
|
|
echo "<tr><td align='right'><input type=submit name='store' class='sub wand' value='".$lang_label["store"]."'>";
|
2007-04-19 20:50:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
echo "</form>";
|
|
|
|
echo "</table>";
|
|
|
|
}
|
2007-03-28 18:07:29 +02:00
|
|
|
|
|
|
|
?>
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript" src="include/javascript/jquery.js"></script>
|
|
|
|
|
|
|
|
<script language="javascript" type="text/javascript">
|
|
|
|
|
|
|
|
function agent_changed () {
|
|
|
|
var id_agent = this.value;
|
|
|
|
$('#id_module').fadeOut ('normal', function () {
|
|
|
|
$('#id_module').empty ();
|
|
|
|
var inputs = [];
|
|
|
|
inputs.push ("id_agent=" + id_agent);
|
|
|
|
inputs.push ("get_agent_modules_json=1");
|
|
|
|
inputs.push ("page=operation/agentes/ver_agente");
|
|
|
|
jQuery.ajax ({
|
|
|
|
data: inputs.join ("&"),
|
|
|
|
type: 'GET',
|
|
|
|
url: action="ajax.php",
|
|
|
|
timeout: 10000,
|
|
|
|
dataType: 'json',
|
|
|
|
success: function (data) {
|
|
|
|
$('#id_module').append ($('<option></option>').attr ('value', 0).text ("--"));
|
|
|
|
jQuery.each (data, function (i, val) {
|
2008-07-08 22:06:44 +02:00
|
|
|
s = html_entity_decode (val['nombre']);
|
2008-06-17 Esteban Sanchez <estebans@artica.es>
* ajax.php: Added to repository. AJAX interface for Pandora. A new
time is coming...
* pandoradb.sql: Added id_group to treport. A report is now assigned
to a group of agents. Changes in treport_content to add an order
field, drop sla fields and use an enum for the type. NOTE: This will
break all your current defined reports, update under your
responsabillity. Added table treport_content_sla_combined to define
SLAs in the SLA types reports.
* godmode/reporting/graph_builder.php: Use Pandora functions. Adde
javascript code to display the module icon when changing from the
dropdown menu.
* godmode/reporting/reporting_builder.php: Almost complet rewritten to
use Pandora HTML functions. Style correction.
* include/functions.php: Added new report types. Style correction.
* include/functions_db.php: Use Pandora database functions to get
simple values. Added functions get_agents_in_group(),
get_modules_in_agent(), get_simple_alerts_in_agent(),
get_combined_alerts_in_agent(), get_alerts_in_agent(),
get_monitor_downs_in_period(),
get_monitor_last_down_timestamp_in_period(),
get_alert_fires_in_period(),
get_alert_last_fire_timestamp_in_period(). Deleted debug output and
fixed calling to an inexistent function in
return_moduledata_sum_value().
* include/functions_html.php: Tab style correction. Thanks to Ramon
for the advice. Fixed some errors on print_table that was causing not
to work fine if rowclass or colspan was defined.
* include/functions_reporting.php: Adde date support to
return_module_SLA(), event_reporting(). Added alert_reporting(),
monitor_health_reporting(), general_group_reporting() and
agents_detailed_reporting() to implement new report types. Style
correction.
* include/javascript/pandora.js: Added html_entity_decode() function
to decode some AJAX results.
* javascript/jquery.js: Added to repository. jQuery version 1.2.4a
* include/javascript/jquery.timeentry.js: jQuery plugin to manage time
inputs.
* include/javascript/jquery.ui.datepicker.js: jQuery plugin to manage
date inputs in a dropdown calendar.
* include/languages/date_*.js, include/languages/time_*.js: Added to
repository. Translation of date and time strings for the new calendar
javascript support.
* include/languages/language_en.php: Added new strings relatives to
reports.
* include/languages/language_de.php,
include/languages/language_fr.php, include/languages/language_gl.php,
include/languages/language_pt_br.php: Fixed a variable name.
* godmode/groups/group_list.php: Avoid the use of an extra indentation
by returning if no success on comprueba_login().
* include/styles/pandora.css: Add some classes. Tab style correction.
* operation/agentes/ver_agente.php: Added AJAX support to agent
operations.
* operation/reporting/graph_viewer.php: Period dropdown selection
improved and printed with Pandora functions.
* operation/reporting/reporting_viewer.php: Massive rewritten.
Implemented date and time support, added new report types, use Pandora
functions...
* reporting/fgraph.php: Documentation fix. Added a new graphic to show
monitors health.
* godmode/agentes/agent_manager.php,
operation/reporting/custom_reporting.php: Style correction.
git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@869 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
2008-06-17 16:30:44 +02:00
|
|
|
$('#id_module').append ($('<option></option>').attr ('value', val['id_agente_modulo']).text (s));
|
|
|
|
});
|
|
|
|
$('#id_module').fadeIn ('normal');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready (function () {
|
|
|
|
$('#id_agent').change (agent_changed);
|
|
|
|
});
|
|
|
|
</script>
|