2012-10-29 Sergio Martin <sergio.martin@artica.es>
* pandoradb_data.sql include/javascript/pandora_alerts.js pandoradb.sql pandoradb.postgreSQL.sql pandoradb.oracle.sql pandoradb.data.postgreSQL.sql pandoradb.data.oracle.sql extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql godmode/alerts/configure_alert_template.php godmode/alerts/alert_templates.php godmode/alerts/configure_alert_action.php godmode/alerts/configure_alert_command.php godmode/alerts/alert_actions.php godmode/alerts/alert_commands.php: Added 7 more fields to alert actions and adapted templates to this feature (recovery included). Add the feature of custom the label and the possible data (to use textarea or select) from the command git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7102 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
4a62374fc8
commit
97373f2eb2
|
@ -1,3 +1,25 @@
|
|||
2012-10-29 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* pandoradb_data.sql
|
||||
include/javascript/pandora_alerts.js
|
||||
pandoradb.sql
|
||||
pandoradb.postgreSQL.sql
|
||||
pandoradb.oracle.sql
|
||||
pandoradb.data.postgreSQL.sql
|
||||
pandoradb.data.oracle.sql
|
||||
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql
|
||||
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql
|
||||
extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql
|
||||
godmode/alerts/configure_alert_template.php
|
||||
godmode/alerts/alert_templates.php
|
||||
godmode/alerts/configure_alert_action.php
|
||||
godmode/alerts/configure_alert_command.php
|
||||
godmode/alerts/alert_actions.php
|
||||
godmode/alerts/alert_commands.php: Added 7 more fields to
|
||||
alert actions and adapted templates to this feature (recovery
|
||||
included). Add the feature of custom the label and the possible
|
||||
data (to use textarea or select) from the command
|
||||
|
||||
2012-10-29 Junichi Satoh <junichi@rworks.jp>
|
||||
|
||||
* include/help/ja/help_alert_macros.php: Translated new macros.
|
||||
|
|
|
@ -339,3 +339,38 @@ CREATE TABLE IF NOT EXISTS `tevent_response` (
|
|||
`params` TEXT NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `talert_actions`
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field4` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field5` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field6` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field7` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field8` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field9` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_actions` ADD COLUMN `field10` TEXT NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field4` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field5` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field6` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field7` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field8` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field9` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field10` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field4_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field5_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field6_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field7_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field8_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field9_recovery` TEXT NOT NULL;
|
||||
ALTER TABLE `talert_templates` ADD COLUMN `field10_recovery` TEXT NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table `talert_commands`
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_descriptions` TEXT;
|
||||
ALTER TABLE `talert_commands` ADD COLUMN `fields_values` TEXT;
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
-- -----------------------------------------------------
|
||||
-- Table `tusuario`
|
||||
-- Table tusuario
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tusuario ADD COLUMN (disabled NUMBER(10,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD COLUMN (shortcut NUMBER(5, 0) DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD COLUMN (force_change_pass NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD COLUMN (last_pass_change TIMESTAMP DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD COLUMN (last_failed_login TIMESTAMP DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD COLUMN (failed_attempt NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD COLUMN (login_blocked NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD COLUMN disabled NUMBER(10, 0) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE tusuario ADD COLUMN shortcut NUMBER(5, 0) DEFAULT 0;
|
||||
ALTER TABLE tusuario ADD COLUMN shortcut_data CLOB DEFAULT '';
|
||||
ALTER TABLE tusuario ADD ((disabled NUMBER(10,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((shortcut NUMBER(5, 0) DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD ((force_change_pass NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((last_pass_change TIMESTAMP DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD ((last_failed_login TIMESTAMP DEFAULT 0);
|
||||
ALTER TABLE tusuario ADD ((failed_attempt NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((login_blocked NUMBER(5,0) DEFAULT 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD (disabled NUMBER(10, 0) NOT NULL DEFAULT 0;
|
||||
ALTER TABLE tusuario ADD (shortcut NUMBER(5, 0) DEFAULT 0;
|
||||
ALTER TABLE tusuario ADD (shortcut_data CLOB DEFAULT '';
|
||||
ALTER TABLE tusuario ADD (section VARCHAR2(255) NOT NULL);
|
||||
INSERT INTO tusuario (section) VALUES ('Default');
|
||||
ALTER TABLE tusuario ADD COLUMN (data_section VARCHAR2(255) NOT NULL);
|
||||
ALTER TABLE tusuario ADD COLUMN (metaconsole_access VARCHAR2(100) DEFAULT 'only_console' NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((data_section VARCHAR2(255) NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((metaconsole_access VARCHAR2(100) DEFAULT 'only_console' NOT NULL);
|
||||
ALTER TABLE tusuario ADD CONSTRAINT t_usuario_metaconsole_access_cons CHECK (metaconsole_access IN ('basic','advanced','custom','all','only_console'));
|
||||
ALTER TABLE tusuario ADD COLUMN (not_login NUMBER(5,0) default 0 NOT NULL);
|
||||
ALTER TABLE tusuario ADD ((not_login NUMBER(5,0) default 0 NOT NULL);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Table "tnetflow_filter"
|
||||
|
@ -68,18 +68,18 @@ CREATE SEQUENCE tnetflow_report_content_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tnetflow_report_content_inc BEFORE INSERT ON tnetflow_report_content REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tnetflow_report_content_s.nextval INTO :NEW.ID_RC FROM dual; END tnetflow_report_content_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tincidencia`
|
||||
-- Table tincidencia
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tincidencia ADD (id_agent NUMBER(10,0) default 0 NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente`
|
||||
-- Table tagente
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tagente ADD (url_address CLOB default '' NULL);
|
||||
ALTER TABLE tagente ADD (quiet NUMBER(5, 0) default 0 NOT NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_special_days`
|
||||
-- Table talert_special_days
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE talert_special_days (
|
||||
id NUMBER(10,0) NOT NULL PRIMARY KEY,
|
||||
|
@ -93,12 +93,12 @@ CREATE SEQUENCE talert_special_days_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER talert_special_days_inc BEFORE INSERT ON talert_special_days REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT talert_special_days_s.nextval INTO :NEW.ID FROM dual; END talert_special_days_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- Table talert_templates
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE talert_templates ADD (special_day NUMBER(5,0) default 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- Table talert_templates
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tplanned_downtime ADD (monday NUMBER(5, 0) default 0);
|
||||
ALTER TABLE tplanned_downtime ADD (tuesday NUMBER(5, 0) default 0);
|
||||
|
@ -116,7 +116,7 @@ ALTER TABLE tplanned_downtime ADD (type_execution VARCHAR2(100) NOT NULL default
|
|||
ALTER TABLE tplanned_downtime ADD (type_periodicity VARCHAR2(100) NOT NULL default 'weekly');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplanned_downtime_agents`
|
||||
-- Table tplanned_downtime_agents
|
||||
-- -----------------------------------------------------
|
||||
DELETE FROM tplanned_downtime_agents
|
||||
WHERE id_downtime NOT IN (SELECT id FROM tplanned_downtime);
|
||||
|
@ -129,7 +129,7 @@ references tplanned_downtime (id);
|
|||
ALTER TABLE tplanned_downtime_agents ADD (all_modules NUMBER(5, 0) default 1);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplanned_downtime_modules`
|
||||
-- Table tplanned_downtime_modules
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE tplanned_downtime_modules (
|
||||
id NUMBER(19, 0) NOT NULL PRIMARY KEY,
|
||||
|
@ -141,7 +141,7 @@ CREATE SEQUENCE tplanned_downtime_modules_s INCREMENT BY 1 START WITH 1;
|
|||
CREATE OR REPLACE TRIGGER tplanned_downtime_modules_inc BEFORE INSERT ON tplanned_downtime_modules REFERENCING NEW AS NEW FOR EACH ROW BEGIN SELECT tplanned_downtime_modules_s.nextval INTO :NEW.ID FROM dual; END tplanned_downtime_modules_inc;;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevento`
|
||||
-- Table tevento
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tevento ADD (source VARCHAR2(100) default '' NOT NULL);
|
||||
ALTER TABLE tevento ADD (id_extra VARCHAR2(100) default '' NOT NULL);
|
||||
|
@ -153,14 +153,14 @@ ALTER TABLE tevento ADD (owner_user VARCHAR2(100) NOT NULL default '0');
|
|||
ALTER TABLE tevento ADD (ack_utimestamp NUMBER(19, 0) NOT NULL default 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tgrupo`
|
||||
-- Table tgrupo
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tgrupo ADD (description CLOB);
|
||||
ALTER TABLE tgrupo ADD (contact CLOB);
|
||||
ALTER TABLE tgrupo ADD (other CLOB);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
-- Table talert_snmp
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE talert_snmp ADD (_snmp_f1_ CLOB default '');
|
||||
|
@ -173,7 +173,7 @@ ALTER TABLE talert_snmp ADD (trap_type NUMBER(10, 0) DEFAULT -1 NOT NULL);
|
|||
ALTER TABLE talert_snmp ADD (single_value VARCHAR2(255) DEFAULT '');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_filter`
|
||||
-- Table tevent_filter
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE tevent_filter (
|
||||
id_filter NUMBER(10, 0) NOT NULL PRIMARY KEY,
|
||||
|
@ -194,64 +194,64 @@ CREATE TABLE tevent_filter (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table tconfig
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tconfig MODIFY value TEXT NOT NULL;
|
||||
INSERT INTO tconfig (token, value) VALUES ('event_fields', 'evento,id_agente,estado,timestamp');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_item`
|
||||
-- Table treport_content_item
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE treport_content_item ADD FOREIGN KEY (id_report_content) REFERENCES treport_content(id_rc) ON DELETE CASCADE;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport`
|
||||
-- Table treport
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE treport ADD (id_template NUMBER(10, 0) default 0 NOT NULL);
|
||||
ALTER TABLE treport ADD (id_group_edit NUMBER(19, 0) default 0 NOT NULL);
|
||||
ALTER TABLE treport ADD (metaconsole NUMBER(5, 0) DEFAULT 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tgraph`
|
||||
-- Table tgraph
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tgraph ADD (id_graph_template NUMBER(11, 0) default 0 NOT NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `ttipo_modulo`
|
||||
-- Table ttipo_modulo
|
||||
-- -----------------------------------------------------
|
||||
UPDATE ttipo_modulo SET descripcion='Generic data' WHERE id_tipo=1;
|
||||
UPDATE ttipo_modulo SET descripcion='Generic data incremental' WHERE id_tipo=4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_item`
|
||||
-- Table treport_content_item
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE treport_content_item ADD (operation CLOB default '');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tmensajes`
|
||||
-- Table tmensajes
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tmensajes MODIFY mensaje VARCHAR2(255) NOT NULL DEFAULT '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_compound`
|
||||
-- Table talert_compound
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE talert_compound ADD (special_day NUMBER(5,0) default 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table tnetwork_component
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE tnetwork_component ADD COLUMN unit CLOB default '';
|
||||
ALTER TABLE tnetwork_component ADD (unit CLOB default '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_commands`
|
||||
-- Table talert_commands
|
||||
-- -----------------------------------------------------
|
||||
|
||||
INSERT INTO talert_commands (name, command, description, internal) VALUES ('Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table tconfig
|
||||
-- -----------------------------------------------------
|
||||
|
||||
INSERT INTO tconfig (token, value) VALUES ('enable_pass_policy', 0);
|
||||
|
@ -269,7 +269,7 @@ INSERT INTO tconfig (token, value) VALUES ('meta_style', 'meta_pandora');
|
|||
INSERT INTO tconfig (token, value) VALUES ('enable_refr', 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tpassword_history`
|
||||
-- Table tpassword_history
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS tpassword_history (
|
||||
id_pass NUMBER(10) NOT NULL PRIMARY KEY,
|
||||
|
@ -281,13 +281,13 @@ CREATE TABLE IF NOT EXISTS tpassword_history (
|
|||
CREATE SEQUENCE tpassword_history_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table tconfig
|
||||
-- -----------------------------------------------------
|
||||
UPDATE tconfig SET value='comparation'
|
||||
WHERE token='prominent_time';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table tnetwork_component
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tnetwork_component ADD (wizard_level VARCHAR2(100) default 'custom' NOT NULL);
|
||||
ALTER TABLE tnetwork_component ADD CONSTRAINT t_network_component_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
|
||||
|
@ -296,7 +296,7 @@ ALTER TABLE tnetwork_component ADD (macros CLOB default '');
|
|||
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- Table tagente_modulo
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tagente_modulo ADD (wizard_level VARCHAR2(100) default 'nowizard' NOT NULL);
|
||||
ALTER TABLE tagente_modulo ADD CONSTRAINT t_agente_modulo_wizard_level_cons CHECK (wizard_level IN ('basic','advanced','custom','nowizard'));
|
||||
|
@ -305,24 +305,24 @@ ALTER TABLE tagente_modulo ADD (quiet NUMBER(5, 0) default 0 NOT NULL);
|
|||
ALTER TABLE tagente_modulo ADD (cron_interval VARCHAR2(100) DEFAULT '');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplugin`
|
||||
-- Table tplugin
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tplugin ADD (macros CLOB default '');
|
||||
ALTER TABLE tplugin ADD (parameters CLOB default '');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `trecon_task`
|
||||
-- Table trecon_task
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE trecon_task MODIFY subnet TEXT NOT NULL;
|
||||
ALTER TABLE trecon_task MODIFY field1 TEXT NOT NULL;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- Table tlayout_data
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tlayout_data ADD (enable_link NUMBER(5, 0) NOT NULL default 1);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- Table tagente_modulo
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tagente_modulo ADD (critical_instructions VARCHAR2(255) default '');
|
||||
ALTER TABLE tagente_modulo ADD (warning_instructions VARCHAR2(255) default '');
|
||||
|
@ -331,7 +331,7 @@ ALTER TABLE tagente_modulo ADD (critical_inverse NUMBER(1, 0) default 0 NOT NULL
|
|||
ALTER TABLE tagente_modulo ADD (warning_inverse NUMBER(1, 0) default 0 NOT NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table tnetwork_component
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE tnetwork_component ADD (critical_instructions VARCHAR2(255) default '');
|
||||
ALTER TABLE tnetwork_component ADD (warning_instructions VARCHAR2(255) default '');
|
||||
|
@ -341,7 +341,7 @@ ALTER TABLE tnetwork_component ADD (warning_inverse NUMBER(1, 0) default 0 NOT N
|
|||
evento
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tnetwork_map`
|
||||
-- Table tnetwork_map
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE tnetwork_map ADD (text_filter VARCHAR(100) DEFAULT '');
|
||||
ALTER TABLE tnetwork_map ADD (dont_show_subgroups NUMBER(10, 0) default 0 NOT NULL);
|
||||
|
@ -350,12 +350,12 @@ ALTER TABLE tnetwork_map ADD (show_modules NUMBER(10, 0) default 0 NOT NULL);
|
|||
ALTER TABLE tnetwork_map ADD (show_groups NUMBER(10, 0) default 0 NOT NULL);
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tagente_estado`
|
||||
-- Table tagente_estado
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE tagente_estado ADD (last_known_status NUMBER(5, 0) default 0 NOT NULL);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_response`
|
||||
-- Table tevent_response
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS tevent_response (
|
||||
id NUMBER(10) NOT NULL PRIMARY KEY,
|
||||
|
@ -370,3 +370,38 @@ CREATE TABLE IF NOT EXISTS tevent_response (
|
|||
params CLOB
|
||||
);
|
||||
CREATE SEQUENCE tevent_response_s INCREMENT BY 1 START WITH 1;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table talert_actions
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE talert_actions ADD (field4 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field5 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field6 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field7 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field8 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field9 CLOB NOT NULL;
|
||||
ALTER TABLE talert_actions ADD (field10 CLOB NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table talert_templates
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE talert_templates ADD (field4 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field5 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field6 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field7 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field8 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field9 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field10 CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field4_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field5_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field6_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field7_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field8_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field9_recovery CLOB default '');
|
||||
ALTER TABLE talert_templates ADD (field10_recovery CLOB default '');
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table talert_commands
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE talert_commands ADD (fields_descriptions CLOB default '');
|
||||
ALTER TABLE talert_commands ADD (fields_values CLOB default '');
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
-- -----------------------------------------------------
|
||||
-- Table `tusuario`
|
||||
-- Table "tusuario"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tusuario" ADD COLUMN "disabled" INTEGER NOT NULL DEFAULT 0;
|
||||
ALTER TABLE "tusuario" ADD COLUMN "shortcut" SMALLINT DEFAULT 0;
|
||||
|
@ -19,7 +19,7 @@ ALTER TABLE "tusuario" ADD COLUMN "metaconsole_access" type_tusuario_metaconsole
|
|||
ALTER TABLE "tusuario" ADD COLUMN "not_login" SMALLINT NOT NULL default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetflow_filter`
|
||||
-- Table "tnetflow_filter"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE "tnetflow_filter" (
|
||||
"id_sg" SERIAL NOT NULL PRIMARY KEY,
|
||||
|
@ -36,7 +36,7 @@ CREATE TABLE "tnetflow_filter" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetflow_report`
|
||||
-- Table "tnetflow_report"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE "tnetflow_report" (
|
||||
"id_report" SERIAL NOT NULL PRIMARY KEY,
|
||||
|
@ -47,7 +47,7 @@ CREATE TABLE "tnetflow_report" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetflow_report_content`
|
||||
-- Table "tnetflow_report_content"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE "tnetflow_report_content" (
|
||||
"id_rc" SERIAL NOT NULL PRIMARY KEY,
|
||||
|
@ -62,18 +62,18 @@ CREATE TABLE "tnetflow_report_content" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tincidencia`
|
||||
-- Table "tincidencia"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tincidencia" ADD COLUMN "id_agent" INTEGER NULL DEFAULT 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente`
|
||||
-- Table "tagente"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tagente" ADD COLUMN "url_address" text NULL default '';
|
||||
ALTER TABLE "tagente" ADD COLUMN "quiet" SMALLINT NOT NULL default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_special_days`
|
||||
-- Table "talert_special_days"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
CREATE TYPE type_talert_special_days_same_day AS ENUM ('monday','tuesday','wednesday','thursday','friday','saturday','sunday');
|
||||
|
@ -85,13 +85,13 @@ CREATE TABLE "talert_special_days" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_templates`
|
||||
-- Table "talert_templates"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "special_day" SMALLINT default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplanned_downtime`
|
||||
-- Table "tplanned_downtime"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tplanned_downtime" ADD COLUMN "monday" SMALLINT default 0;
|
||||
ALTER TABLE "tplanned_downtime" ADD COLUMN "tuesday" SMALLINT default 0;
|
||||
|
@ -109,7 +109,7 @@ ALTER TABLE "tplanned_downtime" ADD COLUMN "type_execution" VARCHAR( 100 ) NOT N
|
|||
ALTER TABLE "tplanned_downtime" ADD COLUMN "type_periodicity" VARCHAR( 100 ) NOT NULL default 'weekly';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplanned_downtime_agents`
|
||||
-- Table "tplanned_downtime_agents"
|
||||
-- -----------------------------------------------------
|
||||
DELETE FROM "tplanned_downtime_agents"
|
||||
WHERE "id_downtime" NOT IN (SELECT "id" FROM "tplanned_downtime");
|
||||
|
@ -132,7 +132,7 @@ CREATE TABLE "tplanned_downtime_modules" (
|
|||
);
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tevento`
|
||||
-- Table "tevento"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "tevento" ADD COLUMN "source" text NULL default '';
|
||||
ALTER TABLE "tevento" ADD COLUMN "id_extra" text NULL default '';
|
||||
|
@ -144,7 +144,7 @@ ALTER TABLE "tevento" ADD COLUMN "owner_user" varchar(100) NOT NULL default '0';
|
|||
ALTER TABLE "tevento" ADD COLUMN "ack_utimestamp" BIGINT NOT NULL default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tgrupo`
|
||||
-- Table "tgrupo"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "tgrupo" ADD COLUMN "description" text;
|
||||
|
@ -152,7 +152,7 @@ ALTER TABLE "tgrupo" ADD COLUMN "contact" text;
|
|||
ALTER TABLE "tgrupo" ADD COLUMN "other" text;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_snmp`
|
||||
-- Table "talert_snmp"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "talert_snmp" ADD COLUMN "_snmp_f1_" text DEFAULT '';
|
||||
|
@ -165,7 +165,7 @@ ALTER TABLE "talert_snmp" ADD COLUMN "trap_type" INTEGER NOT NULL DEFAULT '-1';
|
|||
ALTER TABLE "talert_snmp" ADD COLUMN "single_value" varchar(255) DEFAULT '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tagente_modulo`
|
||||
-- Table "tagente_modulo"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tagente_modulo" ADD COLUMN "module_ff_interval" INTEGER NOT NULL default 0;
|
||||
ALTER TABLE "tagente_modulo" ADD COLUMN "quiet" SMALLINT NOT NULL default 0;
|
||||
|
@ -180,7 +180,7 @@ ALTER TABLE "tagente_modulo" ADD COLUMN "warning_inverse" SMALLINT NOT NULL defa
|
|||
ALTER TABLE "tagente_modulo" ADD COLUMN "cron_interval" varchar(100) default '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_filter`
|
||||
-- Table "tevent_filter"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE "tevent_filter" (
|
||||
"id_filter" SERIAL NOT NULL PRIMARY KEY,
|
||||
|
@ -201,7 +201,7 @@ CREATE TABLE "tevent_filter" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table "tconfig"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tconfig" ALTER COLUMN "value" TYPE TEXT;
|
||||
|
||||
|
@ -209,58 +209,58 @@ INSERT INTO tconfig ("token", "value") SELECT 'list_ACL_IPs_for_API', array_to_s
|
|||
INSERT INTO "tconfig" ("token", "value") VALUES ('event_fields', 'evento,id_agente,estado,timestamp');
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_item`
|
||||
-- Table "treport_content_item"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE treport_content_item ADD FOREIGN KEY("id_report_content") REFERENCES treport_content("id_rc") ON UPDATE CASCADE ON DELETE CASCADE;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport`
|
||||
-- Table "treport"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "treport" ADD COLUMN "id_template" INTEGER NOT NULL default 0;
|
||||
ALTER TABLE "treport" ADD COLUMN "id_group_edit" BIGINT NOT NULL default 0;
|
||||
ALTER TABLE "treport" ADD COLUMN "metaconsole" SMALLINT DEFAULT 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tgraph`
|
||||
-- Table "tgraph"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tgraph" ADD COLUMN "id_graph_template" INTEGER NOT NULL default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `ttipo_modulo`
|
||||
-- Table "ttipo_modulo"
|
||||
-- -----------------------------------------------------
|
||||
UPDATE "ttipo_modulo" SET "descripcion"='Generic data' WHERE "id_tipo"=1;
|
||||
UPDATE "ttipo_modulo" SET "descripcion"='Generic data incremental' WHERE "id_tipo"=4;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `treport_content_item`
|
||||
-- Table "treport_content_item"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "treport_content_item" ADD COLUMN "operation" text default '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tmensajes`
|
||||
-- Table "tmensajes"
|
||||
-- -----------------------------------------------------
|
||||
ALTER TABLE "tmensajes" ALTER COLUMN "mensaje" TYPE TEXT;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_compound`
|
||||
-- Table "talert_compound"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "talert_compound" ADD COLUMN "special_day" SMALLINT default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table "tnetwork_component"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "tnetwork_component" ADD COLUMN "unit" text default '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `talert_commands`
|
||||
-- Table "talert_commands"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
INSERT INTO "talert_commands" ("name", "command", "description", "internal") VALUES ('Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table "tconfig"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
INSERT INTO "tconfig" ("token", "value") VALUES
|
||||
|
@ -279,7 +279,7 @@ INSERT INTO "tconfig" ("token", "value") VALUES
|
|||
('enable_refr', 0);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tpassword_history`
|
||||
-- Table "tpassword_history"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE "tpassword_history" (
|
||||
"id_pass" INTEGER NOT NULL PRIMARY KEY,
|
||||
|
@ -290,13 +290,13 @@ CREATE TABLE "tpassword_history" (
|
|||
);
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tconfig`
|
||||
-- Table "tconfig"
|
||||
-- -----------------------------------------------------
|
||||
UPDATE TABLE tconfig SET "value"='comparation'
|
||||
WHERE "token"='prominent_time';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table "tnetwork_component"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
CREATE TYPE type_tnetwork_component_wizard_level AS ENUM ('basic','advanced','custom','nowizard');
|
||||
|
@ -305,25 +305,25 @@ ALTER TABLE "tnetwork_component" ADD COLUMN "only_metaconsole" INTEGER default '
|
|||
ALTER TABLE "tnetwork_component" ADD COLUMN "macros" TEXT default '';
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tplugin`
|
||||
-- Table "tplugin"
|
||||
-- -----------------------------------------------------
|
||||
|
||||
ALTER TABLE "tplugin" ADD COLUMN "macros" TEXT default '';
|
||||
ALTER TABLE "tplugin" ADD COLUMN "parameters" TEXT default '';
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `trecon_task`
|
||||
-- Table "trecon_task"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "trecon_task" ALTER COLUMN "subnet" TYPE TEXT;
|
||||
ALTER TABLE "trecon_task" ALTER COLUMN "field1" TYPE TEXT;
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tlayout_data`
|
||||
-- Table "tlayout_data"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "tlayout_data" ADD COLUMN "enable_link" SMALLINT NOT NULL default 1;
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tnetwork_component`
|
||||
-- Table "tnetwork_component"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "tnetwork_component" ADD COLUMN "critical_instructions" text default '';
|
||||
ALTER TABLE "tnetwork_component" ADD COLUMN "warning_instructions" text default '';
|
||||
|
@ -332,7 +332,7 @@ ALTER TABLE "tnetwork_component" ADD COLUMN "critical_inverse" SMALLINT NOT NULL
|
|||
ALTER TABLE "tnetwork_component" ADD COLUMN "warning_inverse" SMALLINT NOT NULL default 0;
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tnetwork_map`
|
||||
-- Table "tnetwork_map"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "tnetwork_map" ADD COLUMN "text_filter" VARCHAR(100) DEFAULT '';
|
||||
ALTER TABLE "tnetwork_map" ADD COLUMN "dont_show_subgroups" INTEGER NOT NULL DEFAULT 0;
|
||||
|
@ -341,12 +341,12 @@ ALTER TABLE "tnetwork_map" ADD COLUMN "show_modules" INTEGER NOT NULL DEFAULT 0;
|
|||
ALTER TABLE "tnetwork_map" ADD COLUMN "show_groups" INTEGER NOT NULL DEFAULT 0;
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Table `tagente_estado`
|
||||
-- Table "tagente_estado"
|
||||
------------------------------------------------------------------------
|
||||
ALTER TABLE "tagente_estado" ADD COLUMN "last_known_status" INTEGER default 0;
|
||||
|
||||
-- -----------------------------------------------------
|
||||
-- Table `tevent_response`
|
||||
-- Table "tevent_response"
|
||||
-- -----------------------------------------------------
|
||||
CREATE TABLE IF NOT EXISTS "tevent_response" (
|
||||
"id" SERIAL NOT NULL PRIMARY KEY,
|
||||
|
@ -360,3 +360,39 @@ CREATE TABLE IF NOT EXISTS "tevent_response" (
|
|||
"new_window" INTEGER NOT NULL DEFAULT 0,
|
||||
"params" TEXT,
|
||||
);
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table "talert_actions"
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field4" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field5" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field6" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field7" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field8" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field9" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_actions" ADD COLUMN "field10" TEXT NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table "talert_templates"
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field4" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field5" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field6" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field7" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field8" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field9" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field10" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field4_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field5_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field6_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field7_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field8_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field9_recovery" TEXT NOT NULL;
|
||||
ALTER TABLE "talert_templates" ADD COLUMN "field10_recovery" TEXT NOT NULL;
|
||||
|
||||
-- ----------------------------------------------------------------------
|
||||
-- Table "talert_commands"
|
||||
-- ----------------------------------------------------------------------
|
||||
ALTER TABLE "talert_commands" ADD COLUMN "fields_descriptions" TEXT;
|
||||
ALTER TABLE "talert_commands" ADD COLUMN "fields_values" TEXT;
|
||||
|
||||
|
|
|
@ -110,11 +110,19 @@ if ($copy_action) {
|
|||
if ($create_action) {
|
||||
$name = (string) get_parameter ('name');
|
||||
$id_alert_command = (int) get_parameter ('id_command');
|
||||
$field1 = (string) get_parameter ('field1');
|
||||
$field2 = (string) get_parameter ('field2');
|
||||
$field3 = (string) get_parameter ('field3');
|
||||
$group = (string) get_parameter ('group');
|
||||
$action_threshold = (int) get_parameter ('action_threshold');
|
||||
|
||||
$fields_descriptions = array();
|
||||
$fields_values = array();
|
||||
$info_fields = '';
|
||||
$values = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$values['field'.$i] = (string) get_parameter ('field'.$i.'_value');
|
||||
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
|
||||
}
|
||||
|
||||
$values['id_group'] = (string) get_parameter ('group');
|
||||
$values['action_threshold'] = (int) get_parameter ('action_threshold');
|
||||
|
||||
$name_check = db_get_value ('name', 'talert_actions', 'name', $name);
|
||||
|
||||
if ($name_check) {
|
||||
|
@ -122,14 +130,10 @@ if ($create_action) {
|
|||
}
|
||||
else {
|
||||
$result = alerts_create_alert_action ($name, $id_alert_command,
|
||||
array ('field1' => $field1,
|
||||
'field2' => $field2,
|
||||
'field3' => $field3,
|
||||
'id_group' => $group,
|
||||
'action_threshold' => $action_threshold));
|
||||
$values);
|
||||
|
||||
$info = 'Name: ' . $name . ' ID alert Command: ' . $id_alert_command .
|
||||
' Field1: ' . $field1 . ' Field2: ' . $field2 . ' Field3: ' . $field3 . ' Group: ' . $group .
|
||||
$info_fields . ' Group: ' . $group .
|
||||
' Action threshold: ' . $action_threshold;
|
||||
}
|
||||
|
||||
|
@ -169,21 +173,22 @@ if ($update_action) {
|
|||
|
||||
$name = (string) get_parameter ('name');
|
||||
$id_alert_command = (int) get_parameter ('id_command');
|
||||
$field1 = (string) get_parameter ('field1');
|
||||
$field2 = (string) get_parameter ('field2');
|
||||
$field3 = (string) get_parameter ('field3');
|
||||
$group = get_parameter ('group');
|
||||
$action_threshold = (int) get_parameter ('action_threshold');
|
||||
|
||||
$values = array ();
|
||||
$info_fields = '';
|
||||
$values = array();
|
||||
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$values['field'.$i] = (string) get_parameter ('field'.$i.'_value');
|
||||
$info_fields .= ' Field1: ' . $values['field'.$i];
|
||||
}
|
||||
|
||||
$values['name'] = $name;
|
||||
$values['id_alert_command'] = $id_alert_command;
|
||||
$values['field1'] = $field1;
|
||||
$values['field2'] = $field2;
|
||||
$values['field3'] = $field3;
|
||||
$values['id_group'] = $group;
|
||||
$values['action_threshold'] = $action_threshold;
|
||||
|
||||
|
||||
if (!$name) {
|
||||
$result = '';
|
||||
}
|
||||
|
@ -191,7 +196,7 @@ if ($update_action) {
|
|||
$result = alerts_update_alert_action ($id, $values);
|
||||
|
||||
$info = 'Name: ' . $name . ' ID alert Command: ' . $id_alert_command .
|
||||
' Field1: ' . $field1 . ' Field2: ' . $field2 . ' Field3: ' . $field3 . ' Group: ' . $group .
|
||||
$info_fields . ' Group: ' . $group .
|
||||
' Action threshold: ' . $action_threshold;
|
||||
}
|
||||
|
||||
|
@ -324,4 +329,4 @@ html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
|||
html_print_input_hidden ('create_alert', 1);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -39,6 +39,55 @@ if (is_ajax ()) {
|
|||
$command['description'] = io_safe_input(str_replace("\r\n","<br>", io_safe_output($command['description'])));
|
||||
}
|
||||
|
||||
// Get the html rows of the fields form
|
||||
|
||||
// Descriptions are stored in json
|
||||
$fields_descriptions = empty($command['fields_descriptions']) ? '' : json_decode($command['fields_descriptions'], true);
|
||||
|
||||
// Fields values are stored in json
|
||||
$fields_values = empty($command['fields_values']) ? '' : json_decode($command['fields_values'], true);
|
||||
|
||||
$fields_rows = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if(!empty($fields_descriptions[$i-1])) {
|
||||
$fdesc = $fields_descriptions[$i-1].' <span style="font-size:xx-small; font-weight:normal;">('.sprintf(__('Field %s'), $i).')</span>';
|
||||
}
|
||||
else {
|
||||
$fdesc = sprintf(__('Field %s'), $i);
|
||||
}
|
||||
|
||||
if(!empty($fields_values[$i-1])) {
|
||||
$fields_value_select = array();
|
||||
$fv = $fields_values[$i-1];
|
||||
$fv = explode(';', $fv);
|
||||
|
||||
if(empty($fv)) {
|
||||
$fv = array();
|
||||
}
|
||||
|
||||
foreach($fv as $fv_option) {
|
||||
$fv_option = explode(',', $fv_option);
|
||||
$fields_value_select[$fv_option[0]] = $fv_option[1];
|
||||
}
|
||||
|
||||
$ffield = html_print_select($fields_value_select, 'field'.$i.'_value', '', '', '', 0, true, false, false);
|
||||
}
|
||||
else {
|
||||
$ffield = html_print_textarea ('field'.$i.'_value', 1, 1, '', 'style="min-height:40px" class="fields"', true);
|
||||
}
|
||||
|
||||
$fields_rows[$i] = '<tr id="table1-field'.$i.'" class="datos">
|
||||
<td style="font-weight:bold;width:20%" class="datos">
|
||||
'.$fdesc.'
|
||||
</td>
|
||||
<td class="datos">
|
||||
'.$ffield.'
|
||||
</td>
|
||||
</tr>';
|
||||
}
|
||||
|
||||
$command['fields_rows'] = $fields_rows;
|
||||
|
||||
echo json_encode ($command);
|
||||
}
|
||||
return;
|
||||
|
@ -55,13 +104,28 @@ if ($create_command) {
|
|||
$name = (string) get_parameter ('name');
|
||||
$command = (string) get_parameter ('command');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
||||
$fields_descriptions = array();
|
||||
$fields_values = array();
|
||||
$info_fields = '';
|
||||
$values = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$fields_descriptions[] = (string) get_parameter ('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter ('field'.$i.'_values');
|
||||
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
|
||||
}
|
||||
|
||||
$values['fields_values'] = json_encode($fields_values);
|
||||
$values['fields_descriptions'] = json_encode($fields_descriptions);
|
||||
$values['description'] = $description;
|
||||
|
||||
$name_check = db_get_value ('name', 'talert_commands', 'name', $name);
|
||||
|
||||
if (!$name_check) {
|
||||
$result = alerts_create_alert_command ($name, $command,
|
||||
array ('description' => $description));
|
||||
$values);
|
||||
|
||||
$info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description;
|
||||
$info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description. ' ' .$info_fields;
|
||||
}
|
||||
else {
|
||||
$result = '';
|
||||
|
@ -87,11 +151,24 @@ if ($update_command) {
|
|||
require ("general/noaccess.php");
|
||||
exit;
|
||||
}
|
||||
|
||||
$name = (string) get_parameter ('name');
|
||||
$command = (string) get_parameter ('command');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
||||
$values = array ();
|
||||
$fields_descriptions = array();
|
||||
$fields_values = array();
|
||||
$info_fields = '';
|
||||
$values = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$fields_descriptions[] = (string) get_parameter ('field'.$i.'_description');
|
||||
$fields_values[] = (string) get_parameter ('field'.$i.'_values');
|
||||
$info_fields .= ' Field'.$i.': ' . $values['field'.$i];
|
||||
}
|
||||
|
||||
$values['fields_values'] = json_encode($fields_values);
|
||||
$values['fields_descriptions'] = json_encode($fields_descriptions);
|
||||
|
||||
$values['name'] = $name;
|
||||
$values['command'] = $command;
|
||||
$values['description'] = $description;
|
||||
|
@ -102,7 +179,7 @@ if ($update_command) {
|
|||
}
|
||||
else {
|
||||
$result = alerts_update_alert_command ($id, $values);
|
||||
$info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description;
|
||||
$info = 'Name: ' . $name . ' Command: ' . $command . ' Description: ' . $description. ' ' .$info_fields;
|
||||
}
|
||||
|
||||
if ($result) {
|
||||
|
|
|
@ -120,13 +120,14 @@ if ($update_template) {
|
|||
$id = (int) get_parameter ('id');
|
||||
|
||||
$recovery_notify = (bool) get_parameter ('recovery_notify');
|
||||
$field2_recovery = (string) get_parameter ('field2_recovery');
|
||||
$field3_recovery = (string) get_parameter ('field3_recovery');
|
||||
|
||||
$result = alerts_update_alert_template ($id,
|
||||
array ('recovery_notify' => $recovery_notify,
|
||||
'field2_recovery' => $field2_recovery,
|
||||
'field3_recovery' => $field3_recovery));
|
||||
|
||||
$fields_recovery = array();
|
||||
for($i=2;$i<=10;$i++) {
|
||||
$fields_recovery['field'.$i.'_recovery'] = (string) get_parameter ('field'.$i);
|
||||
}
|
||||
$values = $fields_recovery;
|
||||
$values['recovery_notify'] = $recovery_notify;
|
||||
$result = alerts_update_alert_template ($id, $values);
|
||||
|
||||
ui_print_result_message ($result,
|
||||
__('Successfully updated'),
|
||||
|
@ -295,4 +296,4 @@ html_print_submit_button (__('Create'), 'create', false, 'class="sub next"');
|
|||
html_print_input_hidden ('create_alert', 1);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -71,9 +71,6 @@ else
|
|||
|
||||
$name = '';
|
||||
$id_command = '';
|
||||
$field1 = '';
|
||||
$field2 = '';
|
||||
$field3 = '';
|
||||
$group = 0; //All group is 0
|
||||
$action_threshold = 0; //All group is 0
|
||||
|
||||
|
@ -81,9 +78,7 @@ if ($id) {
|
|||
$action = alerts_get_alert_action ($id);
|
||||
$name = $action['name'];
|
||||
$id_command = $action['id_alert_command'];
|
||||
$field1 = $action['field1'];
|
||||
$field2 = $action['field2'];
|
||||
$field3 = $action['field3'];
|
||||
|
||||
$group = $action ['id_group'];
|
||||
$action_threshold = $action ['action_threshold'];
|
||||
}
|
||||
|
@ -122,17 +117,15 @@ $table->data[2][1] .= '<div id="command_description" style=""></div>';
|
|||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_input_text ('action_threshold', $action_threshold, '', 5, 7, true);
|
||||
$table->data[3][1] .= ' '.__('seconds') . ui_print_help_icon ('action_threshold', true);
|
||||
$table->data[4][0] = __('Field 1');
|
||||
$table->data[4][1] = html_print_input_text ('field1', $field1, '', 35, 255, true) . ui_print_help_icon ('alert_macros', true);
|
||||
|
||||
$table->data[5][0] = __('Field 2');
|
||||
$table->data[5][1] = html_print_input_text ('field2', $field2, '', 80, 255, true);
|
||||
|
||||
$table->data[6][0] = __('Field 3');
|
||||
$table->data[6][1] = html_print_textarea ('field3', 10, 30, $field3, '', true);
|
||||
|
||||
$table->data[7][0] = __('Command preview');
|
||||
$table->data[7][1] = html_print_textarea ('command_preview', 10, 30, '', 'disabled="disabled"', true);
|
||||
$table->data[4][0] = __('Command preview');
|
||||
$table->data[4][1] = html_print_textarea ('command_preview', 10, 30, '', 'disabled="disabled"', true);
|
||||
$row = 5;
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$table->data['field'.$i][0] = 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
|
||||
$table->data['field'.$i][1] .= html_print_input_hidden('field'.$i.'_value', isset($action['field'.$i]) ? $action['field'.$i] : '', true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_actions">';
|
||||
html_print_table ($table);
|
||||
|
@ -186,13 +179,24 @@ $(document).ready (function () {
|
|||
render_command_preview (original_command);
|
||||
command_description = js_html_entity_decode (data["description"]);
|
||||
render_command_description(command_description);
|
||||
for(i=1;i<=10;i++) {
|
||||
var old_value = '';
|
||||
// Only keep the value if is provided from hidden (first time)
|
||||
if($("[name=field"+i+"_value]").attr('id') == "hidden-field"+i+"_value") {
|
||||
old_value = $("[name=field"+i+"_value]").val();
|
||||
}
|
||||
|
||||
$('#table1-field'+i).replaceWith(data["fields_rows"][i]);
|
||||
$("[name=field"+i+"_value]").val(old_value);
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
});
|
||||
|
||||
$("#text-field1").keyup (render_command_preview);
|
||||
$("#text-field2").keyup (render_command_preview);
|
||||
$("#textarea_field3").keyup (render_command_preview);
|
||||
// Charge the fields of the
|
||||
$("#id_command").trigger('change');
|
||||
|
||||
$(".fields").keyup (render_command_preview);
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -31,11 +31,24 @@ $id = (int) get_parameter ('id');
|
|||
$name = '';
|
||||
$command = '';
|
||||
$description = '';
|
||||
$fields_descriptions = '';
|
||||
$fields_values = '';
|
||||
if ($id) {
|
||||
$alert = alerts_get_alert_command ($id);
|
||||
$name = $alert['name'];
|
||||
$command = $alert['command'];
|
||||
$description = $alert['description'];
|
||||
|
||||
$fields_descriptions = $alert['fields_descriptions'];
|
||||
$fields_values = $alert['fields_values'];
|
||||
}
|
||||
|
||||
if(!empty($fields_descriptions)) {
|
||||
$fields_descriptions = json_decode($fields_descriptions, true);
|
||||
}
|
||||
|
||||
if(!empty($fields_values)) {
|
||||
$fields_values = json_decode($fields_values, true);
|
||||
}
|
||||
|
||||
// Header
|
||||
|
@ -44,18 +57,45 @@ ui_print_page_header (__('Alerts').' » '.__('Configure alert command'), "i
|
|||
$table->width = '98%';
|
||||
$table->style = array ();
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->size = array ();
|
||||
$table->size[0] = '20%';
|
||||
$table->data = array ();
|
||||
|
||||
$table->colspan[0][1] = 3;
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text ('name', $name, '', 35, 255, true);
|
||||
$table->data[0][2] = html_print_input_text ('name', $name, '', 35, 255, true);
|
||||
|
||||
$table->colspan[1][1] = 3;
|
||||
$table->data[1][0] = __('Command');
|
||||
$table->data[1][0] .= ui_print_help_icon ('alert_macros', true);
|
||||
$table->data[1][1] = html_print_input_text ('command', $command, '', 80, 255, true);
|
||||
|
||||
$table->colspan[2][1] = 3;
|
||||
$table->data[2][0] = __('Description');
|
||||
$table->data[2][1] = html_print_textarea ('description', 10, 30, $description, '', true);
|
||||
|
||||
for($i=1;$i<=10;$i++) {
|
||||
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s description'), $i);
|
||||
if(!empty($fields_descriptions)) {
|
||||
$field_description = $fields_descriptions[$i-1];
|
||||
}
|
||||
else {
|
||||
$field_description = '';
|
||||
}
|
||||
$table->data['field'.$i][1] = html_print_input_text ('field'.$i.'_description', $field_description, '', 35, 255, true);
|
||||
|
||||
$table->data['field'.$i][2] = sprintf(__('Field %s values'), $i);
|
||||
if(!empty($fields_values)) {
|
||||
$field_values = $fields_values[$i-1];
|
||||
}
|
||||
else {
|
||||
$field_values = '';
|
||||
}
|
||||
$table->data['field'.$i][3] = html_print_input_text ('field'.$i.'_values', $field_values, '', 65, 255, true);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_commands">';
|
||||
html_print_table ($table);
|
||||
|
||||
|
@ -71,4 +111,4 @@ else {
|
|||
}
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
?>
|
||||
?>
|
||||
|
|
|
@ -170,7 +170,7 @@ function update_template ($step) {
|
|||
|
||||
if (empty ($id))
|
||||
return false;
|
||||
|
||||
|
||||
if ($step == 1) {
|
||||
$name = (string) get_parameter ('name');
|
||||
$description = (string) get_parameter ('description');
|
||||
|
@ -211,66 +211,57 @@ function update_template ($step) {
|
|||
$threshold = (int) get_parameter ('threshold');
|
||||
$max_alerts = (int) get_parameter ('max_alerts');
|
||||
$min_alerts = (int) get_parameter ('min_alerts');
|
||||
$field1 = (string) get_parameter ('field1');
|
||||
$field2 = (string) get_parameter ('field2');
|
||||
$field3 = (string) get_parameter ('field3');
|
||||
|
||||
$default_action = (int) get_parameter ('default_action');
|
||||
if (empty ($default_action)) {
|
||||
$default_action = NULL;
|
||||
}
|
||||
|
||||
$values = array ('monday' => $monday,
|
||||
'tuesday' => $tuesday,
|
||||
'wednesday' => $wednesday,
|
||||
'thursday' => $thursday,
|
||||
'friday' => $friday,
|
||||
'saturday' => $saturday,
|
||||
'sunday' => $sunday,
|
||||
'special_day' => $special_day,
|
||||
'time_threshold' => $threshold,
|
||||
'id_alert_action' => $default_action,
|
||||
'field1' => $field1,
|
||||
'field2' => $field2,
|
||||
'field3' => $field3,
|
||||
'max_alerts' => $max_alerts,
|
||||
'min_alerts' => $min_alerts
|
||||
);
|
||||
|
||||
$fields = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$values['field'.$i] = $fields[$i] = (string) get_parameter ('field'.$i);
|
||||
}
|
||||
|
||||
// Different datetimes format for oracle
|
||||
switch ($config['dbtype']){
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$values = array ('monday' => $monday,
|
||||
'tuesday' => $tuesday,
|
||||
'wednesday' => $wednesday,
|
||||
'thursday' => $thursday,
|
||||
'friday' => $friday,
|
||||
'saturday' => $saturday,
|
||||
'sunday' => $sunday,
|
||||
'special_day' => $special_day,
|
||||
'time_from' => $time_from,
|
||||
'time_to' => $time_to,
|
||||
'time_threshold' => $threshold,
|
||||
'id_alert_action' => $default_action,
|
||||
'field1' => $field1,
|
||||
'field2' => $field2,
|
||||
'field3' => $field3,
|
||||
'max_alerts' => $max_alerts,
|
||||
'min_alerts' => $min_alerts
|
||||
);
|
||||
$values['time_from'] = $time_from;
|
||||
$values['time_to'] = $time_to;
|
||||
break;
|
||||
case "oracle":
|
||||
$values = array ('monday' => $monday,
|
||||
'tuesday' => $tuesday,
|
||||
'wednesday' => $wednesday,
|
||||
'thursday' => $thursday,
|
||||
'friday' => $friday,
|
||||
'saturday' => $saturday,
|
||||
'sunday' => $sunday,
|
||||
'special_day' => $special_day,
|
||||
'time_from' => "#to_date('" . $time_from . "','hh24:mi:ss')",
|
||||
'time_to' => "#to_date('" . $time_to . "','hh24:mi:ss')",
|
||||
'time_threshold' => $threshold,
|
||||
'id_alert_action' => $default_action,
|
||||
'field1' => $field1,
|
||||
'field2' => $field2,
|
||||
'field3' => $field3,
|
||||
'max_alerts' => $max_alerts,
|
||||
'min_alerts' => $min_alerts
|
||||
);
|
||||
$values['time_from'] = "#to_date('" . $time_from . "','hh24:mi:ss')";
|
||||
$values['time_to'] = "#to_date('" . $time_to . "','hh24:mi:ss')";
|
||||
break;
|
||||
}
|
||||
|
||||
$result = alerts_update_alert_template ($id, $values);
|
||||
}
|
||||
elseif ($step == 3) {
|
||||
$recovery_notify = (bool) get_parameter ('recovery_notify');
|
||||
$field2_recovery = (string) get_parameter ('field2_recovery');
|
||||
$field3_recovery = (string) get_parameter ('field3_recovery');
|
||||
|
||||
$values = array ('recovery_notify' => $recovery_notify,
|
||||
'field2_recovery' => $field2_recovery,
|
||||
'field3_recovery' => $field3_recovery);
|
||||
$fields_recovery = array();
|
||||
for($i=2;$i<=10;$i++) {
|
||||
$fields_recovery['field'.$i] = (string) get_parameter ('field'.$i);
|
||||
}
|
||||
$values = $fields_recovery;
|
||||
$values['recovery_notify'] = $recovery_notify;
|
||||
|
||||
$result = alerts_update_alert_template ($id, $values);
|
||||
}
|
||||
|
@ -313,9 +304,10 @@ $saturday = true;
|
|||
$sunday = true;
|
||||
$special_day = false;
|
||||
$default_action = 0;
|
||||
$field1 = '';
|
||||
$field2 = '';
|
||||
$field3 = '';
|
||||
$fields = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$fields[$i] = '';
|
||||
}
|
||||
$priority = 1;
|
||||
$min_alerts = 0;
|
||||
$max_alerts = 1;
|
||||
|
@ -338,29 +330,19 @@ if ($create_template) {
|
|||
$id_group = get_parameter ("id_group");
|
||||
$name_check = db_get_value ('name', 'talert_templates', 'name', $name);
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case "mysql":
|
||||
case "postgresql":
|
||||
$values = array ('description' => $description,
|
||||
'value' => $value,
|
||||
'max_value' => $max,
|
||||
'min_value' => $min,
|
||||
'id_group' => $id_group,
|
||||
'matches_value' => $matches,
|
||||
'priority' => $priority);
|
||||
break;
|
||||
case "oracle":
|
||||
$values = array ('description' => $description,
|
||||
'value' => $value,
|
||||
'max_value' => $max,
|
||||
'min_value' => $min,
|
||||
'id_group' => $id_group,
|
||||
'matches_value' => $matches,
|
||||
'priority' => $priority,
|
||||
'field3' => ' ',
|
||||
'field3_recovery' => ' ');
|
||||
break;
|
||||
$values = array ('description' => $description,
|
||||
'value' => $value,
|
||||
'max_value' => $max,
|
||||
'min_value' => $min,
|
||||
'id_group' => $id_group,
|
||||
'matches_value' => $matches,
|
||||
'priority' => $priority);
|
||||
|
||||
if($config['dbtype'] == "oracle") {
|
||||
$values['field3'] = ' ';
|
||||
$values['field3_recovery'] = ' ';
|
||||
}
|
||||
|
||||
if (!$name_check) {
|
||||
$result = alerts_create_alert_template ($name, $type, $values);
|
||||
}
|
||||
|
@ -420,13 +402,18 @@ if ($id && ! $create_template) {
|
|||
$max_alerts = $template['max_alerts'];
|
||||
$min_alerts = $template['min_alerts'];
|
||||
$threshold = $template['time_threshold'];
|
||||
$fields = array();
|
||||
for($i=1;$i<=10;$i++) {
|
||||
$fields[$i] = $template['field'.$i];
|
||||
}
|
||||
$recovery_notify = $template['recovery_notify'];
|
||||
$field2_recovery = $template['field2_recovery'];
|
||||
$field3_recovery = $template['field3_recovery'];
|
||||
|
||||
$fields_recovery = array();
|
||||
for($i=2;$i<=10;$i++) {
|
||||
$fields_recovery[$i] = $template['field'.$i.'_recovery'];
|
||||
}
|
||||
|
||||
$default_action = $template['id_alert_action'];
|
||||
$field1 = $template['field1'];
|
||||
$field2 = $template['field2'];
|
||||
$field3 = $template['field3'];
|
||||
$priority = $template['priority'];
|
||||
$id_group = $template["id_group"];
|
||||
}
|
||||
|
@ -446,9 +433,6 @@ if ($step == 2) {
|
|||
/* Firing conditions and events */
|
||||
$table->colspan = array ();
|
||||
$table->colspan[4][1] = 3;
|
||||
$table->colspan['field1'][1] = 3;
|
||||
$table->colspan['field2'][1] = 3;
|
||||
$table->colspan['field3'][1] = 3;
|
||||
|
||||
$table->data[0][0] = __('Days of week');
|
||||
$table->data[0][1] = __('Mon');
|
||||
|
@ -488,14 +472,23 @@ if ($step == 2) {
|
|||
$table->data[3][3] = html_print_input_text ('max_alerts', $max_alerts, '',
|
||||
5, 7, true);
|
||||
|
||||
$table->data['field1'][0] = __('Field 1') . ui_print_help_icon ('alert_macros', true);
|
||||
$table->data['field1'][1] = html_print_input_text ('field1', $field1, '', 70, 255, true);
|
||||
|
||||
$table->data['field2'][0] = __('Field 2') . ui_print_help_icon ('alert_macros', true);
|
||||
$table->data['field2'][1] = html_print_input_text ('field2', $field2, '', 70, 255, true);
|
||||
|
||||
$table->data['field3'][0] = __('Field 3') . ui_print_help_icon ('alert_macros', true);
|
||||
$table->data['field3'][1] = html_print_textarea ('field3', 10, 30, $field3, '', true);
|
||||
$table->colspan['fields_switch'][0] = 4;
|
||||
$table->data['fields_switch'][0] = '<a href="javascript:toggle_fields();">'.__('Advanced fields management').' '.html_print_image('images/down.png',true).'</a>';
|
||||
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if(isset($template[$name])) {
|
||||
$value = $template[$name];
|
||||
}
|
||||
else {
|
||||
$value = '';
|
||||
}
|
||||
|
||||
$table->colspan['field'.$i][1] = 3;
|
||||
$table->rowclass['field'.$i] = 'row_field';
|
||||
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s'), $i) . ui_print_help_icon ('alert_macros', true);
|
||||
$table->data['field'.$i][1] = html_print_textarea ('field'.$i, 1, 1, isset($fields[$i]) ? $fields[$i] : '', 'style="min-height:40px" class="fields"', true);
|
||||
}
|
||||
|
||||
$table->data[4][0] = __('Default action');
|
||||
$usr_groups = implode(',', array_keys(users_get_groups($config['id_user'], 'LM', true)));
|
||||
|
@ -518,6 +511,13 @@ else if ($step == 3) {
|
|||
$table->rowstyle = array ();
|
||||
$table->rowstyle['field2'] = 'display:none;';
|
||||
$table->rowstyle['field3'] = 'display:none';
|
||||
$table->rowstyle['field4'] = 'display:none';
|
||||
$table->rowstyle['field5'] = 'display:none';
|
||||
$table->rowstyle['field6'] = 'display:none';
|
||||
$table->rowstyle['field7'] = 'display:none';
|
||||
$table->rowstyle['field8'] = 'display:none';
|
||||
$table->rowstyle['field9'] = 'display:none';
|
||||
$table->rowstyle['field10'] = 'display:none';
|
||||
}
|
||||
$table->data[0][0] = __('Alert recovery');
|
||||
$values = array (false => __('Disabled'), true => __('Enabled'));
|
||||
|
@ -525,13 +525,10 @@ else if ($step == 3) {
|
|||
'recovery_notify', $recovery_notify, '', '', '', true, false,
|
||||
false);
|
||||
|
||||
$table->data['field2'][0] = __('Field 2');
|
||||
$table->data['field2'][1] = html_print_input_text ('field2_recovery',
|
||||
$field2_recovery, '', 35, 255, true);
|
||||
|
||||
$table->data['field3'][0] = __('Field 3');
|
||||
$table->data['field3'][1] = html_print_textarea ('field3_recovery', 10, 30,
|
||||
$field3_recovery, '', true);
|
||||
for($i=2;$i<=10;$i++) {
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s'), $i);
|
||||
$table->data['field'.$i][1] = html_print_textarea ('field'.$i, 1, 1, isset($fields_recovery[$i]) ? $fields_recovery[$i] : '', 'style="min-height:40px" class="fields"', true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* Step 1 by default */
|
||||
|
@ -714,6 +711,12 @@ function render_example () {
|
|||
}
|
||||
}
|
||||
|
||||
function toggle_fields() {
|
||||
$('.row_field').toggle();
|
||||
}
|
||||
|
||||
toggle_fields();
|
||||
|
||||
$(document).ready (function () {
|
||||
<?php
|
||||
if ($step == 1) {
|
||||
|
@ -876,10 +879,10 @@ elseif ($step == 3) {
|
|||
?>
|
||||
$("#recovery_notify").change (function () {
|
||||
if (this.value == 1) {
|
||||
$("#template-field2, #template-field3").show ();
|
||||
$("#template-field2, #template-field3, #template-field4, #template-field5, #template-field6, #template-field7, #template-field8, #template-field9, #template-field10").show ();
|
||||
}
|
||||
else {
|
||||
$("#template-field2, #template-field3").hide ();
|
||||
$("#template-field2, #template-field3, #template-field4, #template-field5, #template-field6, #template-field7, #template-field8, #template-field9, #template-field10").hide ();
|
||||
}
|
||||
});
|
||||
<?php
|
||||
|
@ -887,4 +890,4 @@ elseif ($step == 3) {
|
|||
?>
|
||||
})
|
||||
/* ]]> */
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
var original_command = "";
|
||||
|
||||
function parse_alert_command (command) {
|
||||
value = $("#text-field1").attr ("value");
|
||||
re = /_FIELD1_/gi;
|
||||
command = command.replace (re, value);
|
||||
|
||||
value = $("#text-field2").attr ("value");
|
||||
re = /_FIELD2_/gi;
|
||||
command = command.replace (re, value);
|
||||
|
||||
value = $("#textarea_field3").val();
|
||||
re = /_FIELD3_/gi;
|
||||
command = command.replace (re, value);
|
||||
var nfield = 1;
|
||||
$('.fields').each(function() {
|
||||
var field = '_field'+nfield+'_';
|
||||
nfield++;
|
||||
var regex = new RegExp(field,"gi");
|
||||
command = command.replace (regex, $(this).val());
|
||||
});
|
||||
|
||||
return command;
|
||||
}
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
--
|
||||
BEGIN
|
||||
LOCK TABLE talert_commands IN EXCLUSIVE MODE;
|
||||
INSERT INTO talert_commands VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO talert_commands VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO talert_commands VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO talert_commands VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO talert_commands VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO talert_commands VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO talert_commands VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO talert_commands VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO talert_commands VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO talert_commands VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
|
||||
COMMIT;
|
||||
END;;
|
||||
|
@ -502,22 +502,23 @@ END;;
|
|||
-- example alert template
|
||||
BEGIN
|
||||
LOCK TABLE talert_commands IN EXCLUSIVE MODE;
|
||||
INSERT INTO talert_commands VALUES (10,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
INSERT INTO talert_commands (id, name, command, description, internal) VALUES (10,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE talert_actions IN EXCLUSIVE MODE;
|
||||
INSERT INTO talert_actions VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO talert_actions VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
INSERT INTO talert_actions (id, name, id_alert_command, field1, field2, field3, id_group, action_threshold) VALUES (3,'Pandora FMS Event',3,'','','',0,0);
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
BEGIN
|
||||
LOCK TABLE talert_templates IN EXCLUSIVE MODE;
|
||||
INSERT INTO talert_templates VALUES (1,'Critical 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 VALUES (2,'Manual 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 VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','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] Alert RECOVERED for WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',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 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 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 condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','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] Alert RECOVERED for WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',3,0,0);
|
||||
COMMIT;
|
||||
END;;
|
||||
|
||||
|
|
|
@ -24,16 +24,16 @@
|
|||
-- Dumping data for table "talert_commands"
|
||||
--
|
||||
|
||||
INSERT INTO "talert_commands" VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO "talert_commands" VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO "talert_commands" VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO "talert_commands" VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO "talert_commands" VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO "talert_commands" VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO "talert_commands" VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO "talert_commands" VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO "talert_commands" VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO "talert_commands" VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands)));
|
||||
|
||||
--
|
||||
|
@ -418,16 +418,17 @@ INSERT INTO "tgis_map_layer" VALUES (1,'Group All',1,0,1,0);
|
|||
SELECT setval('tgis_map_layer_id_tmap_layer_seq', (SELECT (SELECT MAX(id_tmap_layer) FROM tgis_map_layer)));
|
||||
|
||||
-- example alert template
|
||||
INSERT INTO "talert_commands" VALUES (10,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
INSERT INTO "talert_commands" ("id", "name", "command", "description", "internal") VALUES (10,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
SELECT setval('talert_commands_id_seq', (SELECT (SELECT MAX(id) FROM talert_commands)));
|
||||
|
||||
INSERT INTO "talert_actions" VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO "talert_actions" VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
INSERT INTO "talert_actions" ("id", "name", "id_alert_command", "field1", "field2", "field3", "id_group", "action_threshold") VALUES (3,'Pandora FMS Event',3,'','','',0,0);
|
||||
SELECT setval('talert_actions_id_seq', (SELECT (SELECT MAX(id) FROM talert_actions)));
|
||||
|
||||
INSERT INTO "talert_templates" VALUES (1,'Critical 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" VALUES (2,'Manual 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" VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','warning','',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 WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',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 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 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 condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','warning','',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 WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',3,0,0);
|
||||
SELECT setval('talert_templates_id_seq', (SELECT (SELECT MAX(id) FROM talert_templates)));
|
||||
|
||||
-- treport_custom_sql Data
|
||||
|
|
|
@ -292,7 +292,9 @@ CREATE TABLE talert_commands (
|
|||
name VARCHAR2(100) default '',
|
||||
command CLOB default '',
|
||||
description CLOB default '',
|
||||
internal NUMBER(10, 0) default 0
|
||||
internal NUMBER(10, 0) default 0,
|
||||
fields_descriptions CLOB default '',
|
||||
fields_values CLOB default ''
|
||||
);
|
||||
|
||||
CREATE SEQUENCE talert_commands_s INCREMENT BY 1 START WITH 1;
|
||||
|
@ -306,6 +308,13 @@ CREATE TABLE talert_actions (
|
|||
field1 CLOB default '',
|
||||
field2 CLOB default '',
|
||||
field3 CLOB default '',
|
||||
field4 CLOB default '',
|
||||
field5 CLOB default '',
|
||||
field6 CLOB default '',
|
||||
field7 CLOB default '',
|
||||
field8 CLOB default '',
|
||||
field9 CLOB default '',
|
||||
field10 CLOB default '',
|
||||
id_group NUMBER(19, 0) default 0 NOT NULL,
|
||||
action_threshold NUMBER(19, 0) default 0 NOT NULL
|
||||
);
|
||||
|
@ -324,9 +333,16 @@ CREATE TABLE talert_templates (
|
|||
name CLOB default '',
|
||||
description CLOB,
|
||||
id_alert_action NUMBER(10, 0) REFERENCES talert_actions(id) ON DELETE SET NULL,
|
||||
field1 CLOB default '',
|
||||
field2 CLOB default '',
|
||||
field3 CLOB NOT NULL,
|
||||
field1 CLOB NOT NULL default '',
|
||||
field2 CLOB NOT NULL default '',
|
||||
field3 CLOB NOT NULL default '',
|
||||
field4 CLOB NOT NULL default '',
|
||||
field5 CLOB NOT NULL default '',
|
||||
field6 CLOB NOT NULL default '',
|
||||
field7 CLOB NOT NULL default '',
|
||||
field8 CLOB NOT NULL default '',
|
||||
field9 CLOB NOT NULL default '',
|
||||
field10 CLOB NOT NULL default '',
|
||||
type VARCHAR2(50),
|
||||
value VARCHAR2(255) default '',
|
||||
matches_value NUMBER(5, 0) default 0,
|
||||
|
@ -345,8 +361,15 @@ CREATE TABLE talert_templates (
|
|||
saturday NUMBER(5, 0) default 1,
|
||||
sunday NUMBER(5, 0) default 1,
|
||||
recovery_notify NUMBER(5, 0) default 0,
|
||||
field2_recovery CLOB default '',
|
||||
field3_recovery CLOB NOT NULL,
|
||||
field2_recovery CLOB NOT NULL default '',
|
||||
field3_recovery CLOB NOT NULL default '',
|
||||
field4_recovery CLOB NOT NULL default '',
|
||||
field5_recovery CLOB NOT NULL default '',
|
||||
field6_recovery CLOB NOT NULL default '',
|
||||
field7_recovery CLOB NOT NULL default '',
|
||||
field8_recovery CLOB NOT NULL default '',
|
||||
field9_recovery CLOB NOT NULL default '',
|
||||
field10_recovery CLOB NOT NULL default '',
|
||||
priority NUMBER(10, 0) default 0 NOT NULL,
|
||||
id_group NUMBER(10, 0) default 0 NOT NULL,
|
||||
special_day NUMBER(5, 0) default 0,
|
||||
|
|
|
@ -272,7 +272,9 @@ CREATE TABLE "talert_commands" (
|
|||
"name" varchar(100) NOT NULL default '',
|
||||
"command" text default '',
|
||||
"description" text default '',
|
||||
"internal" SMALLINT default 0
|
||||
"internal" SMALLINT default 0,
|
||||
"fields_descriptions" text default '',
|
||||
"fields_values" text default ''
|
||||
);
|
||||
|
||||
CREATE TABLE "talert_actions" (
|
||||
|
@ -280,8 +282,15 @@ CREATE TABLE "talert_actions" (
|
|||
"name" text default '',
|
||||
"id_alert_command" INTEGER NOT NULL default 0 REFERENCES talert_commands("id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
"field1" text NOT NULL default '',
|
||||
"field2" text default '',
|
||||
"field3" text default '',
|
||||
"field2" text NOT NULL default '',
|
||||
"field3" text NOT NULL default '',
|
||||
"field4" text NOT NULL default '',
|
||||
"field5" text NOT NULL default '',
|
||||
"field6" text NOT NULL default '',
|
||||
"field7" text NOT NULL default '',
|
||||
"field8" text NOT NULL default '',
|
||||
"field9" text NOT NULL default '',
|
||||
"field10" text NOT NULL default '',
|
||||
"id_group" BIGINT NOT NULL default 0,
|
||||
"action_threshold" BIGINT NOT NULL default 0
|
||||
);
|
||||
|
@ -292,9 +301,16 @@ CREATE TABLE "talert_templates" (
|
|||
"name" text default '',
|
||||
"description" TEXT,
|
||||
"id_alert_action" INTEGER REFERENCES talert_actions("id") ON DELETE SET NULL ON UPDATE CASCADE,
|
||||
"field1" text default '',
|
||||
"field2" text default '',
|
||||
"field3" text NOT NULL,
|
||||
"field1" text NOT NULL default '',
|
||||
"field2" text NOT NULL default '',
|
||||
"field3" text NOT NULL default '',
|
||||
"field4" text NOT NULL default '',
|
||||
"field5" text NOT NULL default '',
|
||||
"field6" text NOT NULL default '',
|
||||
"field7" text NOT NULL default '',
|
||||
"field8" text NOT NULL default '',
|
||||
"field9" text NOT NULL default '',
|
||||
"field10" text NOT NULL default '',
|
||||
"type" type_talert_templates_alert_template,
|
||||
"value" varchar(255) default '',
|
||||
"matches_value" SMALLINT default 0,
|
||||
|
@ -314,7 +330,14 @@ CREATE TABLE "talert_templates" (
|
|||
"sunday" SMALLINT default 1,
|
||||
"recovery_notify" SMALLINT default 0,
|
||||
"field2_recovery" text NOT NULL default '',
|
||||
"field3_recovery" text NOT NULL,
|
||||
"field3_recovery" text NOT NULL default '',
|
||||
"field4_recovery" text NOT NULL default '',
|
||||
"field5_recovery" text NOT NULL default '',
|
||||
"field6_recovery" text NOT NULL default '',
|
||||
"field7_recovery" text NOT NULL default '',
|
||||
"field8_recovery" text NOT NULL default '',
|
||||
"field9_recovery" text NOT NULL default '',
|
||||
"field10_recovery" text NOT NULL default '',
|
||||
"priority" INTEGER NOT NULL default 0,
|
||||
"id_group" INTEGER NOT NULL default 0,
|
||||
"special_day" SMALLINT default 0
|
||||
|
|
|
@ -287,6 +287,8 @@ CREATE TABLE IF NOT EXISTS `talert_commands` (
|
|||
`command` text,
|
||||
`description` text,
|
||||
`internal` tinyint(1) default 0,
|
||||
`fields_descriptions` TEXT,
|
||||
`fields_values` TEXT,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
@ -298,8 +300,15 @@ CREATE TABLE IF NOT EXISTS `talert_actions` (
|
|||
`name` text,
|
||||
`id_alert_command` int(10) unsigned NULL default 0,
|
||||
`field1` text NOT NULL,
|
||||
`field2` text,
|
||||
`field3` text,
|
||||
`field2` text NOT NULL,
|
||||
`field3` text NOT NULL,
|
||||
`field4` text NOT NULL,
|
||||
`field5` text NOT NULL,
|
||||
`field6` text NOT NULL,
|
||||
`field7` text NOT NULL,
|
||||
`field8` text NOT NULL,
|
||||
`field9` text NOT NULL,
|
||||
`field10` text NOT NULL,
|
||||
`id_group` mediumint(8) unsigned NULL default 0,
|
||||
`action_threshold` int(10) NOT NULL default '0',
|
||||
PRIMARY KEY (`id`),
|
||||
|
@ -315,9 +324,16 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
|||
`name` text,
|
||||
`description` mediumtext,
|
||||
`id_alert_action` int(10) unsigned NULL,
|
||||
`field1` text,
|
||||
`field2` text,
|
||||
`field1` text NOT NULL,
|
||||
`field2` text NOT NULL,
|
||||
`field3` text NOT NULL,
|
||||
`field4` text NOT NULL,
|
||||
`field5` text NOT NULL,
|
||||
`field6` text NOT NULL,
|
||||
`field7` text NOT NULL,
|
||||
`field8` text NOT NULL,
|
||||
`field9` text NOT NULL,
|
||||
`field10` text NOT NULL,
|
||||
`type` ENUM ('regex', 'max_min', 'max', 'min', 'equal', 'not_equal', 'warning', 'critical', 'onchange', 'unknown', 'always'),
|
||||
`value` varchar(255) default '',
|
||||
`matches_value` tinyint(1) default 0,
|
||||
|
@ -338,6 +354,13 @@ CREATE TABLE IF NOT EXISTS `talert_templates` (
|
|||
`recovery_notify` tinyint(1) default '0',
|
||||
`field2_recovery` text NOT NULL,
|
||||
`field3_recovery` text NOT NULL,
|
||||
`field4_recovery` text NOT NULL,
|
||||
`field5_recovery` text NOT NULL,
|
||||
`field6_recovery` text NOT NULL,
|
||||
`field7_recovery` text NOT NULL,
|
||||
`field8_recovery` text NOT NULL,
|
||||
`field9_recovery` text NOT NULL,
|
||||
`field10_recovery` text NOT NULL,
|
||||
`priority` tinyint(4) default '0',
|
||||
`id_group` mediumint(8) unsigned NULL default 0,
|
||||
`special_day` tinyint(1) default 0,
|
||||
|
|
|
@ -24,16 +24,16 @@
|
|||
-- Dumping data for table `talert_commands`
|
||||
--
|
||||
|
||||
INSERT INTO `talert_commands` VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO `talert_commands` VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO `talert_commands` VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO `talert_commands` VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO `talert_commands` VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO `talert_commands` VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO `talert_commands` VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO `talert_commands` VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO `talert_commands` VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO `talert_commands` VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (1,'eMail','Internal type', 'This alert send an email using internal Pandora FMS Server SMTP capabilities (defined in each server, using:\r\n_field1_ as destination email address, and\r\n_field2_ as subject for message. \r\n_field3_ as text of message.', 1);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (2,'Internal Audit','Internal type','This alert save alert in Pandora interal audit system. Fields are static and only _field1_ is used.', 1);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (3,'Pandora FMS Event','Internal type','This alert create an special event into Pandora FMS event manager.', 1);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (4,'Pandora FMS Alertlog','echo _timestamp_ pandora _agent_ _data_ _field1_ _field2_ >> /var/log/pandora/pandora_alert.log','This is a default alert to write alerts in a standard ASCII plaintext log file in /var/log/pandora/pandora_alert.log\r\n', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (5,'SNMP Trap','/usr/bin/snmptrap -v 1 -c trap_public 192.168.0.4 1.1.1.1.1.1.1.1 _agent_ _field1_','Send a SNMPTRAP to 192.168.0.4. Please review config and adapt to your needs, this is only a sample, not functional itself.', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (6,'Syslog','logger -p daemon.alert Pandora Alert _agent_ _data_ _field1_ _field2_','Uses field1 and field2 to generate Syslog alert in facility daemon with "alert" level.', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (7,'Sound Alert','/usr/bin/play /usr/share/sounds/alarm.wav','', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (8,'Jabber Alert','echo _field3_ | sendxmpp -r _field1_ --chatroom _field2_','Send jabber alert to chat room in a predefined server (configure first .sendxmpprc file). Uses field3 as text message, field1 as useralias for source message, and field2 for chatroom name', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (9,'SMS','sendsms _field1_ _field2_','Send SMS using the Pandora FMS standard SMS device, using smstools. Uses field2 as text message, field1 as destination phone (include international prefix!)', 0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (10,'Validate Event','Internal type','This alert validate the events matched with a module given the agent name (_field1_) and module name (_field2_)', 1);
|
||||
|
||||
--
|
||||
-- Dumping data for table `tconfig`
|
||||
|
@ -406,19 +406,19 @@ INSERT INTO `tgis_map_layer` VALUES (1,'Group All',1,0,1,0);
|
|||
|
||||
-- example alert template
|
||||
|
||||
INSERT INTO `talert_commands` VALUES (11,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
INSERT INTO `talert_commands` (`id`, `name`, `command`, `description`, `internal`) VALUES (11,'Remote agent control','/usr/share/pandora_server/udp_client.pl _address_ 41122 "_field1_"','This command is used to send commands to the Pandora FMS agents with the UDP server enabled. The UDP server is used to order agents (Windows and UNIX) to "refresh" the agent execution: that means, to force the agent to execute and send data to s',0);
|
||||
|
||||
INSERT INTO `talert_actions` VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (1,'Mail to XXX',1,'yourmail@domain.es','[PANDORA] Alert from agent _agent_ on module _module_','',0,0);
|
||||
|
||||
INSERT INTO `talert_actions` VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (2,'Restart agent',10,'REFRESH AGENT','','',0,0);
|
||||
|
||||
INSERT INTO `talert_actions` VALUES (3,'Pandora FMS Event',3,'','','',0,0);
|
||||
INSERT INTO `talert_actions` (`id`, `name`, `id_alert_command`, `field1`, `field2`, `field3`, `id_group`, `action_threshold`) VALUES (3,'Pandora FMS Event',3,'','','',0,0);
|
||||
|
||||
INSERT INTO `talert_templates` VALUES (1,'Critical 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 (1,'Critical 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` VALUES (2,'Manual 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 (2,'Manual 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` VALUES (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','warning','',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 WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',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 (3,'Warning condition','This is a generic alert template to fire on WARNING condition.',1,'','','Hello, this is an automated email coming from Pandora FMS

This alert has been fired because a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
','warning','',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 WARNING status on _agent_ / _module_','Hello, this is an automated email coming from Pandora FMS

This alert has been RECOVERED from a WARNING condition in one of your monitored items:

Agent : _agent_
Module: _module_
Module description: _moduledescription_
Timestamp _timestamp_
Current value: _data_

Thanks for your time.

Best regards
Pandora FMS
',3,0,0);
|
||||
|
||||
-- treport_custom_sql Data
|
||||
INSERT INTO `treport_custom_sql` (`id`, `name`, `sql`) VALUES (1, 'Monitoring Report Agent', 'select direccion, nombre, comentarios, (select nombre from tgrupo where tgrupo.id_grupo = tagente.id_grupo) as `group` from tagente;');
|
||||
|
|
Loading…
Reference in New Issue