Smarts NCM: ERR:Expect failed after sending the Ctrl-D command
search cancel

Smarts NCM: ERR:Expect failed after sending the Ctrl-D command

book

Article ID: 331086

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:


When pushing a configlet to a Juniper router (or group of Juniper routers), the job fails with the following error:

Pushing configuration file 'running' for IDX 200 with mechanism SSH WARN:Could not end configuration input mode. 
ERR:Expect failed after sending the Ctrl-D command WARN:Push of running failed Unable to push config file: running Configuration file 'running' for IDX 200 failed with error code 'Unspecified Error' in 54 seconds [SystemProperties] Action failed...

Environment

VMware Smart Assurance - NCM

Cause

There is no delay set in NCM for delivering consecutive commands to a device after entering terminal mode. With larger command sets, there may be some overlap and the device will not receive all commands correctly.

Resolution

A delay of 1 second is inserted into stdjuniperpush.inc.

** Any changes made to this file in the $VOYENCE_HOME/package/juniper directory will be overwritten if the package directory is restored or the DSr is updated. Please copy this file to $VOYENCE_HOME/custompackage/juniper and make modifications to the file from this location. 

As of this writing, file Version 21.0.75 and Version 21.0.104 are the same. At approximately line 387, you will see the following code:

        while(i<end){
            send(session,chomp(getLineNum(i,configFile))+stdEOL);


            i+=1;
        }
        LOG = "Sent lines :"+i;
        send(session,"#DONE"+stdEOL);
                
        /*while(waitFor(session,1,stdConfigPromptState)){
            LOG = "found prompts in the buffer";
        }*/

Modify this section and insert the sleep delay as follows:

        while(i<end){
            send(session,chomp(getLineNum(i,configFile))+stdEOL);
                    /* delay for every individual command */
                    sleep(1);

            i+=1;
        }
        LOG = "Sent lines :"+i;
        send(session,"#DONE"+stdEOL);
                
        /*while(waitFor(session,1,stdConfigPromptState)){
            LOG = "found prompts in the buffer";
        }*/


sleep(1) indicates a pause of 1 second between lines.