mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
* godmode/events/custom_events.php, godmode/massive/massive_enable_disable_alerts.php, godmode/massive/massive_edit_agents.php, godmode/massive/massive_delete_modules.php, godmode/massive/massive_add_action_alerts.php, godmode/massive/massive_delete_profiles.php, godmode/massive/massive_delete_alerts.php, godmode/groups/modu_group_list.php, godmode/groups/group_list.php, godmode/reporting/graph_builder.php, godmode/reporting/graphs.php, godmode/alerts/alert_templates.php, godmode/alerts/configure_alert_action.php, include/functions_ui.php, include/functions_graph.php: improved the source code. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8057 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
1b9578085e
commit
74776d7188
@ -1,3 +1,18 @@
|
|||||||
|
2013-04-25 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* godmode/events/custom_events.php,
|
||||||
|
godmode/massive/massive_enable_disable_alerts.php,
|
||||||
|
godmode/massive/massive_edit_agents.php,
|
||||||
|
godmode/massive/massive_delete_modules.php,
|
||||||
|
godmode/massive/massive_add_action_alerts.php,
|
||||||
|
godmode/massive/massive_delete_profiles.php,
|
||||||
|
godmode/massive/massive_delete_alerts.php,
|
||||||
|
godmode/groups/modu_group_list.php, godmode/groups/group_list.php,
|
||||||
|
godmode/reporting/graph_builder.php, godmode/reporting/graphs.php,
|
||||||
|
godmode/alerts/alert_templates.php,
|
||||||
|
godmode/alerts/configure_alert_action.php, include/functions_ui.php,
|
||||||
|
include/functions_graph.php: improved the source code.
|
||||||
|
|
||||||
2013-04-25 Ramon Novoa <rnovoa@artica.es>
|
2013-04-25 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
* pandoradb.sql,
|
* pandoradb.sql,
|
||||||
|
@ -155,7 +155,7 @@ if ($delete_template) {
|
|||||||
|
|
||||||
if ($al_template !== false){
|
if ($al_template !== false){
|
||||||
// If user tries to delete a template with group=ALL then must have "PM" access privileges
|
// If user tries to delete a template with group=ALL then must have "PM" access privileges
|
||||||
if ($al_template['id_group'] == 0){
|
if ($al_template['id_group'] == 0) {
|
||||||
if (! check_acl ($config['id_user'], 0, "PM")) {
|
if (! check_acl ($config['id_user'], 0, "PM")) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access Alert Management");
|
"Trying to access Alert Management");
|
||||||
@ -167,7 +167,10 @@ if ($delete_template) {
|
|||||||
alerts_meta_print_header ();
|
alerts_meta_print_header ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui_print_page_header (__('Alerts')." » ". __('Alert templates'), "images/gm_alerts.png", false, "alert_template", true);
|
ui_print_page_header(
|
||||||
|
__('Alerts') . " » " . __('Alert templates'),
|
||||||
|
"images/gm_alerts.png", false, "alert_template",
|
||||||
|
true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // If user tries to delete a template of others groups
|
} // If user tries to delete a template of others groups
|
||||||
|
@ -130,7 +130,7 @@ $table->data[2][0] = __('Command');
|
|||||||
$table->data[2][1] = html_print_select_from_sql ('SELECT id, name FROM talert_commands',
|
$table->data[2][1] = html_print_select_from_sql ('SELECT id, name FROM talert_commands',
|
||||||
'id_command', $id_command, '', __('None'), 0, true);
|
'id_command', $id_command, '', __('None'), 0, true);
|
||||||
$table->data[2][1] .= ' ';
|
$table->data[2][1] .= ' ';
|
||||||
if (check_acl ($config['id_user'], 0, "PM")){
|
if (check_acl ($config['id_user'], 0, "PM")) {
|
||||||
$table->data[2][1] .= html_print_image ('images/add.png', true);
|
$table->data[2][1] .= html_print_image ('images/add.png', true);
|
||||||
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||||
$table->data[2][1] .= __('Create Command');
|
$table->data[2][1] .= __('Create Command');
|
||||||
@ -144,7 +144,7 @@ $table->data[4][0] = __('Command preview');
|
|||||||
$table->data[4][1] = html_print_textarea ('command_preview', 10, 30, '',
|
$table->data[4][1] = html_print_textarea ('command_preview', 10, 30, '',
|
||||||
'disabled="disabled"', true);
|
'disabled="disabled"', true);
|
||||||
$row = 5;
|
$row = 5;
|
||||||
for ($i=1; $i<=10; $i++) {
|
for ($i = 1; $i <= 10; $i++) {
|
||||||
$table->data['field'.$i][0] = html_print_image('images/spinner.gif',true);
|
$table->data['field'.$i][0] = html_print_image('images/spinner.gif',true);
|
||||||
$table->data['field'.$i][1] = html_print_image('images/spinner.gif',true);
|
$table->data['field'.$i][1] = html_print_image('images/spinner.gif',true);
|
||||||
// Store the value in a hidden to keep it on first execution
|
// Store the value in a hidden to keep it on first execution
|
||||||
|
@ -194,11 +194,11 @@ echo '</div>';
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* <![CDATA[ */
|
/* <![CDATA[ */
|
||||||
$(document).ready (function () {
|
$(document).ready (function () {
|
||||||
|
|
||||||
$("#right").click (function () {
|
$("#right").click (function () {
|
||||||
jQuery.each($("select[name='fields_available[]'] option:selected"), function (key, value) {
|
jQuery.each($("select[name='fields_available[]'] option:selected"), function (key, value) {
|
||||||
field_name = $(value).html();
|
field_name = $(value).html();
|
||||||
if (field_name != <?php echo "'".__('None')."'"; ?>){
|
if (field_name != <?php echo "'".__('None')."'"; ?>) {
|
||||||
id_field = $(value).attr('value');
|
id_field = $(value).attr('value');
|
||||||
$("select[name='fields_selected[]']").append($("<option></option>").html(field_name).attr("value", id_field));
|
$("select[name='fields_selected[]']").append($("<option></option>").html(field_name).attr("value", id_field));
|
||||||
$("#fields_available").find("option[value='" + id_field + "']").remove();
|
$("#fields_available").find("option[value='" + id_field + "']").remove();
|
||||||
|
@ -139,7 +139,7 @@ if ($create_group) {
|
|||||||
|
|
||||||
/*Check if name field is empty*/
|
/*Check if name field is empty*/
|
||||||
if ($name != "") {
|
if ($name != "") {
|
||||||
if (!$check){
|
if (!$check) {
|
||||||
$values = array(
|
$values = array(
|
||||||
'nombre' => $name,
|
'nombre' => $name,
|
||||||
'icon' => substr ($icon, 0, -4),
|
'icon' => substr ($icon, 0, -4),
|
||||||
|
@ -65,11 +65,11 @@ if ($create_group) {
|
|||||||
$alerts_disabled = (bool) get_parameter ('alerts_disabled');
|
$alerts_disabled = (bool) get_parameter ('alerts_disabled');
|
||||||
$custom_id = (string) get_parameter ('custom_id');
|
$custom_id = (string) get_parameter ('custom_id');
|
||||||
$check = db_get_value('name', 'tmodule_group', 'name', $name);
|
$check = db_get_value('name', 'tmodule_group', 'name', $name);
|
||||||
|
|
||||||
if ($name){
|
if ($name) {
|
||||||
if (!$check) {
|
if (!$check) {
|
||||||
$result = db_process_sql_insert('tmodule_group', array('name' => $name));
|
$result = db_process_sql_insert('tmodule_group', array('name' => $name));
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
ui_print_success_message(__('Group successfully created'));
|
ui_print_success_message(__('Group successfully created'));
|
||||||
}
|
}
|
||||||
|
@ -67,13 +67,13 @@ if ($add) {
|
|||||||
$agent_alerts = agents_get_alerts($id_agents);
|
$agent_alerts = agents_get_alerts($id_agents);
|
||||||
$cont = 0;
|
$cont = 0;
|
||||||
$agent_alerts_id = array();
|
$agent_alerts_id = array();
|
||||||
foreach($agent_alerts['simple'] as $agent_alert){
|
foreach ($agent_alerts['simple'] as $agent_alert) {
|
||||||
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) {
|
if (in_array($agent_alert['id_alert_template'], $id_alert_templates)) {
|
||||||
$agent_alerts_id[$cont] = $agent_alert['id'];
|
$agent_alerts_id[$cont] = $agent_alert['id'];
|
||||||
$cont = $cont + 1;
|
$cont = $cont + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = array();
|
$options = array();
|
||||||
|
|
||||||
if($fires_min > 0)
|
if($fires_min > 0)
|
||||||
|
@ -72,8 +72,8 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
|
|||||||
|
|
||||||
$module_selection_mode = get_parameter('modules_selection_mode');
|
$module_selection_mode = get_parameter('modules_selection_mode');
|
||||||
|
|
||||||
foreach($module_names as $module){
|
foreach ($module_names as $module) {
|
||||||
foreach($id_agents as $id_agent) {
|
foreach ($id_agents as $id_agent) {
|
||||||
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
$module_id = modules_get_agentmodule_id($module, $id_agent);
|
||||||
$modules_id[] = $module_id['id_agente_modulo'];
|
$modules_id[] = $module_id['id_agente_modulo'];
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
|
|||||||
if (count($module_names) == 1 && $module_names[0] == '0') {
|
if (count($module_names) == 1 && $module_names[0] == '0') {
|
||||||
|
|
||||||
if ($module_selection_mode == 'common')
|
if ($module_selection_mode == 'common')
|
||||||
$modules_id = agents_common_modules_with_alerts ($id_agents, false, true);
|
$modules_id = agents_common_modules_with_alerts ($id_agents, false, true);
|
||||||
else {
|
else {
|
||||||
// For agents selected
|
// For agents selected
|
||||||
$modules_id = array();
|
$modules_id = array();
|
||||||
@ -111,12 +111,12 @@ function process_manage_delete ($id_alert_template, $id_agents, $module_names) {
|
|||||||
|
|
||||||
$conttotal = 0;
|
$conttotal = 0;
|
||||||
$contsuccess = 0;
|
$contsuccess = 0;
|
||||||
foreach($modules_id as $module){
|
foreach ($modules_id as $module) {
|
||||||
$success = alerts_delete_alert_agent_module (false,
|
$success = alerts_delete_alert_agent_module (false,
|
||||||
array ('id_agent_module' => $module,
|
array ('id_agent_module' => $module,
|
||||||
'id_alert_template' => $id_alert_template));
|
'id_alert_template' => $id_alert_template));
|
||||||
|
|
||||||
if($success)
|
if ($success)
|
||||||
$contsuccess ++;
|
$contsuccess ++;
|
||||||
$conttotal ++;
|
$conttotal ++;
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ echo '<h3 class="error invisible" id="message"> </h3>';
|
|||||||
ui_require_jquery_file ('form');
|
ui_require_jquery_file ('form');
|
||||||
ui_require_jquery_file ('pandora.controls');
|
ui_require_jquery_file ('pandora.controls');
|
||||||
|
|
||||||
if ($selection_mode == 'modules'){
|
if ($selection_mode == 'modules') {
|
||||||
$modules_row = '';
|
$modules_row = '';
|
||||||
$agents_row = 'none';
|
$agents_row = 'none';
|
||||||
}
|
}
|
||||||
@ -404,19 +404,19 @@ $(document).ready (function () {
|
|||||||
|
|
||||||
$('input[type=checkbox]').change (
|
$('input[type=checkbox]').change (
|
||||||
function () {
|
function () {
|
||||||
if(this.id == "checkbox-force_type"){
|
if (this.id == "checkbox-force_type") {
|
||||||
if(this.checked) {
|
if (this.checked) {
|
||||||
$(".select_modules_row_2").css('display', 'none');
|
$(".select_modules_row_2").css('display', 'none');
|
||||||
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show ();
|
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").show ();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(".select_modules_row_2").css('display', '');
|
$(".select_modules_row_2").css('display', '');
|
||||||
if($('#module_name option:selected').val() == undefined) {
|
if ($('#module_name option:selected').val() == undefined) {
|
||||||
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
|
$("tr#delete_table-edit1, tr#delete_table-edit2, tr#delete_table-edit3, tr#delete_table-edit35, tr#delete_table-edit4, tr#delete_table-edit5, tr#delete_table-edit6, tr#delete_table-edit7, tr#delete_table-edit8").hide ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(this.id == "checkbox-recursion"){
|
else if (this.id == "checkbox-recursion") {
|
||||||
$("#groups_select").trigger("change");
|
$("#groups_select").trigger("change");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -50,13 +50,13 @@ if ($delete_profiles) {
|
|||||||
$groups_id = get_parameter ('groups_id', -1);
|
$groups_id = get_parameter ('groups_id', -1);
|
||||||
$users_id = get_parameter ('users_id', -1);
|
$users_id = get_parameter ('users_id', -1);
|
||||||
|
|
||||||
if($profiles_id == -1 || $groups_id == -1 || $users_id == -1){
|
if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) {
|
||||||
$result = false;
|
$result = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
foreach($profiles_id as $profile) {
|
foreach ($profiles_id as $profile) {
|
||||||
foreach($groups_id as $group) {
|
foreach ($groups_id as $group) {
|
||||||
foreach($users_id as $id_up) {
|
foreach ($users_id as $id_up) {
|
||||||
if ($id_up == 0) {
|
if ($id_up == 0) {
|
||||||
echo '<h3 class="error">'.__('Not deleted. You must select an existing user').'</h3>';
|
echo '<h3 class="error">'.__('Not deleted. You must select an existing user').'</h3>';
|
||||||
$result="";
|
$result="";
|
||||||
|
@ -456,7 +456,7 @@ $(document).ready (function () {
|
|||||||
$("select#id_os").pandoraSelectOS ();
|
$("select#id_os").pandoraSelectOS ();
|
||||||
|
|
||||||
var recursion;
|
var recursion;
|
||||||
$("#checkbox-recursion").click(function (){
|
$("#checkbox-recursion").click(function () {
|
||||||
recursion = this.checked ? 1 : 0;
|
recursion = this.checked ? 1 : 0;
|
||||||
$("#id_group").trigger("change");
|
$("#id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
@ -184,7 +184,7 @@ $(document).ready (function () {
|
|||||||
clear_alert_fields();
|
clear_alert_fields();
|
||||||
|
|
||||||
var recursion;
|
var recursion;
|
||||||
$("#checkbox-recursion").click(function (){
|
$("#checkbox-recursion").click(function () {
|
||||||
recursion = this.checked ? 1 : 0;
|
recursion = this.checked ? 1 : 0;
|
||||||
$("#id_group").trigger("change");
|
$("#id_group").trigger("change");
|
||||||
});
|
});
|
||||||
|
@ -243,10 +243,10 @@ if (!$delete_module) {
|
|||||||
$chunk1 = array();
|
$chunk1 = array();
|
||||||
$chunk1 = explode ("|", $chunkdata);
|
$chunk1 = explode ("|", $chunkdata);
|
||||||
$modules="";$weights="";
|
$modules="";$weights="";
|
||||||
for ($a=0; $a < count($chunk1); $a++){
|
for ($a = 0; $a < count($chunk1); $a++) {
|
||||||
$chunk2[$a] = array();
|
$chunk2[$a] = array();
|
||||||
$chunk2[$a] = explode ( ",", $chunk1[$a]);
|
$chunk2[$a] = explode ( ",", $chunk1[$a]);
|
||||||
if (strpos($modules, $chunk2[$a][1]) == 0){ // Skip dupes
|
if (strpos($modules, $chunk2[$a][1]) == 0) { // Skip dupes
|
||||||
$module_array[] = $chunk2[$a][1];
|
$module_array[] = $chunk2[$a][1];
|
||||||
$agent_array[] = $chunk2[$a][0];
|
$agent_array[] = $chunk2[$a][0];
|
||||||
$weight_array[] = $chunk2[$a][2];
|
$weight_array[] = $chunk2[$a][2];
|
||||||
|
@ -35,30 +35,33 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
|
|||||||
}
|
}
|
||||||
|
|
||||||
$buttons['graph_list'] = array('active' => true,
|
$buttons['graph_list'] = array('active' => true,
|
||||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' .
|
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">' .
|
||||||
html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .'</a>');
|
html_print_image("images/list.png", true, array ("title" => __('Graph list'))) .'</a>');
|
||||||
|
|
||||||
if ($enterpriseEnable){
|
if ($enterpriseEnable){
|
||||||
$buttons = reporting_enterprise_add_template_graph_tabs($buttons);
|
$buttons = reporting_enterprise_add_template_graph_tabs($buttons);
|
||||||
}
|
}
|
||||||
|
|
||||||
$subsection = '';
|
$subsection = '';
|
||||||
switch ($activeTab){
|
switch ($activeTab) {
|
||||||
|
case 'main':
|
||||||
case 'main': $buttons['graph_list']['active'] = true;
|
$buttons['graph_list']['active'] = true;
|
||||||
$subsection = ' » '.__('Graph list');
|
$subsection = ' » '.__('Graph list');
|
||||||
break;
|
break;
|
||||||
default: $subsection = reporting_enterprise_add_graph_template_subsection($activeTab, $buttons);
|
default:
|
||||||
break;
|
$subsection = reporting_enterprise_add_graph_template_subsection($activeTab, $buttons);
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($activeTab) {
|
switch ($activeTab) {
|
||||||
case 'main': require_once('godmode/reporting/graphs.php');
|
case 'main':
|
||||||
break;
|
require_once('godmode/reporting/graphs.php');
|
||||||
default: reporting_enterprise_select_graph_template_tab($activeTab);
|
break;
|
||||||
break;
|
default:
|
||||||
|
reporting_enterprise_select_graph_template_tab($activeTab);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$delete_graph = (bool) get_parameter ('delete_graph');
|
$delete_graph = (bool) get_parameter ('delete_graph');
|
||||||
$view_graph = (bool) get_parameter ('view_graph');
|
$view_graph = (bool) get_parameter ('view_graph');
|
||||||
$id = (int) get_parameter ('id');
|
$id = (int) get_parameter ('id');
|
||||||
@ -76,7 +79,7 @@ if ($delete_graph) {
|
|||||||
$result = "<h3 class=suc>".__('Successfully deleted')."</h3>";
|
$result = "<h3 class=suc>".__('Successfully deleted')."</h3>";
|
||||||
else
|
else
|
||||||
$result = "<h3 class=error>".__('Not deleted. Error deleting data')."</h3>";
|
$result = "<h3 class=error>".__('Not deleted. Error deleting data')."</h3>";
|
||||||
|
|
||||||
$result = db_process_sql_delete("tgraph", array('id_graph' =>$id));
|
$result = db_process_sql_delete("tgraph", array('id_graph' =>$id));
|
||||||
|
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -104,8 +107,8 @@ if ($multiple_delete) {
|
|||||||
|
|
||||||
foreach ($ids as $id) {
|
foreach ($ids as $id) {
|
||||||
$result = db_process_sql_delete ('tgraph',
|
$result = db_process_sql_delete ('tgraph',
|
||||||
array ('id_graph' => $id));
|
array('id_graph' => $id));
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
db_process_sql_rollback();
|
db_process_sql_rollback();
|
||||||
break;
|
break;
|
||||||
@ -116,8 +119,10 @@ if ($multiple_delete) {
|
|||||||
db_process_sql_commit();
|
db_process_sql_commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result !== false) $result = true;
|
if ($result !== false)
|
||||||
else $result = false;
|
$result = true;
|
||||||
|
else
|
||||||
|
$result = false;
|
||||||
|
|
||||||
$str_ids = implode (',', $ids);
|
$str_ids = implode (',', $ids);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
@ -135,7 +140,7 @@ if ($multiple_delete) {
|
|||||||
|
|
||||||
$graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR");
|
$graphs = custom_graphs_get_user ($config['id_user'], false, true, "RR");
|
||||||
|
|
||||||
if (! empty ($graphs)) {
|
if (!empty ($graphs)) {
|
||||||
$table->width = '98%';
|
$table->width = '98%';
|
||||||
$tale->class = 'databox_frame';
|
$tale->class = 'databox_frame';
|
||||||
$table->align = array ();
|
$table->align = array ();
|
||||||
|
@ -2146,17 +2146,19 @@ function grafico_eventos_total($filter = "", $width = 320, $height = 200) {
|
|||||||
$legend = array ();
|
$legend = array ();
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
|
||||||
$sql = "SELECT criticity, COUNT(id_evento) events FROM tevento GROUP BY criticity ORDER BY events DESC";
|
$sql = "SELECT criticity, COUNT(id_evento) events
|
||||||
|
FROM tevento
|
||||||
|
GROUP BY criticity ORDER BY events DESC";
|
||||||
|
|
||||||
$criticities = db_get_all_rows_sql ($sql, false, false);
|
$criticities = db_get_all_rows_sql ($sql, false, false);
|
||||||
|
|
||||||
if(empty($criticities)) {
|
if (empty($criticities)) {
|
||||||
$criticities = array();
|
$criticities = array();
|
||||||
$colors = array();
|
$colors = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($criticities as $cr) {
|
foreach ($criticities as $cr) {
|
||||||
switch($cr['criticity']) {
|
switch ($cr['criticity']) {
|
||||||
case EVENT_CRIT_MAINTENANCE:
|
case EVENT_CRIT_MAINTENANCE:
|
||||||
$data[__('Maintenance')] = $cr['events'];
|
$data[__('Maintenance')] = $cr['events'];
|
||||||
$colors[__('Maintenance')] = COL_MAINTENANCE;
|
$colors[__('Maintenance')] = COL_MAINTENANCE;
|
||||||
@ -2395,13 +2397,13 @@ function graph_graphic_agentevents ($id_agent, $width, $height, $period = 0, $ho
|
|||||||
'utimestamp > '.$bottom,
|
'utimestamp > '.$bottom,
|
||||||
'utimestamp < '.$top), 'criticity, utimestamp');
|
'utimestamp < '.$top), 'criticity, utimestamp');
|
||||||
|
|
||||||
if (!empty($event['utimestamp'])){
|
if (!empty($event['utimestamp'])) {
|
||||||
$data[$cont]['utimestamp'] = $periodtime;
|
$data[$cont]['utimestamp'] = $periodtime;
|
||||||
switch ($event['criticity']) {
|
switch ($event['criticity']) {
|
||||||
case 3:
|
case EVENT_CRIT_WARNING:
|
||||||
$data[$cont]['data'] = 2;
|
$data[$cont]['data'] = 2;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case EVENT_CRIT_CRITICAL:
|
||||||
$data[$cont]['data'] = 3;
|
$data[$cont]['data'] = 3;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -1724,8 +1724,9 @@ function ui_print_module_warn_value ($max_warning, $min_warning, $str_warning, $
|
|||||||
|
|
||||||
$data .= " - ";
|
$data .= " - ";
|
||||||
|
|
||||||
if ($max_critical != $min_critical){
|
if ($max_critical != $min_critical) {
|
||||||
$data .= format_for_graph($max_critical) ."/". format_for_graph ($min_critical);
|
$data .= format_for_graph($max_critical) . "/" .
|
||||||
|
format_for_graph ($min_critical);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$data .= __("N/A");
|
$data .= __("N/A");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user