UpGuard can be used to generate endless possibilities of log outputs for integration with Rocket Chat. In this tutorial, we will learn how to create Rocket Chat Actions with UpGuard.


To post to Rocket Chat, you first need to set up a Rocket Chat Integration.

Adding a Rocket Chat Integration in UpGuard

  1. Navigate to the Control > Events page and select an Event you would like to be notified about. Here we are using the pre Saved Event view for Policy Failure events as an example.
    w400 w400

    This will bring up a list of all policy failure events.

  2. Click Add Action under the Actions tab, then select Send a message to RocketChat. w800

  3. Choose an appropriate name for the action under Action name. This will be the name used to refer to the action in UpGuard - this does not display in Rocket Chat.

  4. Select an existing Rocket Chat Integration to use. If you want to report different types of events to different channels, then you can create Rocket Chat integrations for each channel and select the appropriate Integration here to post this type of event to the corresponding channel.

  5. Create the Message body that will appear in the Rocket Chat message. Here, because we are reporting policy failures we recommend a Message structure like this:

Policy "{{ policy }}" failed. Click {{ job_url }} for details.

Here {{ policy }} will be replaced by the name of the policy and {{ job_url }} will be replaced by a direct link to the details of the policy failure in UpGuard. w800

Tags: rocket chat