Guest User

Untitled

a guest
Sep 5th, 2012
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.00 KB | None | 0 0
  1. { "_id" : ObjectId("504745d55c8b828833000010"), "log" : [
  2. {
  3. "timestamp" : ISODate("2012-09-05T16:30:13.991Z"),
  4. "message" : "Failed to classify on NOC version 0.7(4)r6532",
  5. "to_status" : "F",
  6. "from_status" : "N"
  7. }
  8. ], "managed_object" : 128, "raw_vars" : { "1__3__6__1__6__3__1__1__4__1__0" : "1.3.6.1.6.3.1.1.5.3", "1__3__6__1__6__3__18__1__3__0" : "=AC=10=03=08", "1__3__6__1__2__1__1__3__0" : "16905800", "1__3__6__1__2__1__2__2__1__1__25" : "25", "source" : "SNMP Trap", "1__3__6__1__2__1__2__2__1__7__25" : "2", "1__3__6__1__2__1__2__2__1__8__25" : "7", "collector" : "213.108.209.9:162", "1__3__6__1__6__3__1__1__4__3__0" : "1.0.8802.1.1.2.0" }, "timestamp" : ISODate("2012-09-05T16:30:13Z"), "traceback" : "UNHANDLED EXCEPTION (2012-09-05 16:30:13.986970)\n<type 'exceptions.TypeError'>\nint() argument must be a string or a number, not 'NoneType'\nSTART OF TRACEBACK\n------------------------------------------------------------------------\nFile: /usr/local/noc/sa/profiles/EdgeCore/ES/__init__.py (Line: 39)\nFunction: convert_interface_name\n 32 command_enter_config = \"configure\"\n 33 command_leave_config = \"exit\"\n 34 command_save_config = \"copy running-config startup-config\"\n 35 convert_mac = noc.sa.profiles.Profile.convert_mac_to_dashed\n 36 \n 37 def convert_interface_name(self, s):\n 38 try:\n 39 ==> i = int(s)\n 40 if \"1000\" < i < \"5096\":\n 41 return \"VLAN %d\" % (int(s) - 1000)\n 42 if \"0\" < i < \"1000\":\n 43 return \"Eth %s/%s\" % ('1', s)\n 44 except ValueError:\n 45 s = s.replace(\" \", \" \")\nVariables:\n s = None\n self = <noc.sa.profiles.EdgeCore.ES.Profile object at 0x807d5d3d0>\n------------------------------------------------------------------------\nFile: /usr/local/noc/fm/classifier.py (Line: 857)\nFunction: classify_event\n 850 # Calculate rule variables\n 851 vars = self.eval_rule_variables(event, event_class, vars)\n 852 # Additionally check link events\n 853 disposable = True\n 854 if event_class.link_event and \"interface\" in vars:\n 855 iface = noc.inv.models.Interface.objects.filter(\n 856 managed_object=event.managed_object.id,\n 857 ==> name=event.managed_object.profile.convert_interface_name(vars[\"interface\"])\n 858 ).first()\n 859 if iface:\n 860 action = iface.profile.link_events\n 861 if action == \"I\":\n 862 # Ignore\n 863 logging.info(\"Event %s mark as ignored by interface profile '%s' (%s)\" % (event.id, iface.profile.name, iface.name))\nVariables:\n resolved_vars = {'profile': u'EdgeCore.ES', u'SNMPv2-MIB::snmpTrapEnterprise.0': u'LLDP-MIB::lldpNotifications', u'IF-MIB::ifIndex.25': '25', u'SNMPv2-MIB::sysUpTime.0': '16905800', u'SNMP-COMMUNITY-MIB::snmpTrapAddress.0': '=AC=10=03=08', u'IF-MIB::ifOperStatus.25': u'lowerLayerDown', u'IF-MIB::ifAdminStatus.25': u'down', u'SNMPv2-MIB::snmpTrapOID.0': u'IF-MIB::linkDown'}\n vars = {u'interface': None}\n k = u'SNMPv2-MIB::snmpTrapOID.0'\n disposable = True\n rule = <Rule 'EdgeCore | ES | Network | Link | Link Down (SNMP) #2'>\n self = <noc.fm.classifier.Classifier object at 0x801baa290>\n v = u'IF-MIB::linkDown'\n c_vars = {'profile': 'EdgeCore.ES', u'SNMPv2-MIB::snmpTrapEnterprise.0': 'LLDP-MIB::lldpNotifications', u'1.3.6.1.6.3.18.1.3.0': u'=AC=10=03=08', u'1.3.6.1.2.1.1.3.0': u'16905800', u'1.3.6.1.6.3.1.1.4.3.0': u'1.0.8802.1.1.2.0', u'IF-MIB::ifOperStatus.25': 'lowerLayerDown', u'1.3.6.1.2.1.2.2.1.8.25': u'7', u'SNMPv2-MIB::sysUpTime.0': '16905800', u'IF-MIB::ifIndex.25': '25', u'1.3.6.1.2.1.2.2.1.7.25': u'2', u'1.3.6.1.2.1.2.2.1.1.25': u'25', u'source': u'SNMP Trap', u'SNMP-COMMUNITY-MIB::snmpTrapAddress.0': '\\xac\\x10\\x03\\x08', u'IF-MIB::ifAdminStatus.25': 'down', u'1.3.6.1.6.3.1.1.4.1.0': u'1.3.6.1.6.3.1.1.5.3', u'SNMPv2-MIB::snmpTrapOID.0': 'IF-MIB::linkDown', u'collector': u'213.108.209.9:162'}\n event = <NewEvent: 504745d55c8b828833000010>\n event_class = <EventClass: Network | Link | Link Down>\n------------------------------------------------------------------------\nFile: /usr/local/noc/fm/classifier.py (Line: 947)\nFunction: run\n 940 # Enter main loop\n 941 while True:\n 942 n = 0 # Number of events processed\n 943 sn = st.copy()\n 944 t0 = time.time()\n 945 for e in self.iter_new_events(REPORT_INTERVAL):\n 946 try:\n 947 ==> s = self.classify_event(e)\n 948 sn[s] += 1\n 949 except EventProcessingFailed, why:\n 950 self.mark_as_failed(e, why[0])\n 951 sn[CR_FAILED] += 1\n 952 except:\n 953 self.mark_as_failed(e)\nVariables:\n e = <NewEvent: 504745d55c8b828833000010>\n perf = 54.85762117764001\n CHECK_EVERY = 3\n i = 5\n self = <noc.fm.classifier.Classifier object at 0x801baa290>\n t0 = 1346848213.925323\n n = 2\n s = 4\n sn = {0: 1, 1: 0, 2: 0, 3: 0, 4: 1, 5: 0}\n dt = 0.03645801544189453\n st = {0: 0, 1: 0, 2: 0, 3: 0, 4: 0, 5: 0}\n REPORT_INTERVAL = 1000\n------------------------------------------------------------------------\nEND OF TRACEBACK", "version" : "0.7(4)r6532" }
  9.  
  10.  
  11. \\\\\
  12. def convert_interface_name(self, s):
  13. try:
  14. i = int(s)
  15. if "1000" < i < "5096":
  16. return "VLAN %d" % (int(s) - 1000)
  17. if "0" < i < "1000":
  18. return "Eth %s/%s" % ('1', s)
  19. except ValueError:
  20. s = s.replace(" ", " ")
  21. return s.replace("/ ", "/")
  22.  
  23. \\\\
  24. JSON
  25. {
  26. "name": "EdgeCore | ES | Network | Link | Link Down (SNMP) #2",
  27. "description": "IF-MIB::linkDown",
  28. "event_class__name": "Network | Link | Link Down",
  29. "preference": 1000,
  30. "patterns": [
  31. {
  32. "key_re": "^source$",
  33. "value_re": "^SNMP Trap$"
  34. },
  35. {
  36. "key_re": "^profile$",
  37. "value_re": "^EdgeCore\\.ES$"
  38. },
  39. {
  40. "key_re": "^IF-MIB::ifIndex\\.\\d+$",
  41. "value_re": "^(?P<interface>\\d+)$"
  42. },
  43. {
  44. "key_re": "^SNMPv2-MIB::snmpTrapOID\\.0$",
  45. "value_re": "^IF-MIB::linkDown$"
  46. }
  47. ]
  48. },
Advertisement
Add Comment
Please, Sign In to add comment