Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block dpetzel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:1885932
import re
# Lets try and reduce noise here. Since services have multiple
# JMX data sources, we really don't need multiple events for each data source
# A single event should do the trick. We are going to normalize the summary
# so that dedupe rules kick in
re_string = "^DataSource\s(?P<app_name>.*?)\s.*?;\serror connecting to server"
if getattr(evt, "summary", "") != "":
m =, evt.summary)
if m and'app_name'):
new_summary = "".join(['app_name'), " - ",
View gist:1885659
if device:
if device.getSnmpStatusString() != "Up":
#Preserve the actual SNMP agent down message
if getattr(evt, "summary", "") != "SNMP agent down":
evt._action = "drop"
You can’t perform that action at this time.