Python plugin using winexe hangs when run as service
Posted: Fri Feb 21, 2014 2:04 pm
Hi, I'm using Python to create a plugin to execute a Win7 command remotely with winexe. The plugin runs fine manually on the command line with the complete path to the file and as user nagios, though I AM getting the following error messages after getting output back from the remote Win7 server. This is the debug output from winexe:
[output from "dir c:\" snipped]
09/18/2013 01:20 PM 209,814,312 utilities.zip
01/07/2011 01:54 PM <DIR> utils
02/20/2014 05:42 PM <DIR> Windows
5 File(s) 212,003,517 bytes
12 Dir(s) 10,333,868,032 bytes free
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: on_ctrl_pipe_error - NT_STATUS_PIPE_DISCONNECTED
OpenService - NT_STATUS_OK
StopService - NT_STATUS_OK
DeleteService - NT_STATUS_OK
CloseServiceHandle - NT_STATUS_OK
CloseSCMHandle - NT_STATUS_OK
Delete winexesvc.exe - NT_STATUS_OK
Closing ADMIN$ - NT_STATUS_OK
When scheduling a check of the service from Nagios, I get this:
This program may be freely redistributed under the terms of the GNU GPLv3
svc_UploadService: Installing 64bit winexesvc.exe
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd.exe /C dir c:\
CTRL: Recieved command: std_io_err 03100001
IN: async_open(\pipe\ahexec_stdin03100001, 2)
IN: async_open(\pipe\ahexec_stdout03100001, 2)
IN: async_open(\pipe\ahexec_stderr03100001, 2)
IN: async_open_recv
tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()
I'm using using winexe Version 4.0.0alpha11-GIT-UNKNOWN. Python is 2.6.6. I've tried just creating a sh script, but it hangs also. Has anyone run into this problem before?
[output from "dir c:\" snipped]
09/18/2013 01:20 PM 209,814,312 utilities.zip
01/07/2011 01:54 PM <DIR> utils
02/20/2014 05:42 PM <DIR> Windows
5 File(s) 212,003,517 bytes
12 Dir(s) 10,333,868,032 bytes free
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: smb_raw_read_recv - NT_STATUS_PIPE_DISCONNECTED
ERROR: on_ctrl_pipe_error - NT_STATUS_PIPE_DISCONNECTED
OpenService - NT_STATUS_OK
StopService - NT_STATUS_OK
DeleteService - NT_STATUS_OK
CloseServiceHandle - NT_STATUS_OK
CloseSCMHandle - NT_STATUS_OK
Delete winexesvc.exe - NT_STATUS_OK
Closing ADMIN$ - NT_STATUS_OK
When scheduling a check of the service from Nagios, I get this:
This program may be freely redistributed under the terms of the GNU GPLv3
svc_UploadService: Installing 64bit winexesvc.exe
IN: async_open(\pipe\ahexec, 2)
IN: async_open_recv
CTRL: Sending command: get version
CTRL: Sending command: run cmd.exe /C dir c:\
CTRL: Recieved command: std_io_err 03100001
IN: async_open(\pipe\ahexec_stdin03100001, 2)
IN: async_open(\pipe\ahexec_stdout03100001, 2)
IN: async_open(\pipe\ahexec_stderr03100001, 2)
IN: async_open_recv
tevent: EPOLL_CTL_ADD failed (Operation not permitted) - falling back to select()
I'm using using winexe Version 4.0.0alpha11-GIT-UNKNOWN. Python is 2.6.6. I've tried just creating a sh script, but it hangs also. Has anyone run into this problem before?