Captain Captain
Captain
581 views

UCMDB 9x: Not possible to execute shell commands after a timeout

   
Hi all,

in ucmdb 9, does anyone know why a shell command in timeout prevent the discovery script to execute any subsequent commands.

Please consider the following 2 examples using  ShellClient.executeCmd and ShellClient.executeCmdWithTimeOut. As shown below, when the first command exceeds a configured timeout value an exception is raised (unless executeCmdWithTimeOut is called). This is the expected behaviour.
What I do not understand is that any commands executed afterwards timeout as well even if those are not supposed to. A command in timeout does not mean that the whole discovery script is in timeout.
 

Example 1: ShellClient.executeCmd
   
    try:
        logger.debug('Test 1 ...')
        waitfortimeout = 0
        client.executeCmd('sleep 60; ls /tmp', 5000, 0)
    except Exception, ex:
        exInfo = ex.getMessage()
        logger.debug('Unexpected exception: %s' % exInfo)


    try:
        logger.debug('Test 2 ...')
        waitfortimeout = 0
        client.executeCmd('sleep 5; ls /tmp')
    except Exception, ex:
        exInfo = ex.getMessage()
        logger.debug('Unexpected exception: %s' % exInfo)
        errormessages.resolveAndReport(exInfo, Framework)
 
[DEBUG] - Test 1 ...
[DEBUG] - Unexpected exception: Command timed out: Exceeded timeout after 5000 milliseconds
[DEBUG] - Test 2 ...
[DEBUG] - Unexpected exception: Command timed out: Exceeded timeout after 15000 milliseconds

Example 2: ShellClient.executeCmdWithTimeOut

     try:
        logger.debug('Test 1 ...')
        waitfortimeout = 0
        client.executeCmdWithTimeOut('sleep 60; ls /tmp')
    except Exception, ex:
        exInfo = ex.getMessage()
        logger.debug('Unexpected exception: %s' % exInfo)

    try:
        logger.debug('Test 2 ...')
        waitfortimeout = 0
        client.executeCmd('sleep 5; ls /tmp')
    except Exception, ex:
        exInfo = ex.getMessage()
        logger.debug('Unexpected exception: %s' % exInfo)
        errormessages.resolveAndReport(exInfo, Framework)

[DEBUG] - Test 1 ...
[DEBUG] - Test 2 ...
[DEBUG] - Unexpected exception: Command timed out: Exceeded timeout after 15000 milliseconds

 

 

P.S. This thread has been moved from Application Perf Mgmt (BAC / BSM) Support and News Forum to CMS and Discovery Support and News . - Hp Forum Moderator

0 Likes
0 Replies
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.