implemented capacity to handle string data for event data
This commit is contained in:
parent
a63a4efb71
commit
fdc6d2f4c8
|
@ -0,0 +1,6 @@
|
||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
|
||||||
|
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
|
||||||
|
|
||||||
|
COMMIT;
|
|
@ -1026,6 +1026,7 @@ ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_timestamp_idx` (`timestamp`);
|
||||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
|
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_module_status_idx` (`module_status`);
|
||||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
|
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_criticity_idx` (`criticity`);
|
||||||
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
|
ALTER TABLE `tmetaconsole_event` ADD INDEX `tme_agent_name_idx` (`agent_name`);
|
||||||
|
ALTER TABLE `tmetaconsole_event` MODIFY `data` TINYTEXT default NULL;
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tmetaconsole_event_history`
|
-- Table `tmetaconsole_event_history`
|
||||||
|
@ -2345,6 +2346,8 @@ ALTER TABLE `tevento` ADD COLUMN `data` double(50,5) default NULL;
|
||||||
|
|
||||||
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
|
ALTER TABLE `tevento` ADD COLUMN `module_status` int(4) NOT NULL default '0';
|
||||||
|
|
||||||
|
ALTER TABLE `tevento` MODIFY `data` TINYTEXT default NULL;
|
||||||
|
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
-- Table `tevent_extended`
|
-- Table `tevent_extended`
|
||||||
-- ---------------------------------------------------------------------
|
-- ---------------------------------------------------------------------
|
||||||
|
|
|
@ -391,10 +391,12 @@ if (is_ajax()) {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (is_numeric($tmp->data) === true) {
|
||||||
$tmp->data = format_numeric(
|
$tmp->data = format_numeric(
|
||||||
$tmp->data,
|
$tmp->data,
|
||||||
$config['graph_precision']
|
$config['graph_precision']
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
$tmp->instructions = events_get_instructions($item);
|
$tmp->instructions = events_get_instructions($item);
|
||||||
|
|
||||||
|
|
|
@ -681,7 +681,7 @@ CREATE TABLE IF NOT EXISTS `tevento` (
|
||||||
`owner_user` VARCHAR(100) NOT NULL DEFAULT '',
|
`owner_user` VARCHAR(100) NOT NULL DEFAULT '',
|
||||||
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
|
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
|
||||||
`custom_data` TEXT NOT NULL,
|
`custom_data` TEXT NOT NULL,
|
||||||
`data` double(50,5) default NULL,
|
`data` tinytext default NULL,
|
||||||
`module_status` int(4) NOT NULL default '0',
|
`module_status` int(4) NOT NULL default '0',
|
||||||
PRIMARY KEY (`id_evento`),
|
PRIMARY KEY (`id_evento`),
|
||||||
KEY `idx_agente` (`id_agente`),
|
KEY `idx_agente` (`id_agente`),
|
||||||
|
@ -3275,7 +3275,7 @@ CREATE TABLE IF NOT EXISTS `tmetaconsole_event` (
|
||||||
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
|
`ack_utimestamp` BIGINT(20) NOT NULL DEFAULT '0',
|
||||||
`server_id` int(10) NOT NULL,
|
`server_id` int(10) NOT NULL,
|
||||||
`custom_data` TEXT NOT NULL DEFAULT '',
|
`custom_data` TEXT NOT NULL DEFAULT '',
|
||||||
`data` double(50,5) default NULL,
|
`data` tinytext default NULL,
|
||||||
`module_status` int(4) NOT NULL default '0',
|
`module_status` int(4) NOT NULL default '0',
|
||||||
PRIMARY KEY (`id_evento`),
|
PRIMARY KEY (`id_evento`),
|
||||||
KEY `idx_agente` (`id_agente`),
|
KEY `idx_agente` (`id_agente`),
|
||||||
|
|
|
@ -3655,7 +3655,7 @@ sub pandora_event ($$$$$$$$$$;$$$$$$$$$$$) {
|
||||||
# Create the event
|
# Create the event
|
||||||
logger($pa_config, "Generating event '$evento' for agent ID $id_agente module ID $id_agentmodule.", 10);
|
logger($pa_config, "Generating event '$evento' for agent ID $id_agente module ID $id_agentmodule.", 10);
|
||||||
my $event_id = db_insert ($dbh, 'id_evento','INSERT INTO ' . $event_table . ' (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status)
|
my $event_id = db_insert ($dbh, 'id_evento','INSERT INTO ' . $event_table . ' (id_agente, id_grupo, evento, timestamp, estado, utimestamp, event_type, id_agentmodule, id_alert_am, criticity, user_comment, tags, source, id_extra, id_usuario, critical_instructions, warning_instructions, unknown_instructions, ack_utimestamp, custom_data, data, module_status)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, $module_data, $module_status);
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', $id_agente, $id_grupo, safe_input ($evento), $timestamp, $event_status, $utimestamp, $event_type, $id_agentmodule, $id_alert_am, $severity, $comment, $module_tags, $source, $id_extra, $user_name, $critical_instructions, $warning_instructions, $unknown_instructions, $ack_utimestamp, $custom_data, safe_input($module_data), $module_status);
|
||||||
|
|
||||||
# Do not write to the event file
|
# Do not write to the event file
|
||||||
return $event_id if ($pa_config->{'event_file'} eq '');
|
return $event_id if ($pa_config->{'event_file'} eq '');
|
||||||
|
|
Loading…
Reference in New Issue