Hello.
I am looking for a way to output a hardware report that is slightly different from the ones I see from within Comodo One or from the procedures that exist:
I need a list of ALL devices on the network, output to an Excel File that is sorted as follows:
At the top you have a row that shows all possible categories that are collected by One (DeviceName,Manufacturer, IP, Logged on User, Owner, Group, etc. etc.)
Below each of those a column with all the devices and their values.
Goal: I need to be able to sort the list by Device Name, by Mac-Adress, by Owner, by Manufacturer etc. etc. in order for the inventory list to be useful for us.
So in Excel when I click on a columns “header” and sort by it, I will get the list sorted by that criteria.
The more information is in there the better, if its possible to easily exclude information from the procedure (by deleting the non-relevant-parts for example) that would be fantastic, but I can do that in the Excel file by just deleting a column as well after running the procedure.
I would prefer to have that Excel file generated on a UNC Path in our network, timestamped so new versions dont just overwrite the older ones, but if that is too much work sending it via email is practicable as well for us.
Okay, I tried it just now using Googles smtp server and my private account there.
I get the execution logs showing that the process was completed successfully (per device) and that the file was sent to the head computer (which should be the email, not the computer, right?).
But I never receive any email.
One of the computers throws the error:
Type of ticket creator: PROCEDURE
Event Created at: Fri Dec 15 09:15:32 2017 GMT+0
Device Name: WSW10071
Logged on User: XXX (redacted)
Data: Traceback (most recent call last):
File “”, line 187, in
IndexError: list index out of range
I cannot test because I dont receive the inventory via email, but judging from the Execution logs it seems to save one excel file per device, not an overview of all hardware in our domain collected in one file?
Thanks for the update.
I followed the instructions on the wiki regarding gmail and startet the script with two machines (my head machine + another one). In the execution log I now get one result as being successful for the head computer, the other computer doesn’t show up.
No email is being sent - it has been 30 minutes since starting the script.
UPDATE: I deactivated 2 factor authentication and tried the steps from the wiki again. Now I get an email with an attached finalreport.xlsx (1KB) but it is corrupted.
Our python version doesn’t support xlsxwriter. so we have changed the format of the finalreport file to .csv. You can use any opensource office application to open the CSV file Eg.LibreOffice
Now we have Updated the script. let us know your feedback
Thanks, I’ll test it.
Another question, I got the message:
Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 14:03:45 2017 GMT+0
Device Name: XXX(redacted)
Logged on User: N/A
Data: Traceback (most recent call last):
File “”, line 266, in
WindowsError: [Error 183] Cannot create a file when that file already exists: ‘C:\ProgramData\WInscp_folder’
…will this error appear for every computer that has already run the procedure once? Or is it a problem with a somehow uncomplete procedure?
Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 16:15:10 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: xxx(redacted)
Data: Traceback (most recent call last):
File “”, line 272, in
File “”, line 138, in download
IOError: [Errno 13] Permission denied: ‘C:\ProgramData\WInscp_folder\WinSCP_C1_SFTP.exe’
And:
Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 16:15:05 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: xxx(redacted)
Data: Traceback (most recent call last):
File “”, line 271, in
File “”, line 138, in download
IOError: [Errno 2] No such file or directory: ‘C:\ProgramData\WInscp_folder\WinSCP_C1_SFTP.exe’
And:
Type of ticket creator: PROCEDURE
Event Created at: Wed Dec 20 14:03:45 2017 GMT+0
Device Name: xxx(redacted)
Logged on User: N/A
Data: Traceback (most recent call last):
File “”, line 266, in
WindowsError: [Error 183] Cannot create a file when that file already exists: ‘C:\ProgramData\WInscp_folder’
And after 20 minutes so far no email with a csv file, but it may still come of course.
Also, something else I noticed: The CSV doesnt list the “owner” or the “group” fields, that would be very useful though for us … I guess this would require somehow linking up the information stored in the ITSM and the information from the computer itself?
I defined the head computer (with the computer name of my admin-machine here, also tried with computername.domain.domain ), put in my email account and password, less secure apps is on as per instructions with the script.
The script starts seemingly fine and shows that it was executed in the log, but when looking at the details I get:
2018/01/19 02:19:22 PM
Finished success
Transfering File ............... Done File sent to Head Computer For your Information: Make Sure you Defined Head Computer
The file never appears on my computer or in my mailbox though.
I am also not clear on what the Folder Name will have influence? Will the event logs be saved there on the head computer under program data? If I read the script correctly thats where it should be saved … ?
Thanks for your ongoing work.
Sébastien
EDIT: Other procedures with the exact same email settings from my side work just fine.
Let me Explain the Script how it runs
For Example :
Device 1 – Let us Assume it could be the “Head Computer”
The Output of Head Computer has follows
Transfering File … Done
File sent to Head Computer
Downloading File … Done
C:\ProgramData\kupido
The email report has been sent to XXXXXXXXXXX@gmail.com
For your Information:
Make Sure you Defined Head Computer
Remaining Devices which are not Head Computers
The Output of Remaining Devices has follows
For Example :
Transfering File … Done
File sent to Head Computer
For your Information:
Make Sure you Defined Head Computer
So here Head computer generates the report .
Regarding the Foldername
In order to avoid Naming Confusions while the script is running we included it and yes it saves in program data of the Head Computer .