Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding handlers for brick and volume status change alerts #79

Merged
merged 2 commits into from
Jun 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions tendrl/alerting/handlers/cluster/brick_status_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from tendrl.alerting.handlers import AlertHandler
from tendrl.alerting.objects.cluster_alert import ClusterAlert


class BrickStatusHandler(AlertHandler):
handles = 'brick_status'
representive_name = 'brick_status_alert'

def __init__(self):
AlertHandler.__init__(self)

def format_alert_message(self):
return

def classify_alert(self):
ClusterAlert(
alert_id=self.alert.alert_id,
node_id=self.alert.node_id,
time_stamp=self.alert.time_stamp,
resource=self.alert.resource,
current_value=self.alert.current_value,
tags=self.alert.tags,
alert_type=self.alert.alert_type,
severity=self.alert.severity,
significance=self.alert.significance,
ackedby=self.alert.ackedby,
acked=self.alert.acked,
pid=self.alert.pid,
source=self.alert.source,
).save(update=False)
30 changes: 30 additions & 0 deletions tendrl/alerting/handlers/cluster/volume_status_handler.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from tendrl.alerting.handlers import AlertHandler
from tendrl.alerting.objects.cluster_alert import ClusterAlert


class VolumeStatusHandler(AlertHandler):
handles = 'volume_status'
representive_name = 'volume_status_alert'

def __init__(self):
AlertHandler.__init__(self)

def format_alert_message(self):
return

def classify_alert(self):
ClusterAlert(
alert_id=self.alert.alert_id,
node_id=self.alert.node_id,
time_stamp=self.alert.time_stamp,
resource=self.alert.resource,
current_value=self.alert.current_value,
tags=self.alert.tags,
alert_type=self.alert.alert_type,
severity=self.alert.severity,
significance=self.alert.significance,
ackedby=self.alert.ackedby,
acked=self.alert.acked,
pid=self.alert.pid,
source=self.alert.source,
).save(update=False)