This application allows you to integrate OpsGenie with your Mattermost instance to notify you of new and updated alerts, as well as allow you to create, manage, and assign new alerts without leaving Mattermost.
OpsGenie to Mattermost notifications: Link Mattermost channels with OpsGenie Teams to receive notifications about new and updated alerts.
To install, as a Mattermost system admin user, run the command /apps install http OPSGENIE_API
in any channel. The /genie
command should be available after the configuration has been successfully installed.
The OPSGENIE_API
should be replaced with the URL where the OpsGenie API instance is running. Example: /apps install http https://myapp.com/manifest.json
To install, as a Mattermost system admin user, run the command /apps install listed genie
in any channel. The /genie
command should be available after the configuration has been successfully installed.
After installing the app:
- Open your OpsGenie profile and follow the next steps to retrieve your credentials needed to link to your Mattermost instance.
- Go to Settings > Integrations and select Add Integration.
- Within the Add Integration menu, select API.
- Update the integration name and access, and select Save Integration.
- Copy the given API Key.
- Return to Mattermost.
- As a Mattermost system admin user, run the
/genie configure
command. - In the configuration modal, enter your API Key.
/genie configure
: This command will enable all the other commands; it asks the administrator for an API key (which will be used to execute calls to OpsGenie’s API).
/genie help
: This command will show all current commands available for this application./genie alert create
: Allow any user to create a new alert./genie alert note
: Add a note to an existing alert./genie alert close
: Close an existing alert./genie alert ack
: Acknowledge an existing alert./genie alert unack
: Unacknowledge an existing alert./genie alert snooze
: Snooze an existing alert for a period of time./genie alert assign
: Assign an existing to a mattermost team member./genie alert own
: Take ownership of an existing alert (assign alert to yourself)./genie alert priority
: Set the priority of an existing alert./genie alert list
: Get a list of the existing alerts./genie team list
: Get a list of the existing teams./genie subscription add
: Create a new subscription for notifications by choosing a team and a channel. You can subscribe to more than one team per channel./genie subscription list
: Show the list of all subscriptions made in all of your channels./genie subscription remove
: Will allow you to remove a subscription. No more notifications from that team will be received in that channel.
- Download the latest repository release.
- You need to have at least Node version 15 and maximum version 18 installed. You can download the latest LTS version of Node for your operating system here: https://nodejs.org/es/download/
- Move to the project directory or execute
cd
command to the project directory and executenpm install
with a terminal to download all dependency libraries.
$ npm install
- Update the environment configuration file. The
.env
file must be modified or added to set the environment variables, it must be in the root of the repository.
file: .env
PROJECT=mattermost-opsgenie-app
PORT=4002
HOST=http://localhost:4002
Variable definition
- PROJECT: When executing the project with Docker using the
.build.sh
file, this variable will be used for the name of the container. - PORT: The port number the OpsGenie integration is listening to.
- HOST: The OpsGenie API usage URL.
- Finally, the project must be executed by running the following command:
$ npm run dev
Or, you can use the Makefile command:
$ make watch
- You need to have Docker installed. You can find the necessary steps to install Docker for the following operating systems:
- Once you have Docker installed, run the
make run-server
command to create the API container and expose it locally or on the server, depending on the case required.
$ make run-server
When the container is created correctly, the API runs at http://127.0.0.1:4002
. If Mattermost is running on the same machine, run the following slash command in Mattermost to install the app:
/apps install http http://127.0.0.1:4002
To stop the container, run the following command:
$ make stop-server