cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
473
Views
5
Helpful
4
Replies
Highlighted
Beginner

RME Compliance Check Regex

Hi,

Need some advice from some RME gurus here..

I have a lot of Cisco devices with inconsistant CLI line "transport input xxx"...

Some have "transport input telnet ssh" and some have "transport intput ssh". I want to check as long as they have the words "ssh", they are compliant. Can I now what regex should I use?

I tried "+transport input [#.*#] ssh" or "+transport input [#(\btelnet\b)?#] ssh"  but all fail.

Any suggestion would be much appreciated..

Thanks...

4 REPLIES 4
Highlighted
Cisco Employee

Hi,

If you want to test or find the command with SSH only use the below syntax

-------------------------------------------------------------------------------------

+ transport input ssh

in GLOBAL mode

-------------------------------------------------------------------

If you want to check for both Telnet \ SSH then use the below command

+ transport input [#(telnet|ssh)#]

Thanks-
Afroz
[Do rate the useful post]
****Ratings Encourages Contributors ****

Thanks- Afroz [Do rate the useful post] ****Ratings Encourages Contributors ****
Highlighted

Hi Afroj,

Thanks for the suggestion...I tried and it match half of it....I have two different string to match:

"transport input telnet ssh"

"transport input ssh"

How do I match BOTH of the strings? I tried: +[transport input (telnet|ssh) (ssh)?#] but fail...

Also, just curious...How come this check is in GLOBAL mode? I thought "transport input xxx" is within "line vty 0 4" and "line vty 5 15"?

Thanks..

Highlighted

No ,you are right , it should be under

Submode : as suggested by Joe          

[#line vty .*#]

also use this syntax :

+transport input [#(\btelnet\b)?#] ssh

Thanks-
Afroz
[Do rate the useful post]
****Ratings Encourages Contributors ****

Thanks- Afroz [Do rate the useful post] ****Ratings Encourages Contributors ****
Highlighted
Beginner

You script may be correct. Just check you are using this against submode commands?

As the transport input command will be in submode of line vty *.

The Baseline Template also allows you to verify commands within a sub-configuration section by using a “SubMode Block”.

The Baseline Template must be configured in Advanced Mode to allow SubMode Blocks. Under submode use following :

Submode :           [#line vty .*#]

Followed by your commands :

"+transport input [#.*#] ssh" or "+transport input [#(\btelnet\b)?#] ssh" 

-Thanks

Joe

Content for Community-Ad