cconard96 / jamf

JAMF Plugin for GLPI
GNU General Public License v2.0
5 stars 7 forks source link

Not displaying Attributes extensions nor MDM commands - SimpleXML issue ? #35

Closed SynCinatti closed 5 years ago

SynCinatti commented 5 years ago

Hi, first of all thanks for this work that will be very useful.

I installed your plugin and merged/synced one ipad, works all fine. However in the 'Extensions attributes' and 'MDM commands' tabs, nothing displays (there is at least one attribute for this ipad btw).

I Wonder if this could be a simplexml issue? The extension is installed.

I can provide screenshots on demand.

Thanks in advance

cconard96 commented 5 years ago

The definitions for the attributes have to sync first before the values assigned on each device can be synced. This is usually done through the jamfSync automatic action. To make it easier, I added commit 41709eb8fd1aef074d868ed0304fe8fef5ce9bc3 to 1.1.0/bugfixes to sync the definitions first before importing or merging from the GUI.

For MDM commands, the user you are using must have their account linked under Administration > Users in the JSS Account Link tab. The plugin checks to see what commands they would usually have access to send, and filters them in GLPI so that they don't get more access than they normally have. All commands are still sent as the account set in the config.

SynCinatti commented 5 years ago

Thank you for your quick reply, Il'l try the commit right now. Anyway, the user account used for linking is my jamf admin account, so i'm pretty sure the plugin has all rights on jamf to do the tests.

On the following screenshots we can see that the tab indicates one attribute for the device, but does not display it.

Capture d’écran 2019-10-10 à 14 42 43 Capture d’écran 2019-10-10 à 14 42 57
SynCinatti commented 5 years ago

So, i updated import.php and merge.php, then merged a second ipad. I now see the extension attributes, and the history of failed mdm commands. However, i have no display of available commands to send to the device.

Is there a way to update the first merged ipad so i can get its attributes ?

Thank you!

cconard96 commented 5 years ago

Is there a way to update the first merged ipad so i can get its attributes ?

Do you have a cron job (Linux) or scheduled task (Windows) set up to run GLPI CLI actions? If so, make sure the automatic action jamfSync is enabled. It should automatically sync the missing data.

Otherwise, you can add the line "PluginJamfSync::syncExtensionAttributeDefinitions();" in ajax/sync.php above "PluginJamfSync::syncMobileDevice($mobiledevice);".

I am planning to allow the automatic tasks to run in GLPI mode as well, and add a way to sync extension attributes separately.

For the commands issue, if your GLPI user is linked to an Administrator account in the JSS Account Link tab (Not just in the plugin configuration), it should definitely show all the commands. I will look into this more and let you know what I find.

SynCinatti commented 5 years ago

Ok... so i missed the JSS Account link tab in user edition form, sorry for that. Was this point documented? If yes, sorry again. I now have access to some commands as showed below :

Capture d’écran 2019-10-10 à 21 05 05

But it doesn't seem to be fully complete, I for example expected to maybe see a 'update ios' button ? Or am i still missing something? Anyway, great job !!

About Attributes and sync job, yes i do have a cron... which was refering to an old glpi instance... running ok now. Btw, a manual sync on the first merged device made the job.

Thank you Curtis !

SynCinatti commented 5 years ago

Anyway... the os update action in jamf is only available on mass actions, not in individual commands, so i'm not that surprised finally.

One other point : I checked the attached rule that checks the import, it appears to be empty by default. I added one, but could not test it, because of rule.test.php missing in jamf/front.

cconard96 commented 5 years ago

I will add a wiki to this repo and aim to have proper documentation done by the next feature release.

I don't think the update ios command is recognized as a command in the api, or it wasnt documented. This is something I wanted to take another look at for the next feature release.

I will re-check the rules system.

SynCinatti commented 5 years ago

The update os command can be sent in massive action, when displaying a smart group or any list of devices but not on a single device's management page (as of jamf 10.15).

Once again, thanks a lot for your work !! This issue can now be closed (i won't create a new one for the rules, since you are aware of it -btw, if you can add a criteria based on the device's serial, it could be useful).