grokability / jamf2snipe

Import and sync assets from a JAMFPro instance to Snipe-IT asset management.
MIT License
113 stars 55 forks source link

Could not run the jamf2snipe to update the information from Jamf #114

Open TungLe93 opened 1 year ago

TungLe93 commented 1 year ago

Hi everyone,

I'm the non-code person here and I'm trying to follow the docx to get the jamf2snipe is running to sync device's information from Jamf to SnipeIT.

The jamf2snipe is run successfully at the first time. All data has been sync from Jamf to SnipeIT as expected.

But when I re-run the script to update the new data from Jamf. It's returned the error:

Please note that I do not make any changes in jamf2snipe file.

Traceback (most recent call last):
  File "/opt/jamf2snipe/jamf2snipe", line 901, in <module>
    jamf_value = jamf_value[item]
                 ~~~~~~~~~~^^^^^^
TypeError: list indices must be integers or slices, not str

When I added --debug it is returned:

DEBUG:root:general is not an integer
DEBUG:root:name is not an integer
DEBUG:root:Skipping the payload, because it already exits.
DEBUG:root:general is not an integer
DEBUG:root:mac_address is not an integer
DEBUG:root:The snipekey lookup failed, which means it's a custom field. Parsing those to see if it needs to be updated or not.
DEBUG:root:Skipping the payload, because it already exists, or the Snipe key we're mapping to doesn't.
DEBUG:root:hardware is not an integer
DEBUG:root:total_ram_mb is not an integer
DEBUG:root:The snipekey lookup failed, which means it's a custom field. Parsing those to see if it needs to be updated or not.
DEBUG:root:Skipping the payload, because it already exists, or the Snipe key we're mapping to doesn't.
DEBUG:root:hardware is not an integer
DEBUG:root:storage is not an integer
DEBUG:root:drive_capacity_mb is not an integer
Traceback (most recent call last):
  File "/opt/jamf2snipe/jamf2snipe", line 901, in <module>
    jamf_value = jamf_value[item]
                 ~~~~~~~~~~^^^^^^
TypeError: list indices must be integers or slices, not str

Thank you !!!

casban commented 1 year ago

I have a similar issue; drive_capacity_mb appears in the XML api tester under hardware -> storage -> device-> drive_capacity_mb, however the documentation indicates that capacity should be 1 level higher: hardware -> storage -> drive_capacity_mb