0

I have a Python script to start a group of WebLogic server's node managers. The main call to do this is as follows:

stdin, stdout, stderr = client.exec_command('/app/oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin/startNodeManager.sh')

This will start the processes on the servers but when I try to connect to Node Manager via WLST's nmConnect() I receive an error that Node Manager is not working. However one machine works...

I am running this from a script on a different machine. The script uses the third-party paramiko Python library to ssh into the remote machine and then call the above command. An interesting part of this problem is that the program is seen running in ps -ef | grep nodemanager. However when I try to issue nmConnect() I cannot connect as I normally can if I manually start node manager from the operating system myself.

user3808269
  • 1,321
  • 3
  • 21
  • 40
  • Don't append `\n` to the command when passing to `exec_command()`. – pynexj Jun 02 '17 at 18:00
  • I mean it does not start or stop the node manager. Sometimes it will print some shell output sometimes it prints nothing. No errors are thrown. – user3808269 Jun 02 '17 at 18:03
  • I took the \n new line character off and still it does not work. I tried adding a dot to the front as with normal linux executables: ./program, but this also did not work. – user3808269 Jun 02 '17 at 18:05
  • I removed the new lines and it sort of works. The processes start in memory but when I try to connect to node manager I receive an error for 2 or the 3 servers tested. :/ – user3808269 Jun 02 '17 at 18:21

1 Answers1

1

does the startNodeManager.sh by any chance output more than few lines of output? If so, my guess would be on process blocking during execution because you don't read out it's output...

For proper way to execute commands via paramiko, I'd recommend looking at this: http://stackoverflow.com/a/32758464

MacHala
  • 2,159
  • 1
  • 15
  • 18
  • Yes, there is a massive amount of output. If I wait for the output the program I wrote just sits there. If I do not care about the output the program starts in memory but I can not access the started server and use it. It is a complex problem and me explaining it probably does not make it more understandable. Thank-you for the reply. I will check out the hyperlink! – user3808269 Jun 05 '17 at 17:53