However, the results of this endpoint have a hard limit of 300 records. Which is why the function does not return the most recent device activity date from Kandji which results in certain device records not being updated in Snipe-IT
{
"general": {
"device_id": "03f81208-2b6a-4a77-81f5-cf1633bcfb95",
"device_name": "testuser’s MacBook Air",
"last_enrollment": "2024-05-13 20:09:27.374451+00:00",
"first_enrollment": "2024-01-26 16:15:36.087016+00:00",
"model": "MacBook Air (M1, 2020)",
"platform": "Mac",
"os_version": "14.4.1",
"supplemental_build_version": "23E224",
"supplemental_os_version_extra": "",
"system_version": "14.4.1 (23E224)",
"boot_volume": "Macintosh HD",
"time_since_boot": "1 month ago",
"last_user": "root",
"asset_tag": "sending_tag_to_now",
"assigned_user": {
"email": "accuhive.admin@kandji.io",
"name": "acchuhive admin",
"id": "5344c996-8823-4b37-8d6e-8515fc7c3a0a",
"is_archived": false
},
"blueprint_name": "_test_something",
"blueprint_uuid": "ab102b9d-8e9c-420d-a498-f2a1123091c7"
},
"mdm": {
"mdm_enabled": "True",
"supervised": "True",
"install_date": "2024-05-13 20:09:27.213607+00:00",
"last_check_in": "2024-07-23 12:43:15.675470+00:00",
"mdm_enabled_user": [
"testuser"
]
},
Issue
When getting the latest device activity from Kandji in the
kandji_device_activityfunction below, it is using the Get Device Activity endpoint and grabbing the last entry in the results.kandji2snipe/kandji2snipe
Lines 438 to 442 in bd8f525
kandji2snipe/kandji2snipe
Line 889 in bd8f525
However, the results of this endpoint have a hard limit of 300 records. Which is why the function does not return the most recent device activity date from Kandji which results in certain device records not being updated in Snipe-IT
Possible fix
It would be better to use the Get Device Details endpoint of the Kandji API as this does not have hard limit. From the results, we can grab the
mdm -> last_check_infield to get the most recent device activity.