We are using NCM v7.1 and I am having difficulty with writing a particular rule. I must add that this installation has
no connection to the internet.
My original search was for a specific line which included an IP address. If the line is found it is a good thing - the
information is noted that the rule was not violated. The problem is when I try to search for the text and any other IP
address except the original IP address then I have a problem. I have tried RegEx and String searches to no avail, until
recently I created a kluge.
Information:
I am looking for the a line in a network device configuration [logging server IP adress]:
logging 22.45.78.1 <==== this line contains the correct address
However the device configuration could actually contain more than one logging server (IP Address) which means there may
be more than one line with logging <IP Address> in the actual configuration - so that the following line:
logging 22.46.79.2 <==== is the line that needs to be flagged as a violation (this is the line that I am trying to find
in the configuration).
So in the actual device configuration you may see the following:
logging 22.45.78.1
logging 22.46.79.2
logging 10.200.153.97
In the above example the only valid address that should pass the original rule would be logging 22.45.78.1. The other
two lines would violate the rule as failed since the IP addresses do NOT match.
Here is the kluged Rule I have created:
String is found (checked)
Advanced Config Search (checked)
Config File [must not contain] [Find String] logging [!'22.45.78.1']
[or] Config File [must not contain] [RegEx expression]] logging [!'22.46.79.2']
[or] Config File [must contain] [RegEx expression] logging [!'22.45.78.1']
----------------------------------------------------------
Testing against configurations with the following lines in the configuration:
logging 22.45.78.1
logging 22.46.79.2
logging 10.200.153.97
yields the following:
o Pattern 'logging [!'22.45.78.1'] was not found
o Pattern 'logging [!'22.46.79.2'] was found
on line 151 logging 22.45.78.1
on line 152 logging 22.46.79.2
on line 153logging 10.200.153.97
o Pattern 'logging [!'22.45.78.1'] was found
on line 151 logging 22.45.78.1
on line 152 logging 22.46.79.2
on line 153logging 10.200.153.97
==================================
Question: Does anyone have a suggestion as to what really works in the NCM rules environment that is more elegant and
not kluged?
Thanks,
- Ted -