Setting up alerts for failed batch jobs

For setting up alerts, we are concerned with recurring batch jobs that are important to business operations (for example, posting sales invoices).

Note

For alerts to be processed, the batch framework must be functioning; so, this will only alert you of the jobs that fail and not if the jobs aren't executed by the batch framework.

Getting ready

Alerts will be configured to your account. So you must log in as yourself and you will have full rights to manage the batch jobs, for example, as a system administrator or Information technology manager.

How to do it...

We can set up alerts and log the failed batch jobs using the following steps:

  1. Navigate to System administration | Inquiries | Batch jobs.
    How to do it...
  2. Select the batch job in question.

    Note

    Check that the batch job is not being executed; if it is, AX will not let you save the changes to the alert setup.

  3. Navigate to Functions | Change status.
  4. Select Withhold—this will place the job on hold and it will not start while we are reconfiguring the task.
  5. Click on Alerts, which opens the following dialog box:
    How to do it...
  6. Check the required options. Typically, an administrator only wishes to be informed of the errors; so, you would only check Error.
  7. If you wish for the alert pop up to appear, check Show pop-ups.
  8. If you wish for an e-mail to be sent, check E-mail.

    Note

    The title of the first field group is labeled Send email alerts for job status changes. This actually means sending alerts for job status changes. The lower E-mail check box determines whether it is sent as an e-mail.

  9. Click on OK.
  10. Select the General tab, as shown in the following screenshot:
    How to do it...
  11. To control what history is saved, select the General tab and set the Save job to history field as required. Unless you need to enquire on successful jobs, you should change this to Errors only; otherwise, a lot of unnecessary data is stored.
  12. Re-enable the batch job by navigating to Functions | Change status and then select Waiting.
  13. Repeat these steps for each batch job for which you wish to configure alerts and close the form once completed.

How it works...

As with many tasks that are designed to work on the server side, the batch framework utilizes the alert system to update the user about the result of the batch job.

This works, by default, for the user who submitted the job; in this case, we are adding an alert for our user account.

The limitation here is that it cannot report a failure in the batch framework itself; for this, we need another mechanism.

There's more...

If you are using System Center Operations Manager 2012 (which is purchased separately from Dynamics AX as part of a wider system monitoring solution), the batch framework (jobs and health) is monitored without relying on the batch framework itself.

If you are not using System Center Operations Manager 2012, you will need to use other methods.

There are no counters published by AX to trap this. The only other option is to check manually or create a metric that reports on the BatchJob table, where the OrigStartDateTime value is more than 15 minutes before the current date and time.

This can be done by creating an AX query, to drive a part or cue that appears on your role center.

Note

If you assign a batch job to a batch group that is not assigned to an AOS (Application Object Server), it will not run. This is a very common problem, especially when refreshing the environments.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.97.187