2010-05-25 Ramon Novoa <rnovoa@artica.es>

* lib/PandoraFMS/DB.pm: Added a function to get the id of an action
          (needed by pandora_manage.pl).




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2798 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2010-05-25 16:23:07 +00:00
parent 844c00a896
commit 4984e1c202
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-05-25 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/DB.pm: Added a function to get the id of an action
(needed by pandora_manage.pl).
2010-05-25 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Tools.pm: Set a default verbosity level for logger().

View File

@ -31,6 +31,7 @@ our @EXPORT = qw(
db_disconnect
db_do
db_insert
get_action_id
get_agent_id
get_agent_name
get_agent_module_id
@ -79,6 +80,16 @@ sub db_disconnect ($) {
$dbh->disconnect();
}
##########################################################################
## Return action ID given the action name.
##########################################################################
sub get_action_id ($$) {
my ($dbh, $action_name) = @_;
my $rc = get_db_value ($dbh, "SELECT id FROM talert_actions WHERE name = ?", $action_name);
return defined ($rc) ? $rc : -1;
}
##########################################################################
## Return agent ID given the agent name.
##########################################################################