2011-10-06 Koichiro Kikuchi <koichiro@rworks.jp>

* pandora_server/lib/PandoraFMS/DB.pm: Added function to get module group name.
	* pandora_server/lib/PandoraFMS/Core.pm: Added new alert macros.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5044 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
koichirok 2011-10-06 02:46:55 +00:00
parent dc9e65d5c2
commit ef27da683d
3 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2011-10-06 Koichiro Kikuchi <koichiro@rworks.jp>
* lib/PandoraFMS/DB.pm: Added function to get module group name.
* lib/PandoraFMS/Core.pm: Added new alert macros.
2011-09-29 Sancho Lerena <slerena@artica.es>
* pandora_server/lib/PandoraFMS/SNMPServer.pm

View File

@ -728,8 +728,12 @@ sub pandora_execute_action ($$$$$$$$$;$) {
_alert_times_fired_ => $alert->{'times_fired'},
_alert_priority_ => $alert->{'priority'},
_module_ => (defined ($module)) ? $module->{'nombre'} : '',
_modulegroup_ => (defined ($module)) ? (get_module_group_name ($dbh, $module->{'id_module_group'}) || '') : '',
_moduledescription_ => (defined ($module)) ? $module->{'descripcion'} : '',
_id_agent_ => (defined ($module)) ? $module->{'id_agente'} : '',
_interval_ => (defined ($module) && $module->{'module_interval'} != 0) ? $module->{'module_interval'} : (defined ($agent)) ? $agent->{'intervalo'} : '',
_target_ip_ => (defined ($module)) ? $module->{'ip_target'} : '',
_target_port_ => (defined ($module)) ? $module->{'tcp_port'} : '',
_policy_ => (defined ($module)) ? enterprise_hook('get_policy_name', [$dbh, $module->{'id_policy_module'}]) : '',
);

View File

@ -56,6 +56,7 @@ our @EXPORT = qw(
get_group_name
get_module_agent_id
get_module_group_id
get_module_group_name
get_module_id
get_module_name
get_nc_profile_name
@ -301,6 +302,15 @@ sub get_module_group_id ($$) {
return defined ($rc) ? $rc : -1;
}
##########################################################################
## Return module group name given the module group id.
##########################################################################
sub get_module_group_name ($$) {
my ($dbh, $module_group_id) = @_;
return get_db_value ($dbh, "SELECT name FROM tmodule_group WHERE id_mg = ?", $module_group_id);
}
##########################################################################
## Return a network component's profile name given its ID.
##########################################################################