Advertisement
rebelinux

Transform

Oct 15th, 2011
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. import re
  2. match = re.search('threshold of PassportCardTable status [^:]+: current value ([\d\.]+)', evt.message)
  3. if match and device:
  4.     if match.groups()[0] == '2.00':
  5.         evt.summary = "Card Modules Operational Status Failed."
  6.         evt.severity = 5
  7.     elif match.groups()[0] == '3.00':
  8.         evt.summary = "Card Modules Operational Status in Testing Mode"
  9.         evt.severity = 3
  10.     elif match.groups()[0] == '4.00':
  11.         evt.summary = "Card Modules Operational Status Unknown"
  12.         evt.severity = 3
  13.     elif match.groups()[0] == '5.00':
  14.         evt.summary = "Card Modules Operational Status in Dormant Mode"
  15.         evt.severity = 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement