2012-10-10 Sergio Martin <sergio.martin@artica.es>

* pandoradb_data.sql
	pandoradb.data.postgreSQL.sql
	pandoradb.data.oracle.sql: Add the default 
	responses to data scripts.

	* pandoradb.postgreSQL.sql
	pandoradb.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
	extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql: 
	Added the new table of event responses to oracle 
	and postgresql schemmas. 

	* godmode/events/event_responses.editor.php 
	include/help/en/help_response_parameters.php
	include/help/en/help_response_macros.php
	include/help/es/help_response_parameters.php
	include/help/es/help_response_macros.php: Add help to
	parameters and macros in event responses



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7063 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
zarzuelo 2012-10-10 10:46:19 +00:00
parent 9e8c44dfad
commit 4f95a7b2d5
13 changed files with 197 additions and 17 deletions

View File

@ -1,3 +1,24 @@
2012-10-10 Sergio Martin <sergio.martin@artica.es>
* pandoradb_data.sql
pandoradb.data.postgreSQL.sql
pandoradb.data.oracle.sql: Add the default
responses to data scripts.
* pandoradb.postgreSQL.sql
pandoradb.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql:
Added the new table of event responses to oracle
and postgresql schemmas.
* godmode/events/event_responses.editor.php
include/help/en/help_response_parameters.php
include/help/en/help_response_macros.php
include/help/es/help_response_parameters.php
include/help/es/help_response_macros.php: Add help to
parameters and macros in event responses
2012-10-09 Sergio Martin <sergio.martin@artica.es>
* pandoradb.sql: Added tevent_response to

View File

@ -347,3 +347,20 @@ ALTER TABLE tnetwork_map ADD (pandoras_children NUMBER(10, 0) default 0 NOT NULL
-- Table `tagente_estado`
------------------------------------------------------------------------
ALTER TABLE tagente_estado ADD (last_known_status NUMBER(5, 0) default 0 NOT NULL);
-- -----------------------------------------------------
-- Table `tevent_response`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS tevent_response (
id NUMBER(10) NOT NULL PRIMARY KEY,
name varchar2(600) NOT NULL default '',
description CLOB,
target CLOB,
type varchar2(60) NOT NULL,
id_group MEDIUMINT(4) NOT NULL default 0,
modal_width NUMBER(10, 0) NOT NULL DEFAULT 0,
modal_height NUMBER(10, 0) NOT NULL DEFAULT 0,
new_window NUMBER(10, 0) NOT NULL DEFAULT 0,
params CLOB
);
CREATE SEQUENCE tevent_response_s INCREMENT BY 1 START WITH 1;

View File

@ -338,3 +338,19 @@ ALTER TABLE "tnetwork_map" ADD COLUMN "pandoras_children" INTEGER NOT NULL DEFAU
-- Table `tagente_estado`
------------------------------------------------------------------------
ALTER TABLE "tagente_estado" ADD COLUMN "last_known_status" INTEGER default 0;
-- -----------------------------------------------------
-- Table `tevent_response`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS "tevent_response" (
"id" SERIAL NOT NULL PRIMARY KEY,
"name" varchar(600) NOT NULL default '',
"description" TEXT,
"target" TEXT,
"type" varchar(60) NOT NULL,
"id_group" INTEGER NOT NULL default 0,
"modal_width" INTEGER NOT NULL DEFAULT 0,
"modal_height" INTEGER NOT NULL DEFAULT 0,
"new_window" INTEGER NOT NULL DEFAULT 0,
"params" TEXT,
);

View File

@ -92,27 +92,11 @@ $table->data[3] = $data;
$data = array();
$table->colspan[4][1] = 3;
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" style="display:none;" class="labels">'.__('URL').'</span>';
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" style="display:none;" class="labels">'.__('URL').'</span>'.ui_print_help_icon ("response_macros", true);
$data[1] = html_print_input_text('target',$event_response['target'],'',150,255,true);
$types = array('url' => __('URL'), 'command' => __('Command'));
$table->data[4] = $data;
$data = array();
$table->colspan[5][0] = 4;
$macros = events_get_macros();
$macros_info = "<div style='margin-left:20px'>";
foreach($macros as $k=>$v) {
$macros_info .= "<b>$v:</b> $k<br>";
}
$macros_info .= "</div>";
$data[0] = ui_print_info_message(array('title'=>__('Available macros'), 'message' => '<br>'.$macros_info), '', true);
$table->data[5] = $data;
echo '<br>';
if($event_response_id == 0) {
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events&section=responses&mode=list&action=create_response">';
html_print_table($table);

View File

@ -0,0 +1,31 @@
<?php
/**
* @package Include/help/en
*/
?>Event responses macros</h1>
<p>
The response target (command or URL) accepts macros to custom it.
<br><br>
The macros accepted are the following:
<ul>
<li><b>Agent address:</b> _agent_address_</li>
<li><b>Agent id:</b> _agent_id_</li>
<li><b>Event id:</b> _event_id_</li>
</ul>
<h3>Basic use</h3>
In example, to ping the agent associated to the event:
<br><br>
Configure command like: <i>ping -c 5 _agent_address_</i>
<br><br>
If there are configured parameters, is possible use it as macros too.
<h3>Parameters macros</h3>
In example, to custom a URL with parameters:
<br><br>
Configure parameters like: <i>User,Section</i>
<br><br>
And configure the URL like: <i>http://example.com/index.php?user=_User_&amp;section=_Section_</i>
</p>

View File

@ -0,0 +1,22 @@
<?php
/**
* @package Include/help/en
*/
?>
<h1>Event responses parameters</h1>
<p>The response parameters will be separated by commas.
<br><br>
In example:
<br><br>
<i>User,Password,Port</i>
<br><br>
Each parameter can be used as macro in the command/URL adding before and after a low bar.
<br><br>
In example:
<br><br>
<i>_Port_</i>
<br><br>
Please, don't use blank spaces in the Parameters
</p>

View File

@ -0,0 +1,31 @@
<?php
/*
* @package Include/help/es/
*/
?>
<h1>Macros en Respuestas de eventos</h1>
<p>
El target de la respuesta (comando o URL) acepta macros para personalizarlo.
<br><br>
Las macros aceptadas son las siguientes:
<ul>
<li><b>Dirección del agente:</b> _agent_address_</li>
<li><b>Id del agente:</b> _agent_id_</li>
<li><b>Id del evento:</b> _event_id_</li>
</ul>
<h3>Uso b&aacute;sico</h3>
Por ejemplo, para hacer un ping al agente asociado al evento:
<br><br>
Configurar el comando as&iacute;: <i>ping -c 5 _agent_address_</i>
<br><br>
Si hay par&aacute;metros configurados, es posible usarlos como macros también.
<h3>Macros de par&aacute;metros</h3>
Por ejemplo, para personalizar una URL con parámetros:
<br><br>
Configurar los par&aacute;metros as&iacute;: <i>User,Section</i>
<br><br>
Y configurar la URL as&iacute;: <i>http://example.com/index.php?user=_User_&amp;section=_Section_</i>
</p>

View File

@ -0,0 +1,21 @@
<?php
/*
* @package Include/help/es/
*/
?>
<h1>Par&aacute;metros de respuestas de eventos</h1>
<p>Los par&aacute;metros de respuesta van separados por comas.
<br><br>
Por ejemplo:
<br><br>
<i>User,Password,Port</i>
<br><br>
Cada par&aacute;metro puede ser usado como una macro en el comando/URL a&ntilde;adiendo antes y despu&eacute;s un gui&oacute:n bajo.
<br><br>
Por ejemplo:
<br><br>
<i>_Port_</i>
<br><br>
Por favor, no use espacios en blanco en los par&aacute;metros
</p>

View File

@ -608,3 +608,4 @@ INSERT INTO tagent_custom_fields VALUES (1,'Serial&#x20;Number',0),(2,'Departmen
INSERT INTO ttag VALUES (1,'network','Network&#x20;equipment','http://artica.es'),(2,'critical','Critical&#x20;modules',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules',''),(5,'configuration','','');
INSERT INTO tevent_response VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,''),(2,'SSH&#x20;to&#x20;host','Connect&#x20;via&#x20;SSH&#x20;to&#x20;the&#x20;agent','http://192.168.70.164:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,''),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,''),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'');

View File

@ -448,3 +448,5 @@ INSERT INTO "tplugin" ("id", "name", "description", "max_timeout", "execute", "p
INSERT INTO "tagent_custom_fields" VALUES (1,'Serial&#x20;Number',0),(2,'Department',0),(3,'Additional&#x20;ID',0);
INSERT INTO "ttag" VALUES (1,'network','Network&#x20;equipment','http://artica.es'),(2,'critical','Critical&#x20;modules',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules',''),(5,'configuration','','');
INSERT INTO "tevent_response" VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,''),(2,'SSH&#x20;to&#x20;host','Connect&#x20;via&#x20;SSH&#x20;to&#x20;the&#x20;agent','http://192.168.70.164:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,''),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,''),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'');

View File

@ -1693,3 +1693,20 @@ CREATE TABLE IF NOT EXISTS tpassword_history (
date_end TIMESTAMP DEFAULT 0
);
CREATE SEQUENCE tpassword_history_s INCREMENT BY 1 START WITH 1;
-- -----------------------------------------------------
-- Table `tevent_response`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS tevent_response (
id NUMBER(10) NOT NULL PRIMARY KEY,
name varchar2(600) NOT NULL default '',
description CLOB,
target CLOB,
type varchar2(60) NOT NULL,
id_group MEDIUMINT(4) NOT NULL default 0,
modal_width NUMBER(10, 0) NOT NULL DEFAULT 0,
modal_height NUMBER(10, 0) NOT NULL DEFAULT 0,
new_window NUMBER(10, 0) NOT NULL DEFAULT 0,
params CLOB
);
CREATE SEQUENCE tevent_response_s INCREMENT BY 1 START WITH 1;

View File

@ -1432,3 +1432,19 @@ CREATE TABLE "tpassword_history" (
"date_begin" BIGINT NOT NULL default 0,
"date_end" BIGINT NOT NULL default 0,
);
-- -----------------------------------------------------
-- Table `tevent_response`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS "tevent_response" (
"id" SERIAL NOT NULL PRIMARY KEY,
"name" varchar(600) NOT NULL default '',
"description" TEXT,
"target" TEXT,
"type" varchar(60) NOT NULL,
"id_group" INTEGER NOT NULL default 0,
"modal_width" INTEGER NOT NULL DEFAULT 0,
"modal_height" INTEGER NOT NULL DEFAULT 0,
"new_window" INTEGER NOT NULL DEFAULT 0,
"params" TEXT,
);

View File

@ -438,3 +438,4 @@ INSERT INTO `tagent_custom_fields` VALUES (1,'Serial&#x20;Number',0),(2,'Departm
INSERT INTO `ttag` VALUES (1,'network','Network&#x20;equipment','http://artica.es'),(2,'critical','Critical&#x20;modules',''),(3,'dmz','DMZ&#x20;Network&#x20;Zone',''),(4,'performance','Performance&#x20;anda&#x20;capacity&#x20;modules',''),(5,'configuration','','');
INSERT INTO `tevent_response` VALUES (1,'Ping&#x20;to&#x20;host','Ping&#x20;to&#x20;the&#x20;agent&#x20;host','ping&#x20;-c&#x20;5&#x20;_agent_address_','command',0,620,500,0,''),(2,'SSH&#x20;to&#x20;host','Connect&#x20;via&#x20;SSH&#x20;to&#x20;the&#x20;agent','http://192.168.70.164:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;the&#x20;standard&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS','index.php?sec=workspace&amp;sec2=operation/incidents/incident_detail&amp;insert_form&amp;from_event=_event_id_','url',0,0,0,1,''),(4,'Create&#x20;Integria&#x20;IMS&#x20;incident&#x20;from&#x20;event','Create&#x20;a&#x20;incident&#x20;from&#x20;the&#x20;event&#x20;with&#x20;integria&#x20;incidents&#x20;system&#x20;of&#x20;Pandora&#x20;FMS.&#x20;&#x0d;&#x0a;&#x0d;&#x0a;Is&#x20;necessary&#x20;to&#x20;enable&#x20;and&#x20;configure&#x20;the&#x20;Integria&#x20;incidents&#x20;in&#x20;Pandora&#x20;FMS&#x20;setup.','index.php?sec=workspace&amp;sec2=operation/integria_incidents/incident&amp;tab=editor&amp;from_event=_event_id_','url',0,0,0,1,''),(5,'Restart&#x20;agent','Restart&#x20;the&#x20;agent&#x20;with&#x20;using&#x20;UDP&#x20;protocol.&#x0d;&#x0a;&#x0d;&#x0a;To&#x20;use&#x20;this&#x20;response&#x20;is&#x20;necessary&#x20;to&#x20;have&#x20;installed&#x20;Pandora&#x20;FMS&#x20;server&#x20;and&#x20;console&#x20;in&#x20;the&#x20;same&#x20;machine.','/usr/share/pandora_server/udp_client.pl&#x20;_agent_address_&#x20;41122&#x20;&quot;REFRESH&#x20;AGENT&quot;','command',0,620,500,0,'');