Permalink
Browse files

PT43392239: system related alarms are not sent via email

- fix regex for DISMAN-EVENT-MIB::mteHotTrigger
- reconfigure snmpd when alarms change
  • Loading branch information...
1 parent d8c088e commit 3d8d6ca8b82505bb6b8949ddb904f67be3f60677 @dizzy dizzy committed Jan 29, 2013
@@ -62,7 +62,7 @@ public boolean setup(SetupManager manager) {
@Override
public void replicate(ConfigManager manager, ConfigRequest request) throws IOException {
- if (!request.applies(SnmpManager.FEATURE, LocationsManager.FEATURE)) {
+ if (!request.applies(SnmpManager.FEATURE, LocationsManager.FEATURE, Alarms.FEATURE)) {
return;
}
Set<Location> locations = request.locations(manager);
@@ -84,11 +84,11 @@ end
#
# ============= Builtin net-snmp alarm =======
# DISMAN-EVENT-MIB::mteTriggerFired
-# DISMAN-EVENT-MIB::mteHotTrigger.0 = STRING: CPU_THRESHOLD_EXCEEDED
+# DISMAN-EVENT-MIB::mteHotTrigger.0 CPU_THRESHOLD_EXCEEDED
# DISMAN-EVENT-MIB::mteHotTargetName.0 = STRING:
# DISMAN-EVENT-MIB::mteHotContextName.0 = STRING:
# DISMAN-EVENT-MIB::mteHotOID.0 = OID: HOST-RESOURCES-MIB::hrProcessorLoad.768
-# DISMAN-EVENT-MIB::mteHotValue.0 = INTEGER: 95
+# DISMAN-EVENT-MIB::mteHotValue.0 95
####################################
def parse_alarm(data, input_stream)
alarm = {}
@@ -98,9 +98,9 @@ def parse_alarm(data, input_stream)
alarm = get_alarm(data, $1)
when /^SIPXECS-ALARM-NOTIFICATION-MIB::sipxecsAlarmSource/
alarm['source'] = line.split[1]
- when /^DISMAN-EVENT-MIB::mteHotTrigger.0 = STRING: (.*)$/
+ when /^DISMAN-EVENT-MIB::mteHotTrigger.0 (.*)$/
alarm = get_alarm(data, $1)
- when /^DISMAN-EVENT-MIB::mteHotValue.0 = INTEGER: (.*)$/
+ when /^DISMAN-EVENT-MIB::mteHotValue.0 (.*)$/
alarm['message'] = "threshold is #{$1}"
when /^SIPXECS-ALARM-NOTIFICATION-MIB::sipxecsAlarmDescr "(.*)"$/
alarm['message'] = $1

0 comments on commit 3d8d6ca

Please sign in to comment.