theflyingcorpse / noma Goto Github PK
View Code? Open in Web Editor NEWNotification Manager - For Icinga / Nagios / Shinken / Centreon++
Home Page: https://www.netways.org/projects/noma
Notification Manager - For Icinga / Nagios / Shinken / Centreon++
Home Page: https://www.netways.org/projects/noma
I'm wondering that "vc*.kom" matches "vcvm.srv_kom" for a hostname rule. I looked into the source code and if I'm right this subroutine (in NoMa/notifier/lib/contacts.pm) is responsible for the observed behavior:
sub matchString { # test a string against a comma separated list and return 1 if it matches
my ($matchList, $match) =@_;
my @items = split( ',', $matchList );
@items = map( { lc($_) } @items );
for my $item (@items)
{
# remove leading/trailing whitespace
$item =~ s/^\s+|\s+$//g;
if ( $item ne '' )
{
# Use * and ? as wildcards
$item =~ s/\*/.*/g;
$item =~ s/\./\./g;
$item =~ s/\?/./g;
# only add item to list if it matches the passed one
return 1 if ( $match =~ m/^$item$/i );
}
}
return 0;
}
The treatment of "." in $item seems to be wrong, eventhough the dot will be correctly recognized, the replacement doesn't quote it right. $item still contains just a ".". The quoting expression should go like this:
$item =~ s/\./\\./g;
Could be verified by using following tests.
This matches, but should not:
perl -e '$p=".";$p=~s/\./\./g;$m="vc_kom";if($m =~ /$p/){print "$p matched $m\n"}'
Quoting it right, the dot really matches only literal dots:
perl -e '$p=".";$p=~s/\./\\./g;$m="vc_kom";if($m =~ /$p/){print "$p matched $m\n"}'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.