jssimporter / Spruce

Spruce is deprecated. Please see the wiki for alternatives.
GNU General Public License v3.0
149 stars 22 forks source link

Packages list not checking for multiple packages in policies #49

Open stevewood-tx opened 4 years ago

stevewood-tx commented 4 years ago

I ran Spruce against two of our Jamf Pro instances today. The output showed a list of 489 packages that were not used in a policy or configuration. I did a spot check on the list and found that several were indeed still attached to policies.

I then used a MySQL query to determine the policy ID of any package ID that was attached to a policy using this query:

select package_id,policy_id from policy_packages where package_id in ('1','2','3'....);

I was able to take the output of that and compare it to the output from Spruce and found 90 packages that were indeed still attached to policies.

I did a spot check of about 10 of the policies that packages were still attached to, and in all 10 cases there were multiple packages assigned to the policy. I'm thinking that may be what is causing the issue.

Latest version of Spruce that is on GitHub.

Jamf Pro 10.20.1

I saw this behavior on two different Jamf Pro servers, both the same version.

Happy to provide any other data or testing.

Steve

sphen13 commented 3 years ago

i just did a quick test on a server (10.20.1-t1584039255) and also notice spruce mis-identifying packages that are in use. i will try to identify commonalities. one that i did find was in a policy that had multiple packages as well.

sphen13 commented 3 years ago

hmm also see the same with scripts - when a policy has multiple scripts spruce may identify one as unused.

chrisglaske commented 3 years ago

After testing today with Spruce (latest version) and Jamf (version: 10.23.0-t1595614145), I can confirm we are seeing the same issue. If the package or script is used in a policy that has more than one package or script assigned, it may identify that the package/script is unused.

staze commented 3 years ago

just came to post "me to" on this one. Spruce output a list of like 1400 packages not in use, and after looking I noticed it had flagged nearly all our Adobe CC installs, which are used in giant mega policies. =/