Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


EllenC
2014-05-05T22:45:15Z
Greetings,

I have a python script that works fine in an administrative cmd window.
It iterates through a list of systems calling psexec and does reg queries.

When I put this script into VisualCron, psexec is not returning anything to standard out though the other sections of the script that write to stdout appear.

psexec is acting like it doesn't have the correct credentials as it needs the originating side to be a local administrator. In VisualCron, I have entered the local adminstrator credentials, but I am still not seeing psexec work properly.

I can change to psloggedon.exe and since that doesn't require an administrator, that works.

I have added the full path names for the programs that are called.

Is there something I'm missing?

Ellen Clary
Dynamic Graphics
Sponsor
Forum information
Support
2014-05-06T06:25:01Z
Only one application can capture standard output. You can turn of capturing of standard output in VisualCron by unchecking "Store std output" in the main settings of the Task.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
EllenC
2014-05-06T18:05:30Z
When I run it with Store Standard Out checked I see all of the diagnostic output except for what psexec should have produced. It does the actual psexec call as I'm seeing the first line "Windows IP Configuration" but then it cuts off and there are 15 lines more that should be appearing. (This is a test script - the actual script is a longer reg query.)

Here is the stdout

Arguments to subprocess: ['D:\\users\\ellen\\Scripts\\psexec.exe', '-u', 'frodo\\administrator', '-p', '******', '\\\\frodo', 'C:\\windows\\syswow64\\ipconfig.exe']

Ipconfig:
Output Tupple:
('\r\nWindows IP Configuration\r\n\r\n', None)




When I uncheck Store Standard Output then there is "No Output"



Python Script (backslashes are escaped)
This works on the cmd line
ipconfig is just a test command, the actual command is a complicated reg query.

psexecloc = "D:\\users\\ellen\\Scripts\\psexec.exe"
remotecmd = "C:\\windows\\syswow64\\ipconfig.exe"
username = "frodo\\administrator"
password = "*****"
remotehostname = "\\\\frodo"

args = [ psexecloc, "-u", username, "-p", password, remotehostname, remotecmd ]
print "Arguments to subprocess: ", args
print
print "Ipconfig: "
output = subprocess.Popen(args, shell=False, stdout=subprocess.PIPE)
outstr=output.communicate()
stdoutstr = outstr[0]
stderrstr = outstr[1]
print "Output Tupple: "
print outstr

Support
2014-05-06T18:07:33Z
You cannot have both. If you uncheck it it will disappear from VisualCron. We only store the first 200 characters in output - you have to click Get full output in that window to get the rest.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
EllenC
2014-05-06T18:45:53Z
Get full output is greyed out. That's all the output it has.

The output from that script should look more like:

Starting C:\windows\syswow64\ipconfig.exe on frodo...
C:\windows\syswow64\ipconfig.exe exited on frodo with error code 0.
Output Tupple:
('\r\nWindows IP Configuration\r\n\r\n\r\nEthernet adapter Local Area Connection
:\r\n\r\n Connection-specific DNS Suffix . : dgi.com\r\n IPv4 Address. . .
. . . . . . . . : 192.168.1.143\r\n Subnet Mask . . . . . . . . . . . : 255.25
5.252.0\r\n Default Gateway . . . . . . . . . : 192.168.1.102\r\n\r\nTunnel ad
apter isatap.dgi.com:\r\n\r\n Media State . . . . . . . . . . . : Media discon
nected\r\n Connection-specific DNS Suffix . : dgi.com\r\n\r\nTunnel adapter L
ocal Area Connection* 11:\r\n\r\n Media State . . . . . . . . . . . : Media di
sconnected\r\n Connection-specific DNS Suffix . : \r\n', None)
EllenC
2014-05-06T19:05:53Z
Ah ha. If I turn off the Store Standard Output, then I can write it all to a file which is what I want anyway. I was confusing myself and Visual Cron does seem to stop listening too soon, but writing to a file is actual the goal.
Support
2014-05-06T19:07:27Z
Originally Posted by: EllenC 

Ah ha. If I turn off the Store Standard Output, then I can write it all to a file which is what I want anyway. I was confusing myself and Visual Cron does seem to stop listening too soon, but writing to a file is actual the goal.



Yes, correct. Only one application can receive the output so if you want to write to file you need to uncheck.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
Scroll to Top