2013-01-28 Sergio Martin <sergio.martin@artica.es>

* pandoradb_data.sql
	pandoradb.data.postgreSQL.sql
	pandoradb.data.oracle.sql: Modified the alerts default data  to
	have basic wizard access by default

	* godmode/alerts/configure_alert_template.php: Modify the 
	alert templates form to define wizard access only in metaconsole
	and nowizard or respect the current value from the normal console

	* include/javascript/jquery.pandora.js: Add a hack to
	the license modal window to use it from metaconsole too

	* operation/events/events.build_table.php
	operation/events/events_list.php
	operation/events/events.php: Encapsulate the table build
	of the events list to reuse it from other views like tactical
	view in metaconsole



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7535 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2013-01-28 13:14:27 +00:00
parent 505e83f412
commit 091fb69629
9 changed files with 574 additions and 497 deletions

View File

@ -1,3 +1,23 @@
2013-01-28 Sergio Martin <sergio.martin@artica.es>
* pandoradb_data.sql
pandoradb.data.postgreSQL.sql
pandoradb.data.oracle.sql: Modified the alerts default data to
have basic wizard access by default
* godmode/alerts/configure_alert_template.php: Modify the
alert templates form to define wizard access only in metaconsole
and nowizard or respect the current value from the normal console
* include/javascript/jquery.pandora.js: Add a hack to
the license modal window to use it from metaconsole too
* operation/events/events.build_table.php
operation/events/events_list.php
operation/events/events.php: Encapsulate the table build
of the events list to reuse it from other views like tactical
view in metaconsole
2013-01-28 Miguel de Dios <miguel.dedios@artica.es>
* godmode/massive/massive_edit_modules.php: fixed the warning

View File

@ -378,7 +378,7 @@ $field2_recovery = '';
$field3_recovery = '';
$matches = true;
$id_group = 0;
$wizard_level = -1;
$wizard_level = 'nowizard';
if ($create_template) {
$name = (string) get_parameter ('name');
@ -648,22 +648,24 @@ else {
$table->data[2][1] = html_print_select (get_priorities (), 'priority',
$priority, '', 0, 0, true, false, false);
$table->data[2][0] = __('Wizard level');
$wizard_levels = array('nowizard' => __('No wizard'),
'basic' => __('Basic'),
'advanced' => __('Advanced'),
//'custom' => __('Custom'),
);
$table->data[2][1] = html_print_select($wizard_levels,'wizard_level',$wizard_level,'','',-1,true, false, false);
if(defined('METACONSOLE')) {
$table->data[3][0] = __('Wizard level');
$wizard_levels = array('basic' => __('Basic'),
'advanced' => __('Advanced') );
$table->data[3][1] = html_print_select($wizard_levels,'wizard_level',$wizard_level,'','',-1,true, false, false);
}
else {
$table->data[2][1] .= html_print_input_hidden('wizard_level',$wizard_level,true);
}
$table->data[3][0] = __('Condition type');
$table->data[3][1] = html_print_select (alerts_get_alert_templates_types (), 'type',
$table->data[4][0] = __('Condition type');
$table->data[4][1] = html_print_select (alerts_get_alert_templates_types (), 'type',
$type, '', __('Select'), 0, true, false, false);
$table->data[3][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
$table->data[3][1] .= '&nbsp;'.html_print_checkbox ('matches_value', 1, $matches, true);
$table->data[3][1] .= html_print_label (__('Trigger when matches the value'),
$table->data[4][1] .= '<span id="matches_value" '.($show_matches ? '' : 'style="display: none"').'>';
$table->data[4][1] .= '&nbsp;'.html_print_checkbox ('matches_value', 1, $matches, true);
$table->data[4][1] .= html_print_label (__('Trigger when matches the value'),
'checkbox-matches_value', true);
$table->data[3][1] .= '</span>';
$table->data[4][1] .= '</span>';
$table->data['value'][0] = __('Value');
$table->data['value'][1] = html_print_input_text ('value', $value, '',

View File

@ -109,7 +109,12 @@ $(document).ready (function () {
$("a#dialog_license_info").click (function () {
jQuery.get ("ajax.php",
var ajax_doc = "ajax.php";
if($('#hidden-metaconsole_activated').val() == 1) {
ajax_doc = "../../" + ajax_doc;
}
jQuery.get (ajax_doc,
{"page": "extensions/update_manager",
"get_license_info": "1"},
function (data, status) {

View File

@ -0,0 +1,518 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2010 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
$table->width = '100%';
$table->id = "eventtable";
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = "databox";
$table->head = array ();
$table->data = array ();
//fields that the user has selected to show
$show_fields = explode (',', $config['event_fields']);
//headers
$i = 0;
$table->head[$i] = __('ID');
$table->align[$i] = 'center';
$i++;
if (in_array('server_name', $show_fields)) {
$table->head[$i] = __('Server');
$table->align[$i] = 'center';
$i++;
}
if (in_array('estado', $show_fields)) {
$table->head[$i] = __('Status');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_evento', $show_fields)) {
$table->head[$i] = __('Event ID');
$table->align[$i] = 'center';
$i++;
}
if (in_array('evento', $show_fields)) {
$table->head[$i] = __('Event Name');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_agente', $show_fields)) {
$table->head[$i] = __('Agent name');
$table->align[$i] = 'center';
$i++;
}
if (in_array('timestamp', $show_fields)) {
$table->head[$i] = __('Timestamp');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_usuario', $show_fields)) {
$table->head[$i] = __('User');
$table->align[$i] = 'center';
$i++;
}
if (in_array('owner_user', $show_fields)) {
$table->head[$i] = __('Owner');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_grupo', $show_fields)) {
$table->head[$i] = __('Group');
$table->align[$i] = 'center';
$i++;
}
if (in_array('event_type', $show_fields)) {
$table->head[$i] = __('Event type');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_agentmodule', $show_fields)) {
$table->head[$i] = __('Agent Module');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_alert_am', $show_fields)) {
$table->head[$i] = __('Alert');
$table->align[$i] = 'center';
$i++;
}
if (in_array('criticity', $show_fields)) {
$table->head[$i] = __('Severity');
$table->align[$i] = 'center';
$i++;
}
if (in_array('user_comment', $show_fields)) {
$table->head[$i] = __('Comment');
$table->align[$i] = 'center';
$i++;
}
if (in_array('tags', $show_fields)) {
$table->head[$i] = __('Tags');
$table->align[$i] = 'center';
$i++;
}
if (in_array('source', $show_fields)) {
$table->head[$i] = __('Source');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_extra', $show_fields)) {
$table->head[$i] = __('Extra ID');
$table->align[$i] = 'center';
$i++;
}
if (in_array('ack_utimestamp', $show_fields)) {
$table->head[$i] = __('ACK Timestamp');
$table->align[$i] = 'center';
$i++;
}
if ($i != 0 && $allow_action) {
$table->head[$i] = __('Action');
$table->align[$i] = 'center';
$table->size[$i] = '80px';
$i++;
if (check_acl ($config["id_user"], 0, "EW") == 1) {
$table->head[$i] = html_print_checkbox ("all_validate_box", "1", false, true);
$table->align[$i] = 'center';
}
}
if($meta) {
// Get info of the all servers to use it on hash auth
$servers_url_hash = metaconsole_get_servers_url_hash();
$servers = metaconsole_get_servers();
}
$idx = 0;
//Arrange data. We already did ACL's in the query
foreach ($result as $event) {
$data = array ();
if($meta) {
$event['server_url_hash'] = $servers_url_hash[$event['server_id']];
$event['server_url'] = $servers[$event['server_id']]['server_url'];
$event['server_name'] = $servers[$event['server_id']]['server_name'];
}
// Clean url from events and store in array
$event['clean_tags'] = events_clean_tags($event['tags']);
//First pass along the class of this row
$myclass = get_priority_class ($event["criticity"]);
$table->rowclass[] = $myclass;
//print status
$estado = $event["estado"];
// Colored box
switch($estado) {
case 0:
$img_st = "images/star.png";
$title_st = __('New event');
break;
case 1:
$img_st = "images/tick.png";
$title_st = __('Event validated');
break;
case 2:
$img_st = "images/hourglass.png";
$title_st = __('Event in process');
break;
}
$i = 0;
$data[$i] = "#".$event["id_evento"];
// Pass grouped values in hidden fields to use it from modal window
if($group_rep) {
$similar_ids = $event['similar_ids'];
$timestamp_first = $event['timestamp_rep_min'];
$timestamp_last = $event['timestamp_rep'];
}
else {
$similar_ids = $event["id_evento"];
$timestamp_first = $event['utimestamp'];
$timestamp_last = $event['utimestamp'];
}
// Store group data to show in extended view
$data[$i] .= html_print_input_hidden('similar_ids_' . $event["id_evento"], $similar_ids, true);
$data[$i] .= html_print_input_hidden('timestamp_first_' . $event["id_evento"], $timestamp_first, true);
$data[$i] .= html_print_input_hidden('timestamp_last_' . $event["id_evento"], $timestamp_last, true);
// Store server id if is metaconsole. 0 otherwise
if($meta) {
$server_id = $event['server_id'];
// If meta activated, propagate the id of the event on node (source id)
$data[$i] .= html_print_input_hidden('source_id_' . $event["id_evento"], $event['id_source_event'], true);
}
else {
$server_id = 0;
}
$data[$i] .= html_print_input_hidden('server_id_' . $event["id_evento"], $server_id, true);
if (empty($event['event_rep'])) {
$event['event_rep'] = 0;
}
$data[$i] .= html_print_input_hidden('event_rep_'.$event["id_evento"], $event['event_rep'], true);
// Store concat comments to show in extended view
$data[$i] .= html_print_input_hidden('user_comment_'.$event["id_evento"], base64_encode($event['user_comment']), true);
$i++;
if (in_array('server_name',$show_fields)) {
if($meta) {
$data[$i] = "<a href='" . $event["server_url"] . "/index.php?sec=estado&sec2=operation/agentes/group_view" . $event['server_url_hash'] . "'>" . $event["server_name"] . "</a>";
}
else {
$data[$i] = db_get_value('name','tserver');
}
$i++;
}
if (in_array('estado',$show_fields)) {
$data[$i] = html_print_image ($img_st, true,
array ("class" => "image_status",
"width" => 16,
"height" => 16,
"title" => $title_st,
"id" => 'status_img_'.$event["id_evento"]));
$i++;
}
if (in_array('id_evento',$show_fields)) {
$data[$i] = $event["id_evento"];
$i++;
}
switch ($event["criticity"]) {
default:
case 0:
$img_sev = "images/status_sets/default/severity_maintenance.png";
break;
case 1:
$img_sev = "images/status_sets/default/severity_informational.png";
break;
case 2:
$img_sev = "images/status_sets/default/severity_normal.png";
break;
case 3:
$img_sev = "images/status_sets/default/severity_warning.png";
break;
case 4:
$img_sev = "images/status_sets/default/severity_critical.png";
break;
case 5:
$img_sev = "images/status_sets/default/severity_minor.png";
break;
case 6:
$img_sev = "images/status_sets/default/severity_major.png";
break;
}
if (in_array('evento', $show_fields)) {
// Event description
$data[$i] = '<span title="'.$event["evento"].'" class="f9">';
if($allow_action) {
$data[$i] .= '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
}
$data[$i] .= '<span class="'.$myclass.'" style="font-size: 7.5pt;">' . ui_print_truncate_text (io_safe_output($event["evento"]), 160) . '</span>';
if($allow_action) {
$data[$i] .= '</a>';
}
$data[$i] .= '</span>';
$i++;
}
if (in_array('id_agente', $show_fields)) {
$data[$i] = '<span class="'.$myclass.'">';
if ($event["id_agente"] > 0) {
// Agent name
if($meta) {
$data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">';
$data[$i] .= $event["agent_name"];
$data[$i] .= "</a></b>";
}
else {
$data[$i] .= ui_print_agent_name ($event["id_agente"], true);
}
}
else {
$data[$i] .= '';
}
$data[$i] .= '</span>';
$i++;
}
if (in_array('timestamp', $show_fields)) {
//Time
$data[$i] = '<span class="'.$myclass.'">';
if ($group_rep == 1) {
$data[$i] .= ui_print_timestamp ($event['timestamp_rep'], true);
}
else {
$data[$i] .= ui_print_timestamp ($event["timestamp"], true);
}
$data[$i] .= '</span>';
$i++;
}
if (in_array('owner_user',$show_fields)) {
$owner_name = db_get_value('fullname', 'tusuario', 'id_user', $event['owner_user']);
$data[$i] = $owner_name;
$i++;
}
if (in_array('id_usuario',$show_fields)) {
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
$data[$i] = $user_name;
$i++;
}
if (in_array('id_grupo',$show_fields)) {
if($meta) {
$data[$i] = $event['group_name'];
}
else {
$id_group = $event["id_grupo"];
$group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
if ($id_group == 0) {
$group_name = __('All');
}
$data[$i] = $group_name;
}
$i++;
}
if (in_array('event_type',$show_fields)) {
$data[$i] = events_print_type_description($event["event_type"], true);
$i++;
}
if (in_array('id_agentmodule',$show_fields)) {
if($meta) {
$data[$i] = '<b><a href="'.$event["server_url"].'/index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente=' . $event["id_agente"] . $event["server_url_hash"] . '">';
$data[$i] .= $event["module_name"];
$data[$i] .= "</a></b>";
}
else {
$data[$i] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=data">'
. db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]).'</a>';
}
$i++;
}
if (in_array('id_alert_am',$show_fields)) {
if($meta) {
$data[$i] = $event["alert_template_name"];
}
else {
if ($event["id_alert_am"] != 0) {
$sql = 'SELECT name
FROM talert_templates
WHERE id IN (SELECT id_alert_template
FROM talert_template_modules
WHERE id = ' . $event["id_alert_am"] . ');';
$templateName = db_get_sql($sql);
$data[$i] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=alert">'.$templateName.'</a>';
}
else {
$data[$i] = '';
}
}
$i++;
}
if (in_array('criticity',$show_fields)) {
$data[$i] = get_priority_name ($event["criticity"]);
$i++;
}
if (in_array('user_comment',$show_fields)) {
$data[$i] = '<span id="comment_header_' . $event['id_evento'] . '">' .ui_print_truncate_text(strip_tags($event["user_comment"])) . '</span>';
$i++;
}
if (in_array('tags',$show_fields)) {
$data[$i] = tags_get_tags_formatted($event['tags']);
$i++;
}
if (in_array('source',$show_fields)) {
$data[$i] = $event["source"];
$i++;
}
if (in_array('id_extra',$show_fields)) {
$data[$i] = $event["id_extra"];
$i++;
}
if (in_array('ack_utimestamp',$show_fields)) {
if($event["ack_utimestamp"] == 0){
$data[$i] = '';
}
else {
$data[$i] = date ($config["date_format"], $event['ack_utimestamp']);
}
$i++;
}
if ($i != 0 && $allow_action) {
//Actions
$data[$i] = '';
// Validate event
if (($event["estado"] != 1) && (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1)) {
$data[$i] .= '<a href="javascript:validate_event_advanced('.$event["id_evento"].', 1)" id="validate-'.$event["id_evento"].'">';
$data[$i] .= html_print_image ("images/ok.png", true,
array ("title" => __('Validate event')));
$data[$i] .= '</a>&nbsp;';
}
// Delete event
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
if($event['estado'] != 2) {
$data[$i] .= '<a class="delete_event" href="javascript:" id="delete-'.$event['id_evento'].'">';
$data[$i] .= html_print_image ("images/cross.png", true,
array ("title" => __('Delete event'), "id" => 'delete_cross_' . $event['id_evento']));
$data[$i] .= '</a>&nbsp;';
}
else {
$data[$i] .= html_print_image ("images/cross.disabled.png", true,
array ("title" => __('Is not allowed delete events in process'))).'&nbsp;';
}
}
$data[$i] .= '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
$data[$i] .= html_print_input_hidden('event_title_'.$event["id_evento"], "#".$event["id_evento"]." - ".$event["evento"], true);
$data[$i] .= html_print_image ("images/eye.png", true,
array ("title" => __('Show more')));
$data[$i] .= '</a>&nbsp;';
$i++;
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
//Checkbox
// Class 'candeleted' must be the fist class to be parsed from javascript. Dont change
$data[$i] = html_print_checkbox_extended ("validate_ids[]", $event['id_evento'], false, false, false, 'class="candeleted chk_val"', true);
}
else if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1) {
//Checkbox
$data[$i] = html_print_checkbox_extended ("validate_ids[]", $event['id_evento'], false, false, false, 'class="chk_val"', true);
}
else if (isset($table->header[$i]) || true) {
$data[$i] = '';
}
}
array_push ($table->data, $data);
$idx++;
}
echo '<div id="events_list">';
if (!empty ($table->data)) {
echo '<div style="clear:both"></div>';
if($allow_pagination) {
ui_pagination ($total_events, $url, $offset, $pagination);
}
if($allow_action) {
echo '<form method="post" id="form_events" action="'.$url.'">';
echo "<input type='hidden' name='delete' id='hidden_delete_events' value='0' />";
}
html_print_table ($table);
if($allow_action) {
echo '<div style="width:'.$table->width.';" class="action-buttons">';
if (tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"');
}
if (tags_check_acl ($config["id_user"], 0,"EM", $event['clean_tags']) == 1) {
html_print_button(__('Delete selected'), 'delete_button', false, 'delete_selected();', 'class="sub delete"');
?>
<script type="text/javascript">
function delete_selected() {
if(confirm('<?php echo __('Are you sure?'); ?>')) {
$("#hidden_delete_events").val(1);
$("#form_events").submit();
}
}
function validate_selected() {
$(".chk_val").each(function() {
if($(this).is(":checked")) {
validate_event_advanced($(this).val(),1);
}
});
}
</script>
<?php
}
echo '</div>';
echo '</form>';
}
}
else {
echo '<div class="nf">'.__('No events').'</div>';
}
echo '</div>';
?>

View File

@ -41,7 +41,7 @@ if(enterprise_installed() && defined("METACONSOLE")) {
// Get the history mode
$history = (bool) get_parameter('history', 0);
if(isset($config['event_replication']) && $config['event_replication'] == 1) {
if(isset($config['event_replication']) && $config['event_replication'] == 1 && !$meta) {
db_pandora_audit("ACL Violation",
"Trying to access event viewer. View disabled due event replication.");
ui_print_info_message('Event viewer is disabled due event replication. For more information, please contact with the administrator');

View File

@ -460,480 +460,12 @@ if (empty ($result)) {
$result = array ();
}
$table->width = '100%';
$table->id = "eventtable";
$table->cellpadding = 4;
$table->cellspacing = 4;
$table->class = "databox";
$table->head = array ();
$table->data = array ();
$allow_action = true;
$allow_pagination = true;
//fields that the user has selected to show
$show_fields = explode (',', $config['event_fields']);
require('events.build_table.php');
//headers
$i = 0;
$table->head[$i] = __('ID');
$table->align[$i] = 'center';
$i++;
if (in_array('server_name', $show_fields)) {
$table->head[$i] = __('Server');
$table->align[$i] = 'center';
$i++;
}
if (in_array('estado', $show_fields)) {
$table->head[$i] = __('Status');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_evento', $show_fields)) {
$table->head[$i] = __('Event ID');
$table->align[$i] = 'center';
$i++;
}
if (in_array('evento', $show_fields)) {
$table->head[$i] = __('Event Name');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_agente', $show_fields)) {
$table->head[$i] = __('Agent name');
$table->align[$i] = 'center';
$i++;
}
if (in_array('timestamp', $show_fields)) {
$table->head[$i] = __('Timestamp');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_usuario', $show_fields)) {
$table->head[$i] = __('User');
$table->align[$i] = 'center';
$i++;
}
if (in_array('owner_user', $show_fields)) {
$table->head[$i] = __('Owner');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_grupo', $show_fields)) {
$table->head[$i] = __('Group');
$table->align[$i] = 'center';
$i++;
}
if (in_array('event_type', $show_fields)) {
$table->head[$i] = __('Event type');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_agentmodule', $show_fields)) {
$table->head[$i] = __('Agent Module');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_alert_am', $show_fields)) {
$table->head[$i] = __('Alert');
$table->align[$i] = 'center';
$i++;
}
if (in_array('criticity', $show_fields)) {
$table->head[$i] = __('Severity');
$table->align[$i] = 'center';
$i++;
}
if (in_array('user_comment', $show_fields)) {
$table->head[$i] = __('Comment');
$table->align[$i] = 'center';
$i++;
}
if (in_array('tags', $show_fields)) {
$table->head[$i] = __('Tags');
$table->align[$i] = 'center';
$i++;
}
if (in_array('source', $show_fields)) {
$table->head[$i] = __('Source');
$table->align[$i] = 'center';
$i++;
}
if (in_array('id_extra', $show_fields)) {
$table->head[$i] = __('Extra ID');
$table->align[$i] = 'center';
$i++;
}
if (in_array('ack_utimestamp', $show_fields)) {
$table->head[$i] = __('ACK Timestamp');
$table->align[$i] = 'center';
$i++;
}
if ($i != 0) {
$table->head[$i] = __('Action');
$table->align[$i] = 'center';
$table->size[$i] = '80px';
$i++;
if (check_acl ($config["id_user"], 0, "EW") == 1) {
$table->head[$i] = html_print_checkbox ("all_validate_box", "1", false, true);
$table->align[$i] = 'center';
}
}
$idx = 0;
//Arrange data. We already did ACL's in the query
foreach ($result as $event) {
$data = array ();
// Clean url from events and store in array
$event['clean_tags'] = events_clean_tags($event['tags']);
//First pass along the class of this row
$myclass = get_priority_class ($event["criticity"]);
$table->rowclass[] = $myclass;
//print status
$estado = $event["estado"];
// Colored box
switch($estado) {
case 0:
$img_st = "images/star.png";
$title_st = __('New event');
break;
case 1:
$img_st = "images/tick.png";
$title_st = __('Event validated');
break;
case 2:
$img_st = "images/hourglass.png";
$title_st = __('Event in process');
break;
}
$i = 0;
$data[$i] = "#".$event["id_evento"];
// Pass grouped values in hidden fields to use it from modal window
if($group_rep) {
$similar_ids = $event['similar_ids'];
$timestamp_first = $event['timestamp_rep_min'];
$timestamp_last = $event['timestamp_rep'];
}
else {
$similar_ids = $event["id_evento"];
$timestamp_first = $event['utimestamp'];
$timestamp_last = $event['utimestamp'];
}
// Store group data to show in extended view
$data[$i] .= html_print_input_hidden('similar_ids_' . $event["id_evento"], $similar_ids, true);
$data[$i] .= html_print_input_hidden('timestamp_first_' . $event["id_evento"], $timestamp_first, true);
$data[$i] .= html_print_input_hidden('timestamp_last_' . $event["id_evento"], $timestamp_last, true);
// Store server id if is metaconsole. 0 otherwise
if($meta) {
$server_id = $event['server_id'];
// If meta activated, propagate the id of the event on node (source id)
$data[$i] .= html_print_input_hidden('source_id_' . $event["id_evento"], $event['id_source_event'], true);
}
else {
$server_id = 0;
}
$data[$i] .= html_print_input_hidden('server_id_' . $event["id_evento"], $server_id, true);
if (empty($event['event_rep'])) {
$event['event_rep'] = 0;
}
$data[$i] .= html_print_input_hidden('event_rep_'.$event["id_evento"], $event['event_rep'], true);
// Store concat comments to show in extended view
$data[$i] .= html_print_input_hidden('user_comment_'.$event["id_evento"], base64_encode($event['user_comment']), true);
$i++;
if (in_array('server_name',$show_fields)) {
if($meta) {
$data[$i] = db_get_value('server_name','tmetaconsole_setup','id',$event["server_id"]);
}
else {
$data[$i] = db_get_value('name','tserver');
}
$i++;
}
if (in_array('estado',$show_fields)) {
$data[$i] = html_print_image ($img_st, true,
array ("class" => "image_status",
"width" => 16,
"height" => 16,
"title" => $title_st,
"id" => 'status_img_'.$event["id_evento"]));
$i++;
}
if (in_array('id_evento',$show_fields)) {
$data[$i] = $event["id_evento"];
$i++;
}
switch ($event["criticity"]) {
default:
case 0:
$img_sev = "images/status_sets/default/severity_maintenance.png";
break;
case 1:
$img_sev = "images/status_sets/default/severity_informational.png";
break;
case 2:
$img_sev = "images/status_sets/default/severity_normal.png";
break;
case 3:
$img_sev = "images/status_sets/default/severity_warning.png";
break;
case 4:
$img_sev = "images/status_sets/default/severity_critical.png";
break;
case 5:
$img_sev = "images/status_sets/default/severity_minor.png";
break;
case 6:
$img_sev = "images/status_sets/default/severity_major.png";
break;
}
if (in_array('evento', $show_fields)) {
// Event description
$data[$i] = '<span title="'.$event["evento"].'" class="f9">';
$data[$i] .= '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
$data[$i] .= '<span class="'.$myclass.'" style="font-size: 7.5pt;">' . ui_print_truncate_text (io_safe_output($event["evento"]), 160) . '</span>';
$data[$i] .= '</a></span>';
$i++;
}
if (in_array('id_agente', $show_fields)) {
$data[$i] = '<span class="'.$myclass.'">';
if ($event["id_agente"] > 0) {
// Agent name
if($meta) {
$data[$i] .= $event["agent_name"];
}
else {
$data[$i] .= ui_print_agent_name ($event["id_agente"], true);
}
}
else {
$data[$i] .= '';
}
$data[$i] .= '</span>';
$i++;
}
if (in_array('timestamp', $show_fields)) {
//Time
$data[$i] = '<span class="'.$myclass.'">';
if ($group_rep == 1) {
$data[$i] .= ui_print_timestamp ($event['timestamp_rep'], true);
}
else {
$data[$i] .= ui_print_timestamp ($event["timestamp"], true);
}
$data[$i] .= '</span>';
$i++;
}
if (in_array('owner_user',$show_fields)) {
$owner_name = db_get_value('fullname', 'tusuario', 'id_user', $event['owner_user']);
$data[$i] = $owner_name;
$i++;
}
if (in_array('id_usuario',$show_fields)) {
$user_name = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
$data[$i] = $user_name;
$i++;
}
if (in_array('id_grupo',$show_fields)) {
if($meta) {
$data[$i] = $event['group_name'];
}
else {
$id_group = $event["id_grupo"];
$group_name = db_get_value('nombre', 'tgrupo', 'id_grupo', $id_group);
if ($id_group == 0) {
$group_name = __('All');
}
$data[$i] = $group_name;
}
$i++;
}
if (in_array('event_type',$show_fields)) {
$data[$i] = events_print_type_description($event["event_type"], true);
$i++;
}
if (in_array('id_agentmodule',$show_fields)) {
if($meta) {
$data[$i] = $event["module_name"];
}
else {
$data[$i] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=data">'
. db_get_value('nombre', 'tagente_modulo', 'id_agente_modulo', $event["id_agentmodule"]).'</a>';
}
$i++;
}
if (in_array('id_alert_am',$show_fields)) {
if($meta) {
$data[$i] = $event["alert_template_name"];
}
else {
if ($event["id_alert_am"] != 0) {
$sql = 'SELECT name
FROM talert_templates
WHERE id IN (SELECT id_alert_template
FROM talert_template_modules
WHERE id = ' . $event["id_alert_am"] . ');';
$templateName = db_get_sql($sql);
$data[$i] = '<a href="index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=alert">'.$templateName.'</a>';
}
else {
$data[$i] = '';
}
}
$i++;
}
if (in_array('criticity',$show_fields)) {
$data[$i] = get_priority_name ($event["criticity"]);
$i++;
}
if (in_array('user_comment',$show_fields)) {
$data[$i] = '<span id="comment_header_' . $event['id_evento'] . '">' .ui_print_truncate_text(strip_tags($event["user_comment"])) . '</span>';
$i++;
}
if (in_array('tags',$show_fields)) {
$data[$i] = tags_get_tags_formatted($event['tags']);
$i++;
}
if (in_array('source',$show_fields)) {
$data[$i] = $event["source"];
$i++;
}
if (in_array('id_extra',$show_fields)) {
$data[$i] = $event["id_extra"];
$i++;
}
if (in_array('ack_utimestamp',$show_fields)) {
if($event["ack_utimestamp"] == 0){
$data[$i] = '';
}
else {
$data[$i] = date ($config["date_format"], $event['ack_utimestamp']);
}
$i++;
}
if ($i != 0) {
//Actions
$data[$i] = '';
// Validate event
if (($event["estado"] != 1) && (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1)) {
$data[$i] .= '<a href="javascript:validate_event_advanced('.$event["id_evento"].', 1)" id="validate-'.$event["id_evento"].'">';
$data[$i] .= html_print_image ("images/ok.png", true,
array ("title" => __('Validate event')));
$data[$i] .= '</a>&nbsp;';
}
// Delete event
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
if($event['estado'] != 2) {
$data[$i] .= '<a class="delete_event" href="javascript:" id="delete-'.$event['id_evento'].'">';
$data[$i] .= html_print_image ("images/cross.png", true,
array ("title" => __('Delete event'), "id" => 'delete_cross_' . $event['id_evento']));
$data[$i] .= '</a>&nbsp;';
}
else {
$data[$i] .= html_print_image ("images/cross.disabled.png", true,
array ("title" => __('Is not allowed delete events in process'))).'&nbsp;';
}
}
$data[$i] .= '<a href="javascript:" onclick="show_event_dialog(' . $event["id_evento"] . ', '.$group_rep.');">';
$data[$i] .= html_print_input_hidden('event_title_'.$event["id_evento"], "#".$event["id_evento"]." - ".$event["evento"], true);
$data[$i] .= html_print_image ("images/eye.png", true,
array ("title" => __('Show more')));
$data[$i] .= '</a>&nbsp;';
$i++;
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags']) == 1) {
//Checkbox
// Class 'candeleted' must be the fist class to be parsed from javascript. Dont change
$data[$i] = html_print_checkbox_extended ("validate_ids[]", $event['id_evento'], false, false, false, 'class="candeleted chk_val"', true);
}
else if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EW", $event['clean_tags']) == 1) {
//Checkbox
$data[$i] = html_print_checkbox_extended ("validate_ids[]", $event['id_evento'], false, false, false, 'class="chk_val"', true);
}
else if (isset($table->header[$i]) || true) {
$data[$i] = '';
}
array_push ($table->data, $data);
}
$idx++;
}
echo '<div id="events_list">';
if (!empty ($table->data)) {
echo '<div style="clear:both"></div>';
ui_pagination ($total_events, $url, $offset, $pagination);
echo '<form method="post" id="form_events" action="'.$url.'">';
echo "<input type='hidden' name='delete' id='hidden_delete_events' value='0' />";
html_print_table ($table);
echo '<div style="width:'.$table->width.';" class="action-buttons">';
if (tags_check_acl ($config["id_user"], 0, "EW", $event['clean_tags']) == 1) {
html_print_button(__('Validate selected'), 'validate_button', false, 'validate_selected();', 'class="sub ok"');
}
if (tags_check_acl ($config["id_user"], 0,"EM", $event['clean_tags']) == 1) {
html_print_button(__('Delete selected'), 'delete_button', false, 'delete_selected();', 'class="sub delete"');
?>
<script type="text/javascript">
function delete_selected() {
if(confirm('<?php echo __('Are you sure?'); ?>')) {
$("#hidden_delete_events").val(1);
$("#form_events").submit();
}
}
function validate_selected() {
$(".chk_val").each(function() {
if($(this).is(":checked")) {
validate_event_advanced($(this).val(),1);
}
});
}
</script>
<?php
}
echo '</div></form>';
}
else {
echo '<div class="nf">'.__('No events').'</div>';
}
echo '</div>';
unset ($table);
unset($table);
// Values to be used from javascript library
html_print_input_hidden('ajax_file', ui_get_full_url("ajax.php", false, false, false));

View File

@ -1126,9 +1126,9 @@ END;;
BEGIN
LOCK TABLE talert_templates IN EXCLUSIVE MODE;
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day) VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0);
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day) VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','',' ','max_min','',1,0.00,1.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,0,' ',' ',1,0,0);
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day) VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0);
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0,'basic');
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','',' ','max_min','',1,0.00,1.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,0,' ',' ',1,0,0,'basic');
INSERT INTO talert_templates (id, name, description, id_alert_action, field1, field2, field3, type, value, matches_value, max_value, min_value, time_threshold, max_alerts, min_alerts, time_from, time_to, monday, tuesday, wednesday, thursday, friday, saturday, sunday, recovery_notify, field2_recovery, field3_recovery, priority, id_group, special_day, wizard_level) VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,to_date('12:00:00','hh24:mi:ss'),to_date('12:00:00','hh24:mi:ss'),1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0,'basic');
COMMIT;
END;;

View File

@ -1036,9 +1036,9 @@ INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (3,'Pandora&#x20;FMS&#x20;Event',3,'','','',0,0);
SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions)));
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day") VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0);
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day") VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','','','max_min','',1,0.00,1.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,0,'','',1,0,0);
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day") VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0);
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day", "wizard_level") VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0,'basic');
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day", "wizard_level") VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','','','max_min','',1,0.00,1.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,0,'','',1,0,0,'basic');
INSERT INTO "talert_templates" ("id", "name", "description", "id_alert_action", "field1", "field2", "field3", "type", "value", "matches_value", "max_value", "min_value", "time_threshold", "max_alerts", "min_alerts", "time_from", "time_to", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday", "recovery_notify", "field2_recovery", "field3_recovery", "priority", "id_group", "special_day", "wizard_level") VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0,'basic');
SELECT setval('talert_templates_id_seq', (SELECT (SELECT MAX(id) FROM talert_templates)));
-- treport_custom_sql Data

View File

@ -995,11 +995,11 @@ INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (3,'Pandora&#x20;FMS&#x20;Event',3,'','','',0,0);
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`) VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0);
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`, `wizard_level`) VALUES (1,'Critical&#x20;condition','This is a generic alert template to fire on condition CRITICAL',1,'','','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been fired because a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n','critical','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA] Alert RECOVERED for CRITICAL status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS\r\n\r\nThis alert has been RECOVERED from a CRITICAL condition in one of your monitored items:\r\n\r\nAgent : _agent_\r\nModule: _module_\r\nModule description: _moduledescription_\r\nTimestamp _timestamp_\r\nCurrent value: _data_\r\n\r\nThanks for your time.\r\n\r\nBest regards\r\nPandora FMS\r\n',4,0,0,'basic');
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`) VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','','','max_min','',1,0.00,1.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,0,'','',1,0,0);
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`, `wizard_level`) VALUES (2,'Manual&#x20;alert','This is a template used to fire manual alerts, condition defined here never will be executed. Use this template to assign to your actions/commands used to do remote management (Agent restart, execute commands on server, etc).',NULL,'','','','max_min','',1,0.00,1.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,0,'','',1,0,0,'basic');
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`) VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0);
INSERT INTO `talert_templates` (`id`, `name`, `description`, `id_alert_action`, `field1`, `field2`, `field3`, `type`, `value`, `matches_value`, `max_value`, `min_value`, `time_threshold`, `max_alerts`, `min_alerts`, `time_from`, `time_to`, `monday`, `tuesday`, `wednesday`, `thursday`, `friday`, `saturday`, `sunday`, `recovery_notify`, `field2_recovery`, `field3_recovery`, `priority`, `id_group`, `special_day`, `wizard_level`) VALUES (3,'Warning&#x20;condition','This&#x20;is&#x20;a&#x20;generic&#x20;alert&#x20;template&#x20;to&#x20;fire&#x20;on&#x20;WARNING&#x20;condition.',1,'','','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;fired&#x20;because&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;','warning','',1,0.00,0.00,86400,1,0,'12:00:00','12:00:00',1,1,1,1,1,1,1,1,'[PANDORA]&#x20;Alert&#x20;RECOVERED&#x20;for&#x20;WARNING&#x20;status&#x20;on&#x20;_agent_&#x20;/&#x20;_module_','Hello,&#x20;this&#x20;is&#x20;an&#x20;automated&#x20;email&#x20;coming&#x20;from&#x20;Pandora&#x20;FMS&#x0d;&#x0a;&#x0d;&#x0a;This&#x20;alert&#x20;has&#x20;been&#x20;RECOVERED&#x20;from&#x20;a&#x20;WARNING&#x20;condition&#x20;in&#x20;one&#x20;of&#x20;your&#x20;monitored&#x20;items:&#x0d;&#x0a;&#x0d;&#x0a;Agent&#x20;:&#x20;_agent_&#x0d;&#x0a;Module:&#x20;_module_&#x0d;&#x0a;Module&#x20;description:&#x20;_moduledescription_&#x0d;&#x0a;Timestamp&#x20;_timestamp_&#x0d;&#x0a;Current&#x20;value:&#x20;_data_&#x0d;&#x0a;&#x0d;&#x0a;Thanks&#x20;for&#x20;your&#x20;time.&#x0d;&#x0a;&#x0d;&#x0a;Best&#x20;regards&#x0d;&#x0a;Pandora&#x20;FMS&#x0d;&#x0a;',3,0,0,'basic');
-- treport_custom_sql Data
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring&#x20;Report&#x20;Agent', 'select&#x20;direccion,&#x20;nombre,&#x20;comentarios,&#x20;&#40;select&#x20;nombre&#x20;from&#x20;tgrupo&#x20;where&#x20;tgrupo.id_grupo&#x20;=&#x20;tagente.id_grupo&#41;&#x20;as&#x20;`group`&#x20;from&#x20;tagente;');