def processQuotaMsg(msg, alertlevel): quotapat = re.compile(r'\b\d*-[a-zA-Z0-9_-]*-quota\b') matches = quotapat.search(msg) if matches: volname = findVolName(matches.group()) # Now get the actual msg alertMsg = "QUOTA: " + msg[msg.rfind(matches.group()) + len(matches.group()) + 1:] serviceName = nscautils.vol_service_name(volname, "Quota") nscautils.send_to_nsca_subproc(nscautils.getNagiosClusterName(), serviceName, utils.PluginStatusCode.WARNING, alertMsg)
def processQuorumMsg(msgid, msg, level): pluginstatus = None # if msgid == 106002: if "[MSGID: 106002]" in msg or "[MSGID: 106001]" in msg: # [MSGID: 106002] Server quorum lost for volume dist. # Stopping local bricks. # [MSGID: 106001] Server quorum not met. Rejecting operation. alertMsg = "QUORUM: Cluster server-side quorum lost." pluginstatus = utils.PluginStatusCode.CRITICAL # elif msgid == 106003: elif "[MSGID: 106003]" in msg: # [MSGID: 106003] Server quorum regained for volume dist. # Starting local bricks. alertMsg = "QUORUM: Cluster server-side quorum regained." pluginstatus = utils.PluginStatusCode.OK if pluginstatus >= 0: serviceName = "Cluster - Quorum Status" nscautils.send_to_nsca_subproc(nscautils.getNagiosClusterName(), serviceName, pluginstatus, alertMsg)