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:
ramonn 2010-05-25 13:16:34 +00:00
parent dba13be73f
commit 62bf64a668
2 changed files with 27 additions and 0 deletions

View File

@ -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

View File

@ -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.
##########################################################################