So we have a nice tool to looks at packages for scripts that might have deprecated languages in them (see https://github.com/scriptingosx/pkgcheck). Has anyone created something to look at the first line of all the scripts in the JSS and report ? I am guessing would have to use the JAMF API, to get <script_contents>, then match on the first line like in pkgcheck. Anyone working on this?
If you have access to your database you can do this pretty easily with a select statement.
select script_id,file_name from scripts where script_contents like '%python%';
If you have access to your database you can do this pretty easily with a select statement.
select script_id,file_name from scripts where script_contents like '%python%';
We are cloud hosted so this won't work for us but good tip for on prem. folks
Here is what I used to search, it searches both scripts and EA, https://github.com/laurentpertois/Search-Scripts-In-Jamf
We are cloud hosted so this won't work for us but good tip for on prem. folks
@ega It's a little brute force, but my approach for checking python use was to run https://github.com/jamf/JamfMigrator in Save Only mode to make a local copy of all of the Script objects in my JSS, and then searching the directory of exported scripts for 'python'.
found this yesterday: https://github.com/laurentpertois/Search-Scripts-In-Jamf
I haven't tested it yet but you can try it 😅
@Nick1403 Great find! works well! I did searches on 1828 scripts and 173 extension attributes for "/usr/bin/python",
"/usr/bin/perl" and "/usr/bin/ruby". I created a Jamf account that could only read Scripts and Computer Extension Attributes. One thing to note is that I also found serval scripts that were calling python without the full path (tsk). Kudos to Lauren for the script!!
found this yesterday: https://github.com/laurentpertois/Search-Scripts-In-Jamf
I haven't tested it yet but you can try it 😅
I've tested it and it does work. I used https://github.com/laurentpertois/Search-Scripts-In-Jamf/blob/main/searchScriptsAndEAsInJamf.sh to also find any python reference in EAs.
Nice little script, worked for me flawlessly.
Question tho, is it enough to just disable the Policies/EAs that use Python to get rid of the jamfdeamon alerts? Or do the Scripts/EA's need to be deleted from the JSS alltogether?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.