Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

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...

  • Network Management
4 REPLIES
Cisco Employee

Re: RME Compliance Check Regex

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 ****
New Member

Re: RME Compliance Check Regex

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..

Cisco Employee

RME Compliance Check Regex

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 ****
New Member

RME Compliance Check Regex

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

179
Views
0
Helpful
4
Replies