Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 7

NCM Ignore Extra Lines In Baseline Check

It there a way to tell NCM Baselines to only check for specific lines and ignore ALL others. I want to to setup a baseline that contains lines that should be on all network devices regardless where the lines are in the running-config.

If a device has EXTRA lines I do not want the baseline to fail.

For example:

My SNMP Baseline:

snmp-server community "xxxxxxxxxxxx" operator unrestricted

snmp-server community "xxxxxxxxxxxx" operator

snmp-server host xxxxxxxxxxxx community "xxxxxxxxxxxx" trap-level critical

snmp-server mib hpSwitchAuthMIB excluded

snmp-server contact "xxxxxxxxxxxx" location "Test Location"

This baseline fails because network switches sometimes contain between the above lines:

no snmp-server enable traps link-change x-xx

I could setup a regex to ignore this line but I would have to do that for every line that COULD exist.

My Idea of a baseline is a stripped down running-config that contains lines every switch on my network is expected to have.

I dont care if a switches has extra lines since they are most likely specific to that one single device.

Finally I want to check that all devices have the following config:

snmp-server contact "xxxxxxxxxxxx" 

my switches contain:

snmp-server contact "xxxxxxxxxxxx" location "Test Location"

Can I use regex to ignore:location "Test Location"  but still check for snmp-server contact "xxxxxxxxxxxx" they are both on the same line in the running-config.

3 Replies
Level 12

Are the added lines in consistent locations (meaning same line position)? If so you could split lines prior to that variable data into one baseline snippet and move everything after into its own baseline.

0 Kudos

I am wondering the same thing. I have no consistency in terms of the number of configured ports on my switches. So the length of the config file will always be different. I don't understand why I can't just flag the lines to look for and ignore all others no matter how many there are or what line number they occupy in the config file.

Sadly the lines are not in consistent locations.

0 Kudos