Posted on 01-19-2016 01:21 PM
I thought I had this figured out.
I want to call a policy after another policy has run. In files and Processes I put
sudo /usr/local/bin/jamf policy -event -id 603
I have confirmed that 603 is indeed the policy# but when I run the policy I get:
Running command sudo /usr/local/bin/jamf policy -trigger -id 603...
Result of command:
Checking for policy ID 603...
No policies were found for the ID 603.
What am I doing wrong?
ID 603 Name ....................................... Install Alertus 2.9.30.1700 Enabled true
Posted on 01-19-2016 01:26 PM
You didn't scope the second policy to all computers.
Posted on 01-19-2016 01:37 PM
Could be a scoping issue as mentioned by @thoule (Although I'm not sure what he meant by second policy, I only see one referenced).
It could also be a syntax error. Try this:
sudo jamf policy -id 603
Posted on 01-19-2016 01:45 PM
@thoule was correct. I forgot to scope the the second policy, but @bpavlov I still get No policies were found for the ID 603
Posted on 01-19-2016 01:47 PM
Sorry I completely missed the part where you are calling another policy within a policy.
Just to confirm, the computer is scoped to both policies? Do you have any network limitations that perhaps the client isn't meeting? Do you have any exclusions that perhaps the client might be a part of?
Posted on 01-19-2016 02:01 PM
@bpavlov The computer is now scoped to both policy, no network limitations and no exclusions.
I think it was the fact that the second policy wasn't scoped correctly. As soon as I fixed that the app started installing. Still doesn't explain why I can't use the custom trigger option. Should I name my policy with no spaces so I can better call them in this manner? I tried pasting the name into the custom trigger field but got an error saying couldn't run Install (first word in the name of the second policy I wanted to run
Thanks to everyone for the help.
Posted on 01-19-2016 02:19 PM
Glad you got that working. As for the other issue, I try to avoid spaces when possible. But if you must, try:
sudo jamf policy -event "My Custom Trigger Name"
Posted on 01-19-2016 03:02 PM
I changed the name to take out the spaces,
Checking for policies triggered by "Stop_and_delete_Alertus_2.0.30.1600"...
No policies were found for the "Stop_and_delete_Alertus_2.0.30.1600" trigger.
Checking for policies triggered by "Stop_and_delete_Alertus_2.0.30.1600"...
No policies were found for the "Stop_and_delete_Alertus_2.0.30.1600" trigger.
Arghhhhhhhhhhhhh