You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2025-03-25 12:55:15

mw
Member
Registered: 2025-03-24
Posts: 6

Jamf plugin - Import iPhones as computers

Hello,

We have recently implemented Jamf Pro at our organisation and wanted to use the GLPI Jamf plugin to import/synchronise our devices. Our iPads and iPhones are currently recorded in GLPI as computers and we're using the Additional Fields plugin to record extended information against them.

I note that the plugin's documentation states that iPhones can be imported as either phones or computers but I can't see an option for changing this within the plugin. When looking at the preview of discovered devices on the import and merge screens the iPhones are listed as phones and there doesn't seem to be an obvious way to change the device import type. Is there a setting to change the default device type for iPhones or a way to choose this during the import stage?

Offline

#2 2025-03-25 13:19:52

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,271
Website

Re: Jamf plugin - Import iPhones as computers

iPhones are indeed supposed to be able to be imported as either Phones or Computers, although I admit it has been a while since I thought about the feature. Originally, I only considered handling importing as either Computer or Phone because GLPI didn't support a lot of "smartphone" features like software, OS, etc at the time but I pretty quickly started contributing those features to GLPI itself after starting the plugin. It's entirely possible the feature wasn't completely implemented in the plugin or was accidentally removed but it indeed looks like there is no current way to specify the imported type although the database schema and some of the code is in place to support it.

I'll try to take a better look at it later but since a lot of the work behind the scenes is done, it could be an easy fix.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2025-03-25 13:24:51

mw
Member
Registered: 2025-03-24
Posts: 6

Re: Jamf plugin - Import iPhones as computers

That's great, thanks for looking into this. This would be extremely useful for us so I'll keep my fingers crossed that it can be easily fixed!

Offline

#4 2025-04-07 21:04:50

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,271
Website

Re: Jamf plugin - Import iPhones as computers

I have opened a pull request to add this. It isn't reviewed yet but the work is at least started.

https://github.com/pluginsGLPI/jamf/pull/17


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2025-04-07 21:48:45

mw
Member
Registered: 2025-03-24
Posts: 6

Re: Jamf plugin - Import iPhones as computers

Thank you so much for revisiting this, really appreciate it. I'm happy to help with any testing if you need it.

Offline

#6 2025-04-08 12:21:01

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,271
Website

Re: Jamf plugin - Import iPhones as computers

It needs tested/reviewed by other Teclib' developers, but if you want to test it too it would be very helpful. You can get a patch file by adding ".patch" to the end of the URL I provided. I'm not sure how complicated it would be to apply to your version of the plugin though. You can also see the changes made in the "Files changed" tab.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#7 2025-04-09 13:47:45

mw
Member
Registered: 2025-03-24
Posts: 6

Re: Jamf plugin - Import iPhones as computers

Thanks. I'll look into testing the changes and get back to you. Would it be sufficient to backup my GLPI instance then replace any changed files within the plugin or is there an upgrade process that needs to be triggered? The plugin was installed through the marketplace if that makes any difference.

Offline

#8 2025-04-09 15:27:58

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,271
Website

Re: Jamf plugin - Import iPhones as computers

There were a few other changes added to GitHub since the last release. I cannot say for sure if they would be incompatible if you simply replaced the changed files in the pull request.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#9 2025-04-11 15:13:09

mw
Member
Registered: 2025-03-24
Posts: 6

Re: Jamf plugin - Import iPhones as computers

Thanks again for your work on this. I've cloned the current repository and applied the patch. After testing the updated plugin I can confirm that the new dropdowns appear and work as expected, importing assets as the selected type into GLPI. Just a couple of observations/questions:

1. On the merge screen, the list of available assets to match dynamically changes depending on the type selected which is great but could a rescan button be added to attempt to match assets again after changing the type?

2. On the config page, could a setting be added to change the default asset type for iPhones globally and could this dictate the list used for the iPhone Type under Default Settings? Currently, an empty list is presented (presumably phone types).


Regarding the import workflow, is it possible to combine the import and merge functions to allow new assets to be optionally created where there is no match? Attempting to use the import function as a first pass generated many duplicates as the UUIDs of existing manually entered devices had not been entered, only the serial numbers. If a combined function isn't feasible, could the import process also check whether the serial number exists if the UUID isn't present and skip the import if a match is found?

Offline

#10 2025-04-11 16:18:29

cconard96
Moderator
Registered: 2018-07-31
Posts: 3,271
Website

Re: Jamf plugin - Import iPhones as computers

For merging, it is supposed to be checking all possible itemtypes for a best match before showing the results. Each of the dropdowns (which change when you change the itemtype dropdown) should be showing the proposed match by default.
The current merging guess criteria:
- UUID or Name matches the UDID/Device name from Jamf
- GLPI item isn't deleted or a template
- Matches on the UUID are sorted above the others and the results are limited to 1 per itemtype so that if there is a UUID match, it is always the one used even if there are other matches based on the name.


I thought about the config option too but it would only really matter for imports where it could happen automatically. GLPI 11 is going to have custom asset types and I want to make this plugin support them by allowing you to import/merge a Jamf device as a custom asset type like "Streaming box" (for Apple TVs). Given that the Type dropdowns depend on a specific asset type, I guess I can't delay the config option changes. I'll put the pull request to a draft state and make a note that it needs changed.

Indeed the import and merge functions could be combined, but I designed the plugin with a disdain for automatic merging. When I made the plugin, I was using OCS at work and it was notorious for duplicating our computer inventory and being bad at importing/merging. This is also partially why I made the recommendation in the plugin documentation/readme to leave automatic imports disabled in the plugin at least until the initial import is done. While I'm not even sure Jamf would ever duplicate devices, I wanted to be safe. I also don't trust merging based on names but it makes it easier as some people may not have the UUID filled out yet in GLPI.

The merge suggestions could be changed to take serial number into account too though.


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#11 2025-04-11 16:40:46

mw
Member
Registered: 2025-03-24
Posts: 6

Re: Jamf plugin - Import iPhones as computers

That all makes sense, thanks for the explanation. I'll be out of the office next week but if you need any more testing done I'll take a look as soon as I return.

Offline

Board footer

Powered by FluxBB