2010-05-25 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DB.pm: Added functions to get alert data (needed by pandora_manage.pl). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2795 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
dba13be73f
commit
62bf64a668
|
@ -1,3 +1,8 @@
|
|||
2010-05-25 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/DB.pm: Added functions to get alert data (needed by
|
||||
pandora_manage.pl).
|
||||
|
||||
2010-05-25 Ramon Novoa <rnovoa@artica.es>
|
||||
|
||||
* lib/PandoraFMS/DB.pm: Added functions to get the id of an OS, a
|
||||
|
|
|
@ -43,6 +43,8 @@ our @EXPORT = qw(
|
|||
get_server_id
|
||||
get_group_id
|
||||
get_os_id
|
||||
get_template_id
|
||||
get_template_module_id
|
||||
is_group_disabled
|
||||
);
|
||||
|
||||
|
@ -148,6 +150,26 @@ sub get_agent_module_id ($$$) {
|
|||
return defined ($rc) ? $rc : -1;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
## Return template id given the template name.
|
||||
##########################################################################
|
||||
sub get_template_id ($$) {
|
||||
my ($dbh, $template_name) = @_;
|
||||
|
||||
my $rc = get_db_value ($dbh, "SELECT id FROM talert_templates WHERE name = ?", $template_name);
|
||||
return defined ($rc) ? $rc : -1;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
## Return the module template id given the module id and the template id.
|
||||
##########################################################################
|
||||
sub get_template_module_id ($$$) {
|
||||
my ($dbh, $module_id, $template_id) = @_;
|
||||
|
||||
my $rc = get_db_value ($dbh, "SELECT id FROM talert_template_modules WHERE id_agent_module = ? AND id_alert_template = ?", $module_id, $template_id);
|
||||
return defined ($rc) ? $rc : -1;
|
||||
}
|
||||
|
||||
##########################################################################
|
||||
## Returns true if the given group is disabled, false otherwise.
|
||||
##########################################################################
|
||||
|
|
Loading…
Reference in New Issue