Comment thread started by Anonymous on DRS Doctor

Full comments
Jun 28, 2016

I'd really like to give this a try but am confused on how to setup and use? Any chance for a more detailed set of instructions and what platforms this is supported on? (python for Windows??)

Jun 29, 2016

This is platform independent. All you need is a python environment(>=2.6) and mentioned python modules(pyvmomi, pyyaml). Yes, if you have mentioned python environment on windows it will just work.

Jun 29, 2016

When attempting to run this on a Windows box, using the command python C:\directory_name\doctor I get:
Traceback (most recent call last):
File "C:\Drm-Diagnostic-Tool\doctor", line 23, in <module>
from scripts import ResourceCollector as ResourceCollector
File "C:\Drm-Diagnostic-Tool\scripts\ResourceCollector.py", line 14, in <module>
import vcutil, log, printutil
File "C:\Drm-Diagnostic-Tool\scripts\log.py", line 35, in <module>
get_logger()
File "C:\Drm-Diagnostic-Tool\scripts\log.py", line 27, in get_logger
filemode = 'w+', level = logging.INFO)
File "C:\Python27\lib\logging\__init__.py", line 1547, in basicConfig
hdlr = FileHandler(filename, mode)
File "C:\Python27\lib\logging\__init__.py", line 913, in __init__
StreamHandler.__init__(self, self._open())
File "C:\Python27\lib\logging\__init__.py", line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 22] invalid mode ('w+') or filename: 'C:\\Python27\\logs\\2016-06-29_10:37:37.log'

Any ideas what's causing the failure?

Jun 29, 2016

Can you run the command from inside the directory and check? like 'python ./doctor'

Jun 29, 2016

command "python ./doctor" does not work as python in not in the directory:
'python' is not recognized as an internal or external command, operable program or batch file.

Changing this to "C:\Python27\python ./doctor" gives:

Traceback (most recent call last):
File "./doctor", line 23, in <module>
from scripts import ResourceCollector as ResourceCollector
File "C:\Drm-Diagnostic-Tool\scripts\ResourceCollector.py", line 14, in <module>
import vcutil, log, printutil
File "C:\Drm-Diagnostic-Tool\scripts\log.py", line 35, in <module>
get_logger()
File "C:\Drm-Diagnostic-Tool\scripts\log.py", line 27, in get_logger
filemode = 'w+', level = logging.INFO)
File "C:\Python27\lib\logging\__init__.py", line 1547, in basicConfig
hdlr = FileHandler(filename, mode)
File "C:\Python27\lib\logging\__init__.py", line 913, in __init__
StreamHandler.__init__(self, self._open())
File "C:\Python27\lib\logging\__init__.py", line 943, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 22] invalid mode ('w+') or filename: 'C:\\Drm-Diagnostic-Tool\\logs\\2016-06-29_11:32:22.log'

Jun 29, 2016

it is trying to create a log file '2016-06-29_11:32:22.log' at the path C:\\Drm-Diagnostic-Tool\\logs\\2016-06-29_11:32:22.log' which is definitely not valid.

Jun 29, 2016

let me check why the path has double '\\'

Jun 29, 2016

Double backslash would be correct I believe as a regular backslash is an operator thus \l would be read when compiling and fail as an invalid operand.

Jun 29, 2016

I looked for the error and it seems Windows doesn't support colon ':' in their file names. Can you modify the string in file 'scripts/log.py' line 24 from "%Y-%m-%d_%H:%M:%S" to "%Y-%m-%d_%H-%M-%S" to see colon is the real issue here with windows.

Thanks

Jun 29, 2016

Perfect, that was it!