In Flashduty On-call
You can get the push URL in either of the following ways.
Use a dedicated integration
- In the Flashduty console, select Channels and open a channel
- Select Settings → Integration data → Dedicated integration, then click Add an integration
- Select PowerJob and click Save
- Open the generated integration card and copy the push URL
Use a shared integration
- In the Flashduty console, select Integration Center → Alert events
- Select PowerJob and enter an integration name
- Configure the default route and select a channel; you can add more rules under Routes after the integration is created
- Click Save and copy the generated push URL
In PowerJob
PowerJob sends alarms to users: first set a WebHook address on a user, then select that user on the job or workflow. This integration is verified against PowerJob 5.1.7.
1
Set the WebHook address on a user
- Sign in to the PowerJob console and open Personal Center, and go to the Personal Info tab
- Enter the complete Flashduty push URL (including
integration_key) in the WebHook field and save
http:// or https:// prefix, PowerJob adds http://, so enter the full address starting with https://. The PowerJob server must be able to reach Flashduty on the public internet.2
Select the notified users on a job or workflow
- Click Create Job to add a job, or edit the job you want to monitor. In Alarm config, select the user from the previous step in Alarm receiver(s), then save
- Do the same for each workflow you want to monitor
3
Verify
PowerJob has no test button. Make a job fail, for example with the built-in
StandaloneProcessorDemo processor and the job parameter set to failed. Run it and confirm Flashduty shows one Critical alert titled PowerJob job failed: <job name>.Alerts do not recover
PowerJob sends no recovery notification, and it does not alarm when a job later succeeds. In the channel that receives this integration, turn on auto-close. We suggest 12 hours; adjust to how quickly your team handles failed jobs. Each failed run is a separate alert. A job that is scheduled often (for example every minute) and keeps failing creates many alerts; use Flashduty alert grouping to reduce the noise.
Job failures and workflow failures
The integration tells the two alarms apart by their content:
- Job failure: contains
jobIdandinstanceId. The title isPowerJob job failed: <job name>, orjob <jobId>when the name is missing - Workflow failure: contains
workflowIdandwfInstanceId. The workflow alarm of PowerJob 5.1.7 carries no workflow name, so the title isPowerJob workflow failed: workflow <workflowId>; find the workflow in the PowerJob console by that ID
result reported by PowerJob (cut at 1000 bytes). Job parameters, instance parameters, and the processor info (for example the body of a shell script) may hold secrets, so Flashduty does not read those fields.
Alert Key
Every run has a new instance ID, so each failure is a new alert and the same run never alerts twice. Changes to the job name, result, or times do not change the Alert Key. A request without these fields is rejected.
Instance IDs are long integers above 2^53; Flashduty keeps every digit of the original text.
Status and severity
PowerJob alarms carry no severity field and are sent only on failure, so every alert is in the triggered state with Critical severity.
Labels
Troubleshooting
- Flashduty receives no event: confirm the failed job or workflow has notified users selected and that user has a WebHook; confirm the PowerJob server can reach Flashduty and that the push URL is complete with
integration_key. When delivery fails, PowerJob only logs[WebHookAlarmService] invoke webhook ... failedon the server and does not retry - Flashduty returns an invalid-parameter error: the request lacks the fields listed under Alert Key, or it is not a PowerJob JSON alarm
- The alert never closes: this is expected; turn on auto-close in the channel
- No workflow name: see above, the workflow alarm of PowerJob 5.1.7 carries no name