From: W.J.M. N. <Wim...@nl...> - 2016-07-22 13:21:07
|
Hallo, > I currently use another solution, that is not fully does, what I need, > but is good for now: > > ifAliasBox : only : .*uplink.* > > This line causes that only interfaces are listed, which hold the word > "uplink" in their alias field. Ok, I understand that. In module dm_tests.pm at about line 2220, it checks all the OIDs on the row in the table for an 'ignore' or an 'only' directive. Thus you can select only certain rows to appear in the table. This is new for me. > Thank you for your answers! I will come back to your hint with forming > another table. > > You said, that only the primary oid is valid for alarm definitions. Is > the primary one the first line in the oids file the corresponding > template? If so, would you think it is possible to simply switch ifName > with ifAlias and then use one of my alarm definition from my first message? > Yes. In the same module, at about line 2109, you can find: # Make the first oid (from left to right) the primary one my $pri = $1 if $line =~ /\{(.+?)\}/; in which $line contains the row definition of the table. It assigns the first name enclosed between curly brackets to $pri. Further on this variable is used in the alarms selection: my $pri_val = $oids->{$pri}{'val'}{$leaf}; my $alarm = 1; # Alarm by default my $a_val = $dev->{'except'}{$test}{$pri}{'alarm'} || $dev->{'except'}{'all'}{$pri}{'alarm'} || $tmpl->{'oids'}{$pri}{'except'}{'alarm'}; $alarm = ($pri_val =~ /^(?:$a_val)$/) ? 1 : 0 if defined $a_val; my $na_val = $dev->{'except'}{$test}{$pri}{'noalarm'} || $dev->{'except'}{'all'}{$pri}{'noalarm'} || $tmpl->{'oids'}{$pri}{'except'}{'noalarm'}; $alarm = 0 if defined $na_val and $pri_val =~ /^(?:$na_val)$/; So your proposal should work. Regards, Wim Nelis. |