Reply
Accepted Solution

NetMRI_Easy.pm and special prompts?

Authority
Posts: 37
4520     0

Is it possible to use NetMRI_Easy.pm with special prompts, such as the '?' and /]' in the example below?  It doesn't look like $easy->send_command( $cmd) can handle it, but I am wondering if there is a special trick that ca be used (hidden methods/variables, etc.)? Using NetMRI 6.9.4.

 

nms-lab-rtr#delete flash:test.txt
Delete filename [test.txt]?
Delete bootflash:/test.txt? [confirm]

Re: NetMRI_Easy.pm and special prompts?

Expert
Posts: 262
4520     0

In CCS there is a directive that let's you temporarily define a different prompt string, so it likely existing in NetMRI_Easy.  But do you really need to do that?  If you just want the operation to complete regardless of the incremental prompts, append \r\r to the command:

  "delete flash:test.txt\r\r"

The check for the prompt won't occur until after those two empty newlines are sent.

 

I've used this for a long time to clean up various files in flash, whether they exist or not.

 

Highlighted

Re: NetMRI_Easy.pm and special prompts?

Expert
Posts: 262
4520     0

BTW, this topic probably is more fitting in the Network Automation forum.

Re: NetMRI_Easy.pm and special prompts?

Authority
Posts: 37
4521     0

Thanks!! That works, though I would still like to find out if there is a way to change the prompt send_command is looking for. I'm not sure there is -- the "answer" may be to use the full blown Perl API, which would be extreme overkill (or use CCS, but I'm porting a bunch of scripts and would like to avoid switching languages as much as possible).

 

Did you mean the Network Change and Configuration Management "topic"? That's the closest I see to a list of forums (other than the Groups, which I believe are used for the TABs). 

Re: NetMRI_Easy.pm and special prompts?

Adviser
Posts: 53
4521     0

See my reply on the following topic. It has the answers you are looking for.

 

https://community.infoblox.com/t5/Network-Change-Configuration/Interactive-commands-OR-How-to-set-a-...

 

Thanks,

- Chris

 

 

Re: NetMRI_Easy.pm and special prompts?

Authority
Posts: 37
4521     0

As I mentioned, I'm on 6.9.4, so it doesn't help me much. And it looks like I have at least one script I need to bring over that I need to wait on the non-standard prompt (i.e. I do not think the \r trick will work on). Is there a way to do this with 6.9.4's CCS? Or does the full Perl API support regex's for the prompt (based on the docs I have looked at, it doesn't seem to, at least not in the CliConnection.pm's that I have looked at. It doesn't look like the WAPI's send_command accepts RegExs for the prompt either. Or is there a variable that can ve set (e.g. with set_variable), and if so, does anyone know that variable name?

 

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You