04-21-2016 01:09 PM
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.
Delete filename [test.txt]?
Delete bootflash:/test.txt? [confirm]
Solved! Go to Solution.
04-21-2016 01:50 PM
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:
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.
04-21-2016 02:21 PM
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).
04-22-2016 06:35 AM
04-22-2016 04:44 PM
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?