With SAP Intelligent RPA, it is possible to automatically create jobs in an unattended mode by using scheduled or API triggers. One prerequisite for an automatic execution is that there is an agent available to execute the job. But what if your agent becomes unavailable due to a network problem or server failure? Obviously, the jobs will stop running because your agent is disconnected. You would then have to go to Cloud Factory and manually check the status of your agent to find out why the jobs can no longer run. This is where the alert handlerscome in. The alert handlers for agent events let you define a notification you want to receive when an agent is disconnected. With such notifications, you can directly react to it and don’t need to manually check the status of the agent in the Cloud Factory.
The alert handler for agent events will replace the alerts that could be found under the Agents tab. A major improvement is that you can now define an alert handler within your environment. You can specifically say which environments you want to receive notifications for, and you won’t receive notifications for agents in environments that are not of your interest. Moreover, it is possible to define a constraint for your notifications. Let’s say you don’t care if your agent is disconnected only for a short period of time, which could happen due to a scheduled reboot, for example, and doesn’t affect the execution of your jobs. But you do care if your jobs can’t run because your agent is disconnected for an extended period of time. With the new alert handler for agent events, this is not a problem: just add a constraint to your alert handler with the desired time range. For example, you can say “I only want to receive an alert when the agent is disconnected for at least 30 minutes”. Sound good? Then read on and I’ll show you how to configure your alert handler for agent events.
Configuration of alert handler for agent events
If you want to receive notifications for disconnected agents in an environment, you need to add an alert handler with an agent event to your environment. Go to your environment and select "Alert Handler" on the left side and create a new alert handler.
Alert handler creation in environment
In the first step of creation, you need to select the event to which the alert handler should react. Select "Agent Disconnected" and click on "Next".
Selection of event for the alert handler
In the next step you need to specify the name of the alert handler and you can also provide a description. If you want to receive alerts only when your agent is disconnected for a certain period of time, you need to select the "Use Constraint" checkbox to define the period. You can define a constraint in minutes (with an interval of 5 minutes) or in hours (with an interval of 1 hour). You will then receive notifications only if the agent is disconnected for at least the defined period of time.
Adding a constraint to the alert handler
In the last step of creation, you need to add the details of the email that will be sent with the alert handler. You need to provide the recipients of your email, the subject and the content. It is also possible to include some context or event related information to the subject or content of your email by using the available variables. You can, for example, refer to the timestamp when the event has occurred or the name of the agents that were disconnected. With the new editor, this is easy. You can simply insert a variable by clicking on it within the editor dropdown:
Using variables in the content of your email
Moreover, with the new editor, you can also format the content of your email. After you have defined the recipients, the subject and the content of your email, you can finally create the alert handler.
Adding an alert handler with the defined email
Receiving emails on agent disconnected events
After you have added the alert handler, it is ready to send emails when your defined event occurs. The alert handler will react to all agents or agent groups that are defined in the environment. For example, the previously created alert handler will react to all the agents that I have added with the agent group “Hanna” to my environment.
Defined agent group in environment
One prerequisite for sending emails is that you have configured your Mail Server. You can find more information about the configuration here. I would also like to mention that agent disconnected events may be sent with a delay of up to 5 minutes.
As mentioned above, alert handler for agent events will replace the alerts that could be found under the agents tab. This means that your alerts that you have configured in the Agents tab are still functional, however you are not able to create new alerts in the Agents tab anymore and they will be deprecated in July 2021. An attentive reader may wonder what happens to the alert for no eligible agent? They will be also deprecated in the future. But we have already introduced an improved way of receiving notifications if a job cannot be distributed because there is no eligible agent to pick up the job: define an expiration date for the trigger that creates the job and add an email notifier that notifies if the job expired. In doing so, the job will expire after the defined period of time if there is no agent to run the job, and the notifier will let you know. But this is only as a side note.
Alerts for agent events are a powerful tool that allows you to further increase the level of automation and saves you from checking the status of your agents manually. I hope I was able to provide you a good insight into using and configuring alerts for agent events with this blog post. If you have any questions you can ask them in the Q&A section. Also, feel free to provide some feedback and don’t hesitate to leave a comment.