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 integration
- Select PowerJob and click Save
- Open the generated integration card and copy the Push URL
Use a shared integration
- In the Flashduty console, go to 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 Routing after creation
- 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 in PowerJob
Where: PowerJob console › Personal Center › Personal Info › WebHook
Then save. If the address has no
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
Where: PowerJob console › Create Job (or edit the job to monitor) › Alarm config › Alarm receiver(s)
Save the job. Only selected users that have a WebHook receive the alarm, and PowerJob sends one request for each such user.
3
Select the notified users on a workflow
Where: PowerJob console › Workflow (create, or edit the workflow to monitor)Do the same as in the previous step for each workflow you want to monitor. PowerJob alarms only on failed executions; it sends no recovery notification and has no recovery switch, so there is nothing more to configure for recovery.
4
Verify
PowerJob has no test button, so make a job fail for real. For example, use the built-in
StandaloneProcessorDemo processor with the job parameter set to failed. Run it and confirm Flashduty shows one Critical alert titled PowerJob job failed: <job name>. The alert does not recover on its own; see Alerts do not recover.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