From 4f9bbf23ce09073f57e869778956349392f9ba6a Mon Sep 17 00:00:00 2001
From: ramonn <noreply@pandorafms.org>
Date: Mon, 26 Jan 2009 12:01:27 +0000
Subject: [PATCH] 2009-01-26  Ramon Novoa  <rnovoa@artica.es>

	* lib/PandoraFMS/DB.pm: Added a new alert macro (_address_).




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1400 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
---
 pandora_server/ChangeLog            | 4 ++++
 pandora_server/lib/PandoraFMS/DB.pm | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog
index f86b5111f3..7e000b5096 100644
--- a/pandora_server/ChangeLog
+++ b/pandora_server/ChangeLog
@@ -1,3 +1,7 @@
+2009-01-26  Ramon Novoa  <rnovoa@artica.es>
+
+	* lib/PandoraFMS/DB.pm: Added a new alert macro (_address_).
+
 2009-01-26  Manuel Arostegui <marostegui@artica.es>
 
 	* util/udp_client: Added to repository. Remote alert execution
diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm
index 73ef5f5175..68026cb5bc 100644
--- a/pandora_server/lib/PandoraFMS/DB.pm
+++ b/pandora_server/lib/PandoraFMS/DB.pm
@@ -542,6 +542,9 @@ sub execute_alert (%$$$$$$$$$$$$$$$) {
 	if ($#actions < 0) {
 		return;
 	}
+	
+	# Get agent address
+	my $address = get_db_value ('direccion',  'tagente', 'id_agente', $id_agent, $dbh);
 
 	# Execute actions
 	foreach my $action (@actions) {
@@ -560,6 +563,7 @@ sub execute_alert (%$$$$$$$$$$$$$$$) {
 					  _field2_ => $field2,
 					  _field3_ => $field3,
 					  _agent_ => $agent,
+					  _address_ => $address,
 					  _timestamp_ => &UnixDate ("today", "%Y-%m-%d %H:%M:%S"),
 					  _data_ => $data,
 					  _alert_description_ => $alert->{'descripcion'},