2010-04-30 Ramon Novoa <rnovoa@artica.es>
* lib/PandoraFMS/Core.pm: Changed the behaviour of SNMP alerts. Alert conditions are ANDed, not ORed. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2642 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
70395d09d2
commit
4f22c5b6d9
|
@ -1,3 +1,8 @@
|
||||||
|
2010-04-30 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* lib/PandoraFMS/Core.pm: Changed the behaviour of SNMP alerts.
|
||||||
|
Alert conditions are ANDed, not ORed.
|
||||||
|
|
||||||
2010-04-28 Sancho Lerena <slerena@artica.es>
|
2010-04-28 Sancho Lerena <slerena@artica.es>
|
||||||
|
|
||||||
* util/gpx2pandora_agent_data.pl: Added support to process
|
* util/gpx2pandora_agent_data.pl: Added support to process
|
||||||
|
|
|
@ -1228,31 +1228,31 @@ sub pandora_evaluate_snmp_alerts ($$$$$$$$) {
|
||||||
|
|
||||||
logger($pa_config, "Evaluating SNMP alert ID " . $alert->{'id_as'} . ".", 10);
|
logger($pa_config, "Evaluating SNMP alert ID " . $alert->{'id_as'} . ".", 10);
|
||||||
|
|
||||||
my ($fire_alert, $alert_data) = (0, '');
|
my $alert_data = '';
|
||||||
my ($times_fired, $internal_counter, $alert_type) =
|
my ($times_fired, $internal_counter, $alert_type) =
|
||||||
($alert->{'times_fired'}, $alert->{'internal_counter'}, $alert->{'alert_type'});
|
($alert->{'times_fired'}, $alert->{'internal_counter'}, $alert->{'alert_type'});
|
||||||
|
|
||||||
# OID
|
# OID
|
||||||
my $oid = $alert->{'oid'};
|
my $oid = $alert->{'oid'};
|
||||||
if ($oid ne '' && $trap_oid =~ m/$oid/i || $trap_oid_text =~ m/$oid/i) {
|
if ($oid ne '') {
|
||||||
$fire_alert = 1;
|
next if ($trap_oid !~ m/$oid/i && $trap_oid_text !~ m/$oid/i);
|
||||||
$alert_data .= "OID: $oid ";
|
$alert_data .= "OID: $oid ";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom OID/value
|
# Custom OID/value
|
||||||
my $custom_oid = $alert->{'custom_oid'};
|
my $custom_oid = $alert->{'custom_oid'};
|
||||||
if ($custom_oid ne '' && $trap_custom_value =~ m/$custom_oid/i || $trap_custom_oid =~ m/$custom_oid/i) {
|
if ($custom_oid ne '') {
|
||||||
$fire_alert = 1;
|
next if ($trap_custom_value !~ m/$custom_oid/i && $trap_custom_oid !~ m/$custom_oid/i);
|
||||||
$alert_data .= "CUSTOM OID: $custom_oid ";
|
$alert_data .= "CUSTOM OID: $custom_oid ";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Agent IP
|
# Agent IP
|
||||||
my $agent = $alert->{'agent'};
|
my $agent = $alert->{'agent'};
|
||||||
if ($agent ne '' && $trap_agent =~ m/$agent/i ) {
|
if ($agent ne '') {
|
||||||
$fire_alert = 1;
|
next if ($trap_agent !~ m/$agent/i );
|
||||||
$alert_data .= "AGENT: $agent";
|
$alert_data .= "AGENT: $agent";
|
||||||
}
|
}
|
||||||
|
|
||||||
next unless ($fire_alert == 1);
|
|
||||||
|
|
||||||
# Check time threshold
|
# Check time threshold
|
||||||
$alert->{'last_fired'} = '0000-00-00 00:00:00' unless defined ($alert->{'last_fired'});
|
$alert->{'last_fired'} = '0000-00-00 00:00:00' unless defined ($alert->{'last_fired'});
|
||||||
return unless ($alert->{'last_fired'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
|
return unless ($alert->{'last_fired'} =~ /(\d+)\-(\d+)\-(\d+) +(\d+):(\d+):(\d+)/);
|
||||||
|
|
Loading…
Reference in New Issue