Creating custom triggers in JSS 9.2?

tls2t
New Contributor II

Ok, I've taken the plunge and upgraded from 8.73 to 9.2. So far, so good.

*knock on wood*

One thing though. Where in blue blazes is the section where you can create custom triggers? The ones I created before the upgrade are still there, but I can't for the life of me find where I can create new ones.

8 REPLIES 8

johnnasset
Contributor

Under the General settings of the policy. The syntax has changed a bit, although the -trigger option still works:

jamf policy -event somecustomtriggernamehere

haircut
Contributor

You're asking where to create the trigger in the policy interface, correct?

It's basically in the same location it was in 8.x. On the "General" tab of a policy, you'll find it under the "Trigger" heading. It's the last option, "Custom" – tick the checkbox and a text input will appear for you to specify the custom event name.

tls2t
New Contributor II
You're asking where to create the trigger in the policy interface, correct? It's basically in the same location it was in 8.x. On the "General" tab of a policy, you'll find it under the "Trigger" heading. It's the last option, "Custom" – tick the checkbox and a text input will appear for you to specify the custom event name.

Not quite. The place you're referring to is where I can select a custom trigger. I'm trying to find the place where they can be created. For example, I want to have a policy run at 10 am every weekday. Where do I go to create that custom trigger that I can assign to my policies?

haircut
Contributor

@barret55

Not quite. The place you're referring to is where I can select a custom trigger. I'm trying to find the place where they can be created. For example, I want to have a policy run at 10 am every weekday. Where do I go to create that custom trigger that I can assign to my policies?

Ah, I see. Where I pointed you to is the correct location for creating custom events. It sounds like you're looking to specify a policy frequency based on date and time.

How were you doing this before? I don't remember any way to specify such an exact frequency on the server side in 8.x. My understanding is that'd be difficult because policies are "pulled" by the client rather than "pushed" by the server. You can't make a policy execute at an exact time from the JSS, you can only limit when that policy is returned to the client as available at a check-in event.

In the "General" tab of a policy you can set "Client-Side Limitations" that control when a policy is not available. In your example "Do not run between 11:00am to 9:59am and do not run on sunday or saturday" would get close to what you're looking for. I don't advise doing that though since that gives only a very narrow window for the clients to check in to the JSS and see the policy. Like seriously...don't rely on that for anything that needs to be executed at a set time.

I'd recommend using a launchdaemon for time-sensitive events that calls a custom event trigger at the required time. Just a simple job that calls "jamf policy -event dailyAt10am" would be much more reliable since it's controlled by the client's actual time rather than the hard-to-predict check-in interval. Here's some pretty good information on creating such a launchdaemon: http://nathangrigg.net/2012/07/schedule-jobs-using-launchd/

Or maybe I'm entirely wrong and you can specify on the JSS exactly when a policy is available...? :D

bentoms
Release Candidate Programs Tester

@barret55 do you mean a scheduled task?

I think they have been removed with v9.

haircut
Contributor

Ah yes, adding a scheduled task beyond the recurring check-in was definitely removed from 9.x for the reasons I outlined above – it's very unreliable. It was always discouraged by JAMF, specifically:

WARNING: Additional scheduled tasks are only necessary in special circumstances and are not recommended for typical use. Scheduling clients to check in too frequently can cause unneeded overhead on the clients and the JSS. Please contact JAMF Software Support prior to creating an additional task to discuss the risks.

- https://jamfnation.jamfsoftware.com/article.html?id=97

The /tasks.html page is not available in 9.x.

Maybe if you clue us in to what exactly you're trying to accomplish we can better help. I'm certainly no expert but the other fine folks around here are eager to help. @bentoms is in this thread now and he's a whizz – he even has the jacket to prove it!

mm2270
Legendary Contributor III

My advice would be to create a LaunchDaemon with Lingon or LaunchControl you can deploy to your clients with a StartCalendarInterval entry of 10 AM every week day. Make the ProgramArguments just do something like jamf policy -event <yourcustomtrigger> and make sure a policy set up with an Ongoing frequency exists on your JSS for that to do whatever it is you want to do, scoped to the correct set of clients, like All if you want.
Package the Damoen up and deploy with a script run after that enables it.

ernstcs
Contributor III

Wait, what? The ability to use Scheduled Tasks is gone in 9? I have yet to successfully upgrade my test environment to 9 so I haven't dug much into it.

Is there a document for "Things people used but are removed from the Casper Suite in version 9" somewhere?

What other little surprises am I going to run into...