You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/create_alert.py
+14-15Lines changed: 14 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
#!/usr/bin/env python
2
2
#
3
3
# This script shows how to use the create_alert() call to create the following
4
-
# Sysdig Cloud alert: 'send an email notification when the CPU of any tomcat
4
+
# Sysdig Cloud alert: 'send an email notification when the CPU of any tomcat
5
5
# process running on any of the instrumented machines goes over 80%'
6
6
#
7
7
#
@@ -29,24 +29,23 @@
29
29
# Create the alert.
30
30
#
31
31
res=sdclient.create_alert('tomcat cpu > 80% on any host', # Alert name.
32
-
'this alert was automatically created using the python Sysdig Cloud library', # Alert description.
33
-
6, # Syslog-encoded severity. 6 means 'info'.
34
-
60, # The alert will fire if the condition is met for at least 60 seconds.
35
-
'avg(cpu.used.percent) > 80', # The condition.
36
-
['host.mac', 'proc.name'], # Segmentation. We want to check this metric for every process on every machine.
37
-
'ANY', # in case there is more than one tomcat process, this alert will fire when a single one of them crosses the 80% threshold.
38
-
'proc.name = "tomcat"', # Filter. We want to receive a notification only if the name of the process meeting the condition is 'tomcat'.
39
-
['EMAIL'], # Notification target. We want an email to be sent. Alerts email recipients can be defined here: https://app.sysdigcloud.com/#/settings/notifications
40
-
False) # This alert will be disabled when it's created.
41
-
32
+
'this alert was automatically created using the python Sysdig Cloud library', # Alert description.
33
+
6, # Syslog-encoded severity. 6 means 'info'.
34
+
60, # The alert will fire if the condition is met for at least 60 seconds.
35
+
'avg(cpu.used.percent) > 80', # The condition.
36
+
['host.mac', 'proc.name'], # Segmentation. We want to check this metric for every process on every machine.
37
+
'ANY', # in case there is more than one tomcat process, this alert will fire when a single one of them crosses the 80% threshold.
38
+
'proc.name = "tomcat"', # Filter. We want to receive a notification only if the name of the process meeting the condition is 'tomcat'.
39
+
['EMAIL'], # Notification target. We want an email to be sent. Alerts email recipients can be defined here: https://app.sysdigcloud.com/#/settings/notifications
40
+
False) # This alert will be disabled when it's created.
0 commit comments