2013-09-03 Ramon Novoa <rnovoa@artica.es>
* extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql, extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql, extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql, godmode/tag/tag.php, godmode/tag/edit_tag.php, pandoradb.sql, pandoradb.postgreSQL.sql, pandoradb.oracle.sql, pandoradb_data.sql: Added support for tag phone information. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8731 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ce877b6e30
commit
3ef6758d5e
|
@ -1,3 +1,15 @@
|
|||
2013-09-03 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* extras/pandoradb_migrate_4.0.x_to_5.0.postgreSQL.sql,
|
||||
extras/pandoradb_migrate_4.0.x_to_5.0.mysql.sql,
|
||||
extras/pandoradb_migrate_4.0.x_to_5.0.oracle.sql,
|
||||
godmode/tag/tag.php,
|
||||
godmode/tag/edit_tag.php,
|
||||
pandoradb.sql,
|
||||
pandoradb.postgreSQL.sql,
|
||||
pandoradb.oracle.sql,
|
||||
pandoradb_data.sql: Added support for tag phone information.
|
||||
|
||||
2013-09-03 Miguel de Dios <miguel.dedios@artica.es>
|
||||
|
||||
* operation/tree.php, include/functions_treeview.php: improved the
|
||||
|
|
|
@ -453,6 +453,7 @@ ALTER TABLE `tusuario_perfil` ADD COLUMN `tags` TEXT NOT NULL;
|
|||
-- Table `ttag`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE `ttag` ADD COLUMN `email` text NULL;
|
||||
ALTER TABLE `ttag` ADD COLUMN `phone` text NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Add more fields in snmp alerts (05/03/13)
|
||||
|
|
|
@ -482,6 +482,7 @@ ALTER TABLE tusuario_perfil ADD (tags CLOB NOT NULL default '');
|
|||
-- Table `ttag`
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE ttag ADD (email CLOB NULL);
|
||||
ALTER TABLE ttag ADD (phone CLOB NULL);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Add more fields in snmp alerts (05/03/13)
|
||||
|
|
|
@ -467,6 +467,7 @@ ALTER TABLE "tusuario_perfil" ADD COLUMN "tags" text default '';
|
|||
-- Table "ttag"
|
||||
-- ---------------------------------------------------------------------
|
||||
ALTER TABLE "ttag" ADD COLUMN "email" TEXT NULL;
|
||||
ALTER TABLE "ttag" ADD COLUMN "phone" TEXT NULL;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- Add more fields in snmp alerts (05/03/13)
|
||||
|
|
|
@ -35,6 +35,7 @@ $description_tag = (string) get_parameter ("description_tag", "");
|
|||
$description_tag = io_safe_input(strip_tags(io_safe_output($description_tag)));
|
||||
$url_tag = (string) get_parameter ("url_tag", "");
|
||||
$email_tag = (string) get_parameter ("email_tag", "");
|
||||
$phone_tag = (string) get_parameter ("phone_tag", "");
|
||||
$tab = (string) get_parameter ("tab", "list");
|
||||
|
||||
if (defined('METACONSOLE'))
|
||||
|
@ -73,6 +74,7 @@ if ($update_tag && $id_tag != 0) {
|
|||
$values['description'] = $description_tag;
|
||||
$values['url'] = $url_tag;
|
||||
$values['email'] = $email_tag;
|
||||
$values['phone'] = $phone_tag;
|
||||
|
||||
$result = false;
|
||||
if ($values['name'] != '')
|
||||
|
@ -101,6 +103,7 @@ if ($create_tag) {
|
|||
$data['description'] = $description_tag;
|
||||
$data['url'] = $url_tag;
|
||||
$data['email'] = $email_tag;
|
||||
$data['phone'] = $phone_tag;
|
||||
|
||||
// DB insert
|
||||
$return_create = false;
|
||||
|
@ -129,12 +132,14 @@ if ($action == "update" && $id_tag != 0) {
|
|||
$description_tag = $result_tag["description"];
|
||||
$url_tag = $result_tag["url"];
|
||||
$email_tag = $result_tag["email"];
|
||||
$phone_tag = $result_tag["phone"];
|
||||
} // If current action is create (new) or somethig goes wrong fields are filled with void value
|
||||
else {
|
||||
$name_tag = "";
|
||||
$description_tag = "";
|
||||
$url_tag = "";
|
||||
$email_tag = "";
|
||||
$phone_tag = "";
|
||||
}
|
||||
|
||||
// Create/Update tag form
|
||||
|
@ -175,7 +180,15 @@ echo "<table border=0 cellpadding=4 cellspacing=4 class=databox width=98%>";
|
|||
echo "</td>";
|
||||
echo "<td align='left'>";
|
||||
html_print_textarea('email_tag', 5, 20, $email_tag);
|
||||
//html_print_input_text ('email_tag', $email_tag);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align='left'>";
|
||||
echo '<b>' . __("Phone") . '</b>';
|
||||
echo ui_print_help_tip (__("Associated phone number to use later in alerts associated to Tags."), true);
|
||||
echo "</td>";
|
||||
echo "<td align='left'>";
|
||||
html_print_textarea('phone_tag', 5, 20, $phone_tag);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
|
|
|
@ -163,7 +163,8 @@ if (!empty($result)) {
|
|||
$table->head[2] = __('Detail information');
|
||||
$table->head[3] = __('Number of modules affected');
|
||||
$table->head[4] = __('Email');
|
||||
$table->head[5] = __('Actions');
|
||||
$table->head[5] = __('Phone');
|
||||
$table->head[6] = __('Actions');
|
||||
|
||||
foreach ($result as $tag) {
|
||||
if ($rowPair)
|
||||
|
@ -198,9 +199,24 @@ if (!empty($result)) {
|
|||
"<a href='javascript: show_dialog(" . $tag["id_tag"] . ")'>" . html_print_image("images/rosette.png", true) . "" . "</a></span>";
|
||||
}
|
||||
$data[4] = $output;
|
||||
|
||||
$phone_large = io_safe_output($tag["phone"]);
|
||||
$phone_small = substr($phone_large,0, 24);
|
||||
if ($phone_large == $phone_small) {
|
||||
$output = $phone_large;
|
||||
}
|
||||
else {
|
||||
$output =
|
||||
"<div title='" . sprintf(__('Phones for the tag: %s'), $tag['name']) . "' style='display: none;' class='phone_large' id='phone_large_" . $tag["id_tag"] . "'>" .
|
||||
$phone_large . "</div>" .
|
||||
'<span id="value_' . $tag["id_tag"] . '">' .
|
||||
$phone_small . '</span> ' .
|
||||
"<a href='javascript: show_phone_dialog(" . $tag["id_tag"] . ")'>" . html_print_image("images/rosette.png", true) . "" . "</a></span>";
|
||||
}
|
||||
$data[5] = $output;
|
||||
|
||||
$data[5] = "<a href='index.php?sec=".$sec."&sec2=godmode/tag/edit_tag&action=update&id_tag=".$tag["id_tag"] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a> ";
|
||||
$data[5] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag["id_tag"] . '"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
|
||||
$data[6] = "<a href='index.php?sec=".$sec."&sec2=godmode/tag/edit_tag&action=update&id_tag=".$tag["id_tag"] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a> ";
|
||||
$data[6] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag["id_tag"] . '"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
|
||||
array_push ($table->data, $data);
|
||||
}
|
||||
|
||||
|
@ -234,8 +250,18 @@ ui_require_jquery_file ('cluetip');
|
|||
width: 400,
|
||||
height: 200
|
||||
});
|
||||
$(".phone_large").dialog(
|
||||
{
|
||||
autoOpen: false,
|
||||
resizable: true,
|
||||
width: 400,
|
||||
height: 200
|
||||
});
|
||||
});
|
||||
function show_dialog(id) {
|
||||
$("#email_large_" + id).dialog("open");
|
||||
}
|
||||
function show_phone_dialog(id) {
|
||||
$("#phone_large_" + id).dialog("open");
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1606,7 +1606,8 @@ CREATE TABLE ttag (
|
|||
name VARCHAR2(100) default '' NOT NULL,
|
||||
description CLOB default '' NOT NULL,
|
||||
url CLOB default '' NOT NULL,
|
||||
email CLOB NULL
|
||||
email CLOB NULL,
|
||||
phone CLOB NULL
|
||||
);
|
||||
|
||||
CREATE SEQUENCE ttag_s INCREMENT BY 1 START WITH 1;
|
||||
|
|
|
@ -1410,7 +1410,8 @@ CREATE TABLE "ttag" (
|
|||
"name" VARCHAR(100) NOT NULL default '',
|
||||
"description" text NOT NULL default '',
|
||||
"url" text NOT NULL default '',
|
||||
"email" text NULL
|
||||
"email" text NULL,
|
||||
"phone" text NULL
|
||||
);
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
|
|
@ -1494,6 +1494,7 @@ CREATE TABLE IF NOT EXISTS `ttag` (
|
|||
`description` text NOT NULL,
|
||||
`url` mediumtext NOT NULL,
|
||||
`email` text NULL,
|
||||
`phone` text NULL,
|
||||
PRIMARY KEY (`id_tag`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
|
|
@ -1016,7 +1016,7 @@ INSERT INTO `tplugin` (`id`, `name`, `description`, `max_timeout`, `execute`, `p
|
|||
|
||||
INSERT INTO `tagent_custom_fields` VALUES (1,'Serial Number',0),(2,'Department',0),(3,'Additional ID',0);
|
||||
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es',''),(2,'critical','Critical modules','',''),(3,'dmz','DMZ Network Zone','',''),(4,'performance','Performance anda capacity modules','',''),(5,'configuration','','','');
|
||||
INSERT INTO `ttag` VALUES (1,'network','Network equipment','http://artica.es','',''),(2,'critical','Critical modules','','',''),(3,'dmz','DMZ Network Zone','','',''),(4,'performance','Performance anda capacity modules','','',''),(5,'configuration','','','','');
|
||||
|
||||
INSERT INTO `tevent_response` VALUES (1,'Ping to host','Ping to the agent host','ping -c 5 _agent_address_','command',0,620,500,0,''),(2,'SSH to host','Connect via SSH to the agent','http://192.168.70.164:8022/anyterm.html?param=_User_@_agent_address_','url',0,800,450,0,'User'),(3,'Create incident from event','Create a incident from the event with the standard incidents system of Pandora FMS','index.php?sec=workspace&sec2=operation/incidents/incident_detail&insert_form&from_event=_event_id_','url',0,0,0,1,''),(4,'Create Integria IMS incident from event','Create a incident from the event with integria incidents system of Pandora FMS. 

Is necessary to enable and configure the Integria incidents in Pandora FMS setup.','index.php?sec=workspace&sec2=operation/integria_incidents/incident&tab=editor&from_event=_event_id_','url',0,0,0,1,''),(5,'Restart agent','Restart the agent with using UDP protocol.

To use this response is necessary to have installed Pandora FMS server and console in the same machine.','/usr/share/pandora_server/util/udp_client.pl _agent_address_ 41122 "REFRESH AGENT"','command',0,620,500,0,'');
|
||||
|
||||
|
|
Loading…
Reference in New Issue