2010-09-08 Sancho Lerena <slerena@artica.es>

* lib/PandoraFMS/SNMPServer.pm
        lib/PandoraFMS/Core.pm: SNMP Trap console doesnt send trap value
        to alert function. Now does :-)




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3230 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
slerena 2010-09-08 16:53:44 +00:00
parent 38b98cf058
commit c17b42d264
3 changed files with 11 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2010-09-08 Sancho Lerena <slerena@artica.es>
* lib/PandoraFMS/SNMPServer.pm
lib/PandoraFMS/Core.pm: SNMP Trap console doesnt send trap value to
alert function. Now does :-)
2010-09-03 Sergio Martin <sergio.martin@artica.es>
* util/pandora_manage.pl: Added to CLI the option of

View File

@ -1231,15 +1231,15 @@ sub pandora_module_keep_alive_nd {
}
##########################################################################
=head2 C<< pandora_evaluate_snmp_alerts (I<$pa_config>, I<$trap_id>, I<$trap_agent>, I<$trap_oid>, I<$trap_oid_text>, I<$trap_custom_oid>, I<$trap_custom_value>, I<$dbh>) >>
=head2 C<< pandora_evaluate_snmp_alerts (I<$pa_config>, I<$trap_id>, I<$trap_agent>, I<$trap_oid>, I<$trap_oid_text>, I<$value>, I<$trap_custom_oid>, I<$trap_custom_value>, I<$dbh>) >>
Execute alerts that apply to the given SNMP trap.
=cut
##########################################################################
sub pandora_evaluate_snmp_alerts ($$$$$$$$) {
sub pandora_evaluate_snmp_alerts ($$$$$$$$$) {
my ($pa_config, $trap_id, $trap_agent, $trap_oid,
$trap_oid_text, $trap_custom_oid, $trap_custom_value, $dbh) = @_;
$trap_oid_text, $trap_value, $trap_custom_oid, $trap_custom_value, $dbh) = @_;
# Get all SNMP alerts
my @snmp_alerts = get_db_rows ($dbh, 'SELECT * FROM talert_snmp');
@ -1317,7 +1317,7 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$) {
WHERE talert_actions.id_alert_command = talert_commands.id
AND talert_actions.id = ?', $alert->{'id_alert'});
my $trap_rcv_full = $trap_oid . " " . $trap_custom_oid . " " . $trap_custom_value;
my $trap_rcv_full = $trap_oid . " " . $trap_value. " ". $trap_custom_oid . " " . $trap_custom_value;
pandora_execute_action ($pa_config, $trap_rcv_full, \%agent, \%alert, 1, $action, undef, $dbh, $timestamp) if (defined ($action));
# Generate an event

View File

@ -149,7 +149,7 @@ sub pandora_snmptrapd {
logger ($pa_config, "Received SNMP Trap from $source", 4);
# Evaluate alerts for this trap
pandora_evaluate_snmp_alerts ($pa_config, $trap_id, $source, $oid, $oid, $custom_oid, $custom_value, $dbh);
pandora_evaluate_snmp_alerts ($pa_config, $trap_id, $source, $oid, $oid, $value, $custom_oid, $custom_value, $dbh);
}
}