Who Me Too'd this solution

Re: Using the Raw XML Editor to check for multiple statements
Posts: 7
This widget could not be displayed.
This widget could not be displayed.

For this section:


<!-- In the context of ConfigBlockCheck, the ConfigFileCheck will search
only the block, not the entire file by default. -->
<ConfigFileCheck op="contains-all">\s*storm-control broadcast level 20.*</ConfigFileCheck>
<ConfigFileCheck op="contains-all">\s*no cdp enable</ConfigFileCheck>
<ConfigFileCheck op="contains-all">\s*switchport port-secuirty maximum 3</ConfigFileCheck>
<ConfigFileCheck op="contains-all">\s*switchport port-security violation restrict</ConfigFileCheck>
<ConfigFileCheck op="contains-all">\s*ip arp inspection limit rate 150</ConfigFileCheck>
<ConfigFileCheck op="contains-all">\s*spanning-tree bpduguard enable</ConfigFileCheck>

You can list each regex on a separate line in a single ConfigFileCheck (be careful with the whitespace), or you can wrap all of those in an "and" Expr:


<Expr op="and">
  <ConfigFileCheck ...>
  <ConfigFileCheck ...>

The conditional for an If must be a single expression.


View solution in original post

Who Me Too'd this solution