diff --git a/engine/apps/alerts/integration_options_mixin.py b/engine/apps/alerts/integration_options_mixin.py index cf2d4349..5eef08cd 100644 --- a/engine/apps/alerts/integration_options_mixin.py +++ b/engine/apps/alerts/integration_options_mixin.py @@ -40,9 +40,6 @@ class IntegrationOptionsMixin: integration_config.slug for integration_config in _config if integration_config.is_displayed_on_web ] PUBLIC_API_INTEGRATION_MAP = {integration_config.slug: integration_config.slug for integration_config in _config} - INTEGRATIONS_TO_INSTRUCTIONS_WEB = { - integration_config.slug: f"html/integration_{integration_config.slug}.html" for integration_config in _config - } INTEGRATION_SHORT_DESCRIPTION = { integration_config.slug: integration_config.short_description for integration_config in _config } diff --git a/engine/apps/alerts/models/alert_receive_channel.py b/engine/apps/alerts/models/alert_receive_channel.py index b79a5eb2..fb909ac1 100644 --- a/engine/apps/alerts/models/alert_receive_channel.py +++ b/engine/apps/alerts/models/alert_receive_channel.py @@ -537,10 +537,6 @@ class AlertReceiveChannel(IntegrationOptionsMixin, MaintainableObject): def heartbeat_expired_payload(self): return getattr(self.heartbeat_module, "heartbeat_expired_payload") - @property - def heartbeat_instruction_template(self): - return getattr(self.heartbeat_module, "heartbeat_instruction_template") - @property def heartbeat_module(self): return getattr(heartbeat, self.integration, None) diff --git a/engine/apps/api/serializers/alert_receive_channel.py b/engine/apps/api/serializers/alert_receive_channel.py index 3da3a1a2..250c7405 100644 --- a/engine/apps/api/serializers/alert_receive_channel.py +++ b/engine/apps/api/serializers/alert_receive_channel.py @@ -4,7 +4,6 @@ from django.apps import apps from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ValidationError as DjangoValidationError -from django.template.loader import render_to_string from jinja2 import TemplateSyntaxError from rest_framework import serializers from rest_framework.exceptions import ValidationError @@ -140,14 +139,8 @@ class AlertReceiveChannelSerializer(EagerLoadingMixin, serializers.ModelSerializ raise BadRequest(detail=AlertReceiveChannel.DuplicateDirectPagingError.DETAIL) def get_instructions(self, obj): - if obj.integration in [AlertReceiveChannel.INTEGRATION_MAINTENANCE]: - return "" - - rendered_instruction_for_web = render_to_string( - AlertReceiveChannel.INTEGRATIONS_TO_INSTRUCTIONS_WEB[obj.integration], {"alert_receive_channel": obj} - ) - - return rendered_instruction_for_web + # Deprecated, kept for api-backward compatibility + return "" # MethodFields are used instead of relevant properties because of properties hit db on each instance in queryset def get_default_channel_filter(self, obj): diff --git a/engine/apps/api/serializers/integration_heartbeat.py b/engine/apps/api/serializers/integration_heartbeat.py index 706afc55..02cc294c 100644 --- a/engine/apps/api/serializers/integration_heartbeat.py +++ b/engine/apps/api/serializers/integration_heartbeat.py @@ -1,6 +1,4 @@ import humanize -from django.conf import settings -from django.template.loader import render_to_string from django.utils import timezone from rest_framework import serializers @@ -9,8 +7,6 @@ from apps.heartbeat.models import IntegrationHeartBeat from common.api_helpers.custom_fields import OrganizationFilteredPrimaryKeyRelatedField from common.api_helpers.mixins import EagerLoadingMixin -NO_INSTRUCTION_MESSAGE = "No instruction" - class IntegrationHeartBeatSerializer(EagerLoadingMixin, serializers.ModelSerializer): id = serializers.CharField(read_only=True, source="public_primary_key") @@ -49,14 +45,8 @@ class IntegrationHeartBeatSerializer(EagerLoadingMixin, serializers.ModelSeriali return self._last_heartbeat_time_verbal(obj) if obj.last_heartbeat_time else None def get_instruction(self, obj): - rendered_instruction = render_to_string( - obj.alert_receive_channel.heartbeat_instruction_template, - { - "heartbeat_url": obj.link, - "service_url": settings.BASE_URL, - }, - ) - return rendered_instruction + # Deprecated. Kept for API backward compatibility. + return "" @staticmethod def _last_heartbeat_time_verbal(instance): diff --git a/engine/apps/integrations/metadata/heartbeat/_heartbeat_text_creator.py b/engine/apps/integrations/metadata/heartbeat/_heartbeat_text_creator.py index 78fc8b03..ccc32774 100644 --- a/engine/apps/integrations/metadata/heartbeat/_heartbeat_text_creator.py +++ b/engine/apps/integrations/metadata/heartbeat/_heartbeat_text_creator.py @@ -11,7 +11,6 @@ class IntegrationHeartBeatText: heartbeat_expired_message: str = "heartbeat_expired" heartbeat_restored_title: str = "heartbeat_restored" heartbeat_restored_message: str = "heartbeat_restored" - heartbeat_instruction_template: str = None class HeartBeatTextCreator: @@ -24,7 +23,6 @@ class HeartBeatTextCreator: heartbeat_expired_message=self._get_heartbeat_expired_message(), heartbeat_restored_title=self._get_heartbeat_restored_title(), heartbeat_restored_message=self._get_heartbeat_restored_message(), - heartbeat_instruction_template=self._get_heartbeat_instruction_template(), ) def _get_heartbeat_expired_title(self): @@ -51,9 +49,6 @@ class HeartBeatTextCreator: ) return heartbeat_expired_message - def _get_heartbeat_instruction_template(self): - return f"heartbeat_instructions/{self.integration_verbal.lower()}.html" - class HeartBeatTextCreatorForTitleGrouping(HeartBeatTextCreator): """ diff --git a/engine/apps/integrations/metadata/heartbeat/alertmanager.py b/engine/apps/integrations/metadata/heartbeat/alertmanager.py index e4935152..2b2679f0 100644 --- a/engine/apps/integrations/metadata/heartbeat/alertmanager.py +++ b/engine/apps/integrations/metadata/heartbeat/alertmanager.py @@ -6,7 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreatorForTitleGrouping(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/elastalert.py b/engine/apps/integrations/metadata/heartbeat/elastalert.py index ab9d9415..04a05d67 100644 --- a/engine/apps/integrations/metadata/heartbeat/elastalert.py +++ b/engine/apps/integrations/metadata/heartbeat/elastalert.py @@ -6,8 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreator(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template - heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/formatted_webhook.py b/engine/apps/integrations/metadata/heartbeat/formatted_webhook.py index adb4ec77..3e44b57e 100644 --- a/engine/apps/integrations/metadata/heartbeat/formatted_webhook.py +++ b/engine/apps/integrations/metadata/heartbeat/formatted_webhook.py @@ -6,7 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreator(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/grafana.py b/engine/apps/integrations/metadata/heartbeat/grafana.py index 8237e4b3..a71011ed 100644 --- a/engine/apps/integrations/metadata/heartbeat/grafana.py +++ b/engine/apps/integrations/metadata/heartbeat/grafana.py @@ -6,7 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreatorForTitleGrouping(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/prtg.py b/engine/apps/integrations/metadata/heartbeat/prtg.py index e77a9308..ddf16333 100644 --- a/engine/apps/integrations/metadata/heartbeat/prtg.py +++ b/engine/apps/integrations/metadata/heartbeat/prtg.py @@ -6,7 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreator(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/webhook.py b/engine/apps/integrations/metadata/heartbeat/webhook.py index 03023e2e..e6283e36 100644 --- a/engine/apps/integrations/metadata/heartbeat/webhook.py +++ b/engine/apps/integrations/metadata/heartbeat/webhook.py @@ -6,8 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreator(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template - heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/metadata/heartbeat/zabbix.py b/engine/apps/integrations/metadata/heartbeat/zabbix.py index 921ec9e6..b336b75b 100644 --- a/engine/apps/integrations/metadata/heartbeat/zabbix.py +++ b/engine/apps/integrations/metadata/heartbeat/zabbix.py @@ -6,8 +6,6 @@ integration_verbal = PurePath(__file__).stem creator = HeartBeatTextCreator(integration_verbal) heartbeat_text = creator.get_heartbeat_texts() -heartbeat_instruction_template = heartbeat_text.heartbeat_instruction_template - heartbeat_expired_title = heartbeat_text.heartbeat_expired_title heartbeat_expired_message = heartbeat_text.heartbeat_expired_message diff --git a/engine/apps/integrations/templates/heartbeat_instructions/alertmanager.html b/engine/apps/integrations/templates/heartbeat_instructions/alertmanager.html deleted file mode 100644 index 32931ded..00000000 --- a/engine/apps/integrations/templates/heartbeat_instructions/alertmanager.html +++ /dev/null @@ -1,41 +0,0 @@ -
This configuration will send an alert once a minute, and if alertmanager stops working, OnCall will detect - it and notify you about that.
-Add the alert generating script to prometheus.yaml file.
- Within Prometheus it is trivial to create an expression that we can use as a heartbeat for OnCall,
- like vector(1). That expression will always return true.
Here is an alert that leverages the previous expression to create a heartbeat alert:
-
- groups:
- - name: meta
- rules:
- - alert: heartbeat
- expr: vector(1)
- labels:
- severity: none
- annotations:
- description: This is a heartbeat alert for Grafana OnCall
- summary: Heartbeat for Grafana OnCall
-
- Add receiver configuration to prometheus.yaml with the unique url from OnCall global:
- ...
- route:
- ...
- routes:
- - match:
- alertname: heartbeat
- receiver: 'grafana-oncall-heartbeat'
- group_wait: 0s
- group_interval: 1m
- repeat_interval: 50s
- receivers:
- - name: 'grafana-oncall-heartbeat'
- webhook_configs:
- - url: {{ heartbeat_url }}
- send_resolved: false
-
- Add the following rule to ElastAlert
-
- index: elastalert_status
- type: any
- alert: post
- http_post_url: {{ heartbeat_url }}
- realert:
- minutes: 1
- alert_text: elastalert is still running
- alert_text_type: alert_text_only
-
\ No newline at end of file
diff --git a/engine/apps/integrations/templates/heartbeat_instructions/formatted_webhook.html b/engine/apps/integrations/templates/heartbeat_instructions/formatted_webhook.html
deleted file mode 100644
index 4ca9faad..00000000
--- a/engine/apps/integrations/templates/heartbeat_instructions/formatted_webhook.html
+++ /dev/null
@@ -1,16 +0,0 @@
-In command line execute following commands:
-
- echo 'curl -s {{ heartbeat_url }} > /dev/null' > heartbeat_script.sh
- chmod +x heartbeat_script.sh
- crontab -e
-
-
- * * * * * /path/to/your/heartbeat_script.sh
-
- 1. In Alerting > Notification channels, click Add channel.
-
-
-
2. Enter a Name. The Type is webhook, Enter the unique OnCall URL.
-3. Select Send reminders and set a 5m (minute) interval.
-
-
-
4. In a dashboard, create a panel that will generate heartbeat alerts.
-5. In the Metrics tab, enter 0 in the query field. -
-
-
6. In the Alerting tab, enter an alert name, and conditions that allow the alert to always be enabled. Set the alert interval.
-
-
-
7. In Notifications, select the name of your heartbeat channel.
-
-
-
8. Click Save.
-We propose to set up PRTG to send heartbeat GET or POST requests to amixr endpoint to detect an outage of your
- monitoring system.
You can write a script which does this and then run the script via an EXE/script Sensor.
- If you add this Sensor to the Core Server, Amixr will send an alert if the Core Server is offline.
\ No newline at end of file
diff --git a/engine/apps/integrations/templates/heartbeat_instructions/webhook.html b/engine/apps/integrations/templates/heartbeat_instructions/webhook.html
deleted file mode 100644
index 4ca9faad..00000000
--- a/engine/apps/integrations/templates/heartbeat_instructions/webhook.html
+++ /dev/null
@@ -1,16 +0,0 @@
-
In command line execute following commands:
-
- echo 'curl -s {{ heartbeat_url }} > /dev/null' > heartbeat_script.sh
- chmod +x heartbeat_script.sh
- crontab -e
-
-
- * * * * * /path/to/your/heartbeat_script.sh
-
-
- ...
- route:
- receiver: 'grafana_oncall'
- group_by: [alertname, datacenter, app]
- ...
- receivers:
- - name: 'grafana_oncall'
- webhook_configs:
- - url: {{ alert_receive_channel.integration_url }}
- send_resolved: true
-
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
-
- receivers:
- - name: 'grafana_oncall'
- webhook_configs:
- - url: {{ alert_receive_channel.integration_url }}
- max_alerts: 100
-
- 2. Use receiver in route tree:
-
- routes:
- - matchers:
- - severity="critical"
- receiver: grafana_oncall
-
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- Create a new HTTP Request Template in AppDynamics to send events to Grafana OnCall using the
- integration URL above.
- Refer to AppDynamics documentation for more information on how to create HTTP Request Templates:
-
- https://docs.appdynamics.com/appd/23.x/latest/en/appdynamics-essentials/alert-and-respond/actions/http-request-actions-and-templates
-
-
Use the following values when configuring a new HTTP Request Template:
- -
- Request URL:
-
- Method: POST
-
- Raw URL: Integration URL above
-
- Authentication:
-
- Type: None
-
- Payload:
-
- MIME Type: application/json
-
- Template:
-
-{% verbatim %}
-
-{
- "event": {
- "eventType": "${latestEvent.eventType}",
- "id": "${latestEvent.id}",
- "guid": "${latestEvent.guid}",
- "eventTypeKey": "${latestEvent.eventTypeKey}",
- "eventTime": "${latestEvent.eventTime}",
- "displayName": "${latestEvent.displayName}",
- "summaryMessage": "${latestEvent.summaryMessage}",
- "eventMessage": "${latestEvent.eventMessage}",
- "application": {
- "name": "${latestEvent.application.name}"
- },
- "node": {
- "name": "${latestEvent.node.name}"
- },
- "severity": "${latestEvent.severity}",
- "deepLink": "${latestEvent.deepLink}"
- }
-}
-
-{% endverbatim %}
-
-
- Response Handling Criteria
-
- Success Criteria: Status Code 200
-
- Settings:
-
- One Request Per Event: Enabled
-
- After setting up a template, create a new action in AppDynamics and select the template you created earlier.
- Now you can configure policies to trigger the action when certain events occur in AppDynamics.
-
- When configuring a policy, select the following events to trigger the action:
-
Health Rule Violation Started - WarningHealth Rule Violation Started - CriticalHealth Rule Violation Continues - WarningHealth Rule Violation Continues - CriticalHealth Rule Violation Upgraded - Warning to CriticalHealth Rule Violation Downgraded - Critical to WarningHealth Rule Violation Ended - WarningHealth Rule Violation Ended - CriticalHealth Rule Violation Canceled - WarningHealth Rule Violation Canceled - Critical- After setting up the connection, you can test it by sending a test request from the AppDynamics UI. -
diff --git a/engine/apps/integrations/templates/html/integration_curler.html b/engine/apps/integrations/templates/html/integration_curler.html deleted file mode 100644 index afbccbcc..00000000 --- a/engine/apps/integrations/templates/html/integration_curler.html +++ /dev/null @@ -1,11 +0,0 @@ -More details in our documentation
- -{{ alert_receive_channel.integration_url }}
-{{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- This is the Demointegration for Slack so no actions required.
diff --git a/engine/apps/integrations/templates/html/integration_direct_paging.html b/engine/apps/integrations/templates/html/integration_direct_paging.html deleted file mode 100644 index 0d87618b..00000000 --- a/engine/apps/integrations/templates/html/integration_direct_paging.html +++ /dev/null @@ -1,2 +0,0 @@ - -You can create a direct page alert group from the web UI
diff --git a/engine/apps/integrations/templates/html/integration_elastalert.html b/engine/apps/integrations/templates/html/integration_elastalert.html deleted file mode 100644 index a200d43f..00000000 --- a/engine/apps/integrations/templates/html/integration_elastalert.html +++ /dev/null @@ -1,22 +0,0 @@ -{{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - Formatted Webhook is primarily used for custom integrations using scripts. - Use any http client, for example curl, to send POST requests with body using the format in the example below: --
-
alert_uid [char][not required] - unique alert ID for grouping;title [char][not required] - title;image_url [char][not required] - url for image attached to alert;state [char][not required] - could be "ok" or "alerting", helpful for auto-resolving;link_to_upstream_details [char][not required] - link back to your monitoring system;message [char][not required] - alert details;-
-curl -X POST \
- {{ alert_receive_channel.integration_url }} \
- -H 'Content-Type: Application/json' \
- -d '{
- "alert_uid": "08d6891a-835c-e661-39fa-96b6a9e26552",
- "title": "The whole system is down",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg",
- "state": "alerting",
- "link_to_upstream_details": "https://en.wikipedia.org/wiki/Downtime",
- "message": "Smth happened. Oh no!"
-}'
-
-
-
-Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - To connect the current Grafana stack alerting automatically, please use the Current Grafana. --
Contact Points
- webhook and url
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - This is the integration with current Grafana Alerting. - It already automatically created a new Grafana Alerting- -Contact Pointand - aSpecific Route.
- If you want to connect the other Grafana Instance please - choose theOther GrafanaIntegration instead. -
-
Contact Point
- Test buton to send an alert to Grafana OnCall
- -
Specific Route
- Contact Point is missing?-
Contact Point in Grafana Alerting
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- Amixr-based Heartbeat Monitoring allows you to monitor long-lasting processes in your infrastructure or backend and ensure they are finshed in expected timeframe.
-Your unique HeartBeat API link:
-{{ alert_receive_channel.integration_url }}
-More details and API specification in our documentation
\ No newline at end of file diff --git a/engine/apps/integrations/templates/html/integration_inbound_email.html b/engine/apps/integrations/templates/html/integration_inbound_email.html deleted file mode 100644 index efe359b6..00000000 --- a/engine/apps/integrations/templates/html/integration_inbound_email.html +++ /dev/null @@ -1,5 +0,0 @@ -{{ alert_receive_channel.inbound_email }}
-
-
-Docs
\ No newline at end of file
diff --git a/engine/apps/integrations/templates/html/integration_jira.html b/engine/apps/integrations/templates/html/integration_jira.html
deleted file mode 100644
index 87ebc302..00000000
--- a/engine/apps/integrations/templates/html/integration_jira.html
+++ /dev/null
@@ -1,20 +0,0 @@
-Create a new webhook connection in Jira to send events to Grafana OnCall using the integration URL above.
-Refer to Jira documentation for more information on how to create and manage webhooks: - - https://developer.atlassian.com/server/jira/platform/webhooks/ - -
- -When creating a webhook in Jira, select the following events to be sent to Grafana OnCall:
--
After setting up the connection, you can test it by creating a new issue in Jira. You should see a new alert - group in Grafana OnCall.
diff --git a/engine/apps/integrations/templates/html/integration_kapacitor.html b/engine/apps/integrations/templates/html/integration_kapacitor.html deleted file mode 100644 index dc816bb9..00000000 --- a/engine/apps/integrations/templates/html/integration_kapacitor.html +++ /dev/null @@ -1,22 +0,0 @@ -{{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- There are 2 ways to issue an incident manually from Slack:
- -/oncall or /oncall Title message to any chatCreate a new incident-
{{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- -
{{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - PRTG can use the script to send the alerts to Grafana OnCall. Please use the format below --
-
alert_uid [char][not required] - unique alert ID for grouping;title [char][not required] - title;image_url [char][not required] - url for image attached to alert;state [char][not required] - could be "ok" or "alerting", helpful for auto-resolving;link_to_upstream_details [char][not required] - link back to your monitoring system;message [char][not required] - alert details;-
-# You are very welcome to change this script to fit your needs and formats
-Param(
- [string]$sensorid,
- [string]$date,
- [string]$device,
- [string]$shortname,
- [string]$status,
- [string]$message,
- [string]$datetime,
- [string]$linksensor,
- [string]$url
-)
-
-# PRTG Server
-$PRTGServer = "localhost:8080"
-$PRTGUsername = "amixr"
-$PRTGPasshash = *****
-
-#Directory for logging
-$LogDirectory = "C:\temp\prtg-notifications-msteam.log"
-
-#Acknowledgement Message for alerts ack'd via Teams
-$ackmessage = "Problem has been acknowledged via Amixr."
-
-# the acknowledgement URL
-$ackURL = [string]::Format("{0}/api/acknowledgealarm.htm?id={1}&ackmsg={2}&username={3}&passhash={4}",$PRTGServer,$sensorID,$ackmessage,$PRTGUsername,$PRTGPasshash);
-
-# Autoresolve an alert in Amixr
-if($status -eq "Up")
-{ $state = "ok" }
-ElseIf($status -match "now: Up")
-{ $state = "ok" }
-ElseIf($status -match "Up (was:")
-{ $state = "ok" }
-Else
-{ $state = "alerting" }
-
-$image_datetime = [datetime]::parse($datetime)
-$sdate = $image_datetime.AddHours(-1).ToString("yyyy-MM-dd-HH-mm-ss")
-$edate = $image_datetime.ToString("yyyy-MM-dd-HH-mm-ss")
-
-$image_url = "$PRTGServer/chart.png?type=graph&graphid=-1&avg=0&width=1000&height=400&username=$PRTGUsername&passhash=$PRTGPasshash&id=$sensorid&sdate=$sdate&edate=$edate"
-
-$Body = @{
- "alert_uid"="$sensorid $date";
- "title"="$device $shortname $status at $datetime ";
- "image_url"=$image_url;
- "state"=$state;
- "link_to_upstream_details"="$linksensor";
- "message"="$message";
- "ack_url_get"="$ackURL"
-} | ConvertTo-Json
-$Body
-
-try
-{ Invoke-RestMethod -uri $url -Method Post -body $Body -ContentType 'application/json; charset=utf-8'; exit 0; }
-Catch
-{
- $ErrorMessage = $_.Exception.Message
- (Get-Date).ToString() +" - "+ $ErrorMessage | Out-File -FilePath $LogDirectory -Append
- exit 2;
-}
-
-
-
-
-Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- {{ alert_receive_channel.integration_url }}
- Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- More details in our documentation
- -Amixr and Sentry configuration is simple as that
-Accept & Install button.
-This integration will consume messages from the channel you choose and make incidents from them.
- -It’s useful for:
-1. Service desk.
-2. Consuming alerts from other systems using Slack as a message bus.
diff --git a/engine/apps/integrations/templates/html/integration_stackdriver.html b/engine/apps/integrations/templates/html/integration_stackdriver.html deleted file mode 100644 index 560a24cd..00000000 --- a/engine/apps/integrations/templates/html/integration_stackdriver.html +++ /dev/null @@ -1,26 +0,0 @@ --
Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- -
My Settings > Add Alert Contact and set the following fields:
-WebhookAmixr<{{ alert_receive_channel.integration_url }}>
- {
- "monitorURL": "monitorURL",
- "monitorFriendlyName": "monitorFriendlyName",
- "alertType": "alertType",
- "alertTypeFriendlyName": "alertTypeFriendlyName",
- "alertDetails": "alertDetails",
- "alertDuration": "alertDuration",
- "sslExpiryDate": "sslExpiryDate",
- "sslExpiryDaysLeft": "sslExpiryDaysLeft"
- }
-
-Save Changes and CloseSend Test Alert to Amixr
-Add New Monitor
-http://devnull.amixr.io or any other non-existent domain
-Create Monitor
-Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - Free-format Webhook is mostly used for custom integrations via scrips. Use any http client, - e.g. curl to send POST requests with any payload. -- -
-
-curl -X POST \
- {{ alert_receive_channel.integration_url }} \
- -H 'Content-Type: Application/json' \
- -d '{
- "alert_uid": "08d6891a-835c-e661-39fa-96b6a9e26552",
- "title": "The whole system is down",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/e/ee/Grumpy_Cat_by_Gage_Skidmore.jpg",
- "state": "alerting",
- "link_to_upstream_details": "https://en.wikipedia.org/wiki/Downtime",
- "message": "Smth happened. Oh no!"
-}'
-
-
-
-Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- - Zabbix can use the script to send the alerts to Grafana OnCall. Please use the format below --
-
alert_uid [char][not required] - unique alert ID for grouping;title [char][not required] - title;image_url [char][not required] - url for image attached to alert;state [char][not required] - could be "ok" or "alerting", helpful for auto-resolving;link_to_upstream_details [char][not required] - link back to your monitoring system;message [char][not required] - alert details;-
-#!/bin/bash
-# This is the modification of original ericos's shell script.
-
-# Get the url ($1), subject ($2), and message ($3)
-url="$1"
-subject="${2//$'\r\n'/'\n'}"
-message="${3//$'\r\n'/'\n'}"
-
-# Alert state depending on the subject indicating whether it is a trigger going in to problem state or recovering
-recoversub='^RECOVER(Y|ED)?$|^OK$|^Resolved.*'
-
-if [[ "$subject" =~ $recoversub ]]; then
- state='ok'
-else
- state='alerting'
-fi
-
-payload='{
- "title": "'${subject}'",
- "state": "'${state}'",
- "message": "'${message}'"
-}'
-
-# Alert group identifier from the subject of action. Grouping will not work without AMIXR_GROUP in the action subject
-regex='AMIXR_GROUP: ([a-zA-Z0-9_\"]*)'
-if [[ "$subject" =~ $regex ]]; then
- alert_uid=${BASH_REMATCH[1]}
- payload='{
- "alert_uid": "'${alert_uid}'",
- "title": "'${subject}'",
- "state": "'${state}'",
- "message": "'${message}'"
- }'
-fi
-
-return=$(curl $url -d "${payload}" -H "Content-Type: application/json" -X POST)
-
-
-
-
-Escalations settings
- Alert Templates Settings
- Personal Notifications Settings
- on the Users Page
- Create a new "Trigger or automation" webhook connection in Zendesk to send events to Grafana OnCall using the
- integration URL above.
- Refer to Zendesk documentation for more information on how to create and manage webhooks:
-
- https://support.zendesk.com/hc/en-us/articles/4408839108378-Creating-webhooks-to-interact-with-third-party-systems
-
-
After setting up a webhook in Zendesk, create a new trigger with the following condition:
- Meet ANY of the following conditions: "Ticket Is Created", "Ticket status Changed"
Set Notify webhook as the trigger action and select the webhook you created earlier.
- In the JSON body field, use the following JSON template:
-{
- "ticket": {
- "id": "{{ticket.id}}",
- "url": "{{ticket.url}}",
- "status": "{{ticket.status}}",
- "title": "{{ticket.title}}",
- "description": "{{ticket.description}}"
- }
-}
-
-{% endverbatim %}
-
-After setting up the connection, you can test it by creating a new ticket in Zendesk. You should see a new alert - group in Grafana OnCall.
diff --git a/engine/apps/integrations/tests/test_heartbeat_metadata.py b/engine/apps/integrations/tests/test_heartbeat_metadata.py index f2e62cf4..a489ea4a 100644 --- a/engine/apps/integrations/tests/test_heartbeat_metadata.py +++ b/engine/apps/integrations/tests/test_heartbeat_metadata.py @@ -9,7 +9,6 @@ def test_heartbeat_metadata_presence(): "heartbeat_restored_title", "heartbeat_restored_message", "heartbeat_restored_payload", - "heartbeat_instruction_template", ] modules = [x for x in dir(heartbeat) if not x.startswith("_") and x != "apps"] for m in modules: