Merge branch 'ent-8470-POST-ocultar-comando-en-respuestas-de-eventos-2' into 'develop'
added token to display or hide command in event response execution See merge request artica/pandorafms!4671
This commit is contained in:
commit
91797c7112
|
@ -1,5 +1,6 @@
|
|||
START TRANSACTION;
|
||||
ALTER TABLE `tpolicy_queue` MODIFY COLUMN `progress` int(10) NOT NULL default '0';
|
||||
CREATE INDEX `IDX_tservice_element` ON `tservice_element`(`id_service`,`id_agente_modulo`);
|
||||
ALTER TABLE tevent_response ADD COLUMN display_command tinyint(1) default 0;
|
||||
|
||||
COMMIT;
|
|
@ -2002,6 +2002,7 @@ ALTER TABLE `tserver` ADD COLUMN `port` int(5) unsigned NOT NULL default 0;
|
|||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE tevent_response ADD COLUMN server_to_exec int(10) unsigned NOT NULL DEFAULT 0;
|
||||
ALTER TABLE tevent_response ADD COLUMN command_timeout int(5) unsigned NOT NULL DEFAULT 90;
|
||||
ALTER TABLE tevent_response ADD COLUMN display_command tinyint(1) DEFAULT 0;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table `tmodule`
|
||||
|
|
|
@ -197,6 +197,18 @@ $data[0] = '<div id="command_timeout_label" class="labels invisible">'.__('Comma
|
|||
$data[1] = '<div id="command_timeout_value" class="invisible">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
|
||||
|
||||
$table->data[5] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Display command').ui_print_help_tip(__('If enabled the command will be displayed to any user that can execute this event response'), true);
|
||||
$data[1] = html_print_checkbox_switch(
|
||||
'display_command',
|
||||
1,
|
||||
$event_response['display_command'],
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[6] = $data;
|
||||
|
||||
if ($event_response_id == 0) {
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=create_response&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
|
|
@ -41,6 +41,7 @@ switch ($action) {
|
|||
$values['modal_height'] = get_parameter('modal_height');
|
||||
$values['new_window'] = get_parameter('new_window');
|
||||
$values['params'] = get_parameter('params');
|
||||
$values['display_command'] = get_parameter('display_command');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$values['command_timeout'] = get_parameter('command_timeout', 90);
|
||||
|
||||
|
@ -64,6 +65,7 @@ switch ($action) {
|
|||
$values['modal_height'] = get_parameter('modal_height');
|
||||
$values['new_window'] = get_parameter('new_window');
|
||||
$values['params'] = get_parameter('params');
|
||||
$values['display_command'] = get_parameter('display_command');
|
||||
$values['server_to_exec'] = get_parameter('server_to_exec');
|
||||
$response_id = get_parameter('id_response', 0);
|
||||
$values['command_timeout'] = get_parameter('command_timeout', '90');
|
||||
|
|
|
@ -1176,12 +1176,15 @@ if ($dialogue_event_response) {
|
|||
$prompt = '<br>> ';
|
||||
switch ($event_response['type']) {
|
||||
case 'command':
|
||||
$display_command = (bool) $event_response['display_command'];
|
||||
$command_str = ($display_command === true) ? $command : '';
|
||||
|
||||
if ($massive) {
|
||||
echo "<div class='left'>";
|
||||
echo $prompt.sprintf(
|
||||
'(Event #'.$event_id.') '.__(
|
||||
'Executing command: %s',
|
||||
$command
|
||||
$command_str
|
||||
)
|
||||
);
|
||||
echo '</div><br>';
|
||||
|
@ -1214,7 +1217,7 @@ if ($dialogue_event_response) {
|
|||
} else {
|
||||
echo "<div class='left'>";
|
||||
|
||||
echo $prompt."Executing command: $command";
|
||||
echo $prompt."Executing command: $command_str";
|
||||
echo '</div><br>';
|
||||
|
||||
echo "<div id='response_loading_command' style='display:none'>".html_print_image('images/spinner.gif', true).'</div>';
|
||||
|
|
|
@ -2226,6 +2226,7 @@ CREATE TABLE IF NOT EXISTS `tevent_response` (
|
|||
`params` TEXT NOT NULL,
|
||||
`server_to_exec` int(10) unsigned NOT NULL DEFAULT 0,
|
||||
`command_timeout` int(5) unsigned NOT NULL DEFAULT 90,
|
||||
`display_command` tinyint(1) DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
|
@ -1186,7 +1186,7 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0,0,''),(2,'De
|
|||
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','','',''),(2,'critical','Critical modules','','','',''),(3,'dmz','DMZ Network Zone','','','',''),(4,'performance','Performance anda capacity modules','','','',''),(5,'configuration','','','','','');
|
||||
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0,90),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0,90),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0,90),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0,90);
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,'',0,90,0),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,'',0,90,0),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'',0,90,0),(6,'Ping to module agent host','Ping to the module agent host','ping -c 5 _module_address_','command',0,620,500,0,'',0,90,0);
|
||||
|
||||
INSERT INTO `tupdate_settings` VALUES ('current_update', '412'), ('customer_key', 'PANDORA-FREE'), ('updating_binary_path', 'Path where the updated binary files will be stored'), ('updating_code_path', 'Path where the updated code is stored'), ('dbname', ''), ('dbhost', ''), ('dbpass', ''), ('dbuser', ''), ('dbport', ''), ('proxy', ''), ('proxy_port', ''), ('proxy_user', ''), ('proxy_pass', '');
|
||||
|
||||
|
|
Loading…
Reference in New Issue