mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Added changes to snmp server to evaluate all filters in the same virtual world
This commit is contained in:
parent
91a39ab01e
commit
3f77b3ae7d
@ -196,10 +196,10 @@ sub pandora_snmptrapd {
|
|||||||
my ($pa_config, $line, $server_id, $dbh) = @_;
|
my ($pa_config, $line, $server_id, $dbh) = @_;
|
||||||
|
|
||||||
(my $trap_ver, $line) = split(/\[\*\*\]/, $line, 2);
|
(my $trap_ver, $line) = split(/\[\*\*\]/, $line, 2);
|
||||||
|
print STDERR "ANTES";
|
||||||
# Process SNMP filter
|
# Process SNMP filter
|
||||||
next if (matches_filter ($dbh, $pa_config, $line) == 1);
|
next if (matches_filter ($dbh, $pa_config, $line) == 1);
|
||||||
|
print STDERR "DESPUES";
|
||||||
logger($pa_config, "Reading trap '$line'", 10);
|
logger($pa_config, "Reading trap '$line'", 10);
|
||||||
my ($date, $time, $source, $oid, $type, $type_desc, $value, $data) = ('', '', '', '', '', '', '', '');
|
my ($date, $time, $source, $oid, $type, $type_desc, $value, $data) = ('', '', '', '', '', '', '', '');
|
||||||
|
|
||||||
@ -344,18 +344,13 @@ sub pandora_snmptrapd {
|
|||||||
########################################################################################
|
########################################################################################
|
||||||
sub matches_filter ($$$) {
|
sub matches_filter ($$$) {
|
||||||
my ($dbh, $pa_config, $string) = @_;
|
my ($dbh, $pa_config, $string) = @_;
|
||||||
use Data::Dumper;
|
|
||||||
$Data::Dumper::Sortkeys = 1;
|
|
||||||
my @filter_unique_functions = get_db_rows ($dbh, 'SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id');
|
my @filter_unique_functions = get_db_rows ($dbh, 'SELECT DISTINCT(unified_filters_id) FROM tsnmp_filter ORDER BY unified_filters_id');
|
||||||
Dumper("++++++++++++++++++++++");
|
|
||||||
Dumper(@filter_unique_functions);
|
|
||||||
Dumper("++++++++++++++++++++++");
|
|
||||||
foreach my $filter_unique_func (@filter_unique_functions) {
|
foreach my $filter_unique_func (@filter_unique_functions) {
|
||||||
# Get filters
|
# Get filters
|
||||||
my @filters = get_db_rows ($dbh, 'SELECT filter FROM tsnmp_filter WHERE unified_filters_id = ' . $filter_unique_func->{'unified_filters_id'});
|
my @filters = get_db_rows ($dbh, 'SELECT filter FROM tsnmp_filter WHERE unified_filters_id = ' . $filter_unique_func->{'unified_filters_id'});
|
||||||
Dumper("-----------------------");
|
|
||||||
Dumper(@filters);
|
|
||||||
Dumper("-----------------------");
|
|
||||||
my $eval_acum = 1;
|
my $eval_acum = 1;
|
||||||
foreach my $filter (@filters) {
|
foreach my $filter (@filters) {
|
||||||
my $regexp = safe_output($filter->{'filter'}) ;
|
my $regexp = safe_output($filter->{'filter'}) ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user