Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2014-10-23 09:33:57,701 UNHANDLED EXCEPTION (2014-10-23 09:33:57.695856)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKSOFES001-Generic.get_discovery_id-2014-10-23-09-33-57.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKSOFES001 SCRIPT: Generic.get_discovery_id'
- chars = '!'
- m =
- '[2014-10-23 09:33:57] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKSOFES001 SCRIPT: Generic.get_discovery_id\n'
- self = <Script(Thread-29, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x277e4b0>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cf50>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e210>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-33-57'
- p = u'RUMSKSOFES001'
- object_name = u'RUMSKSOFES001'
- timeout = 1200
- kwargs = {}
- self = <Script(Thread-29, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cf50>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e210>
- script_class = <class 'noc.sa.profiles.Generic.get_discovery_id.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_discovery_id'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKSOFES001'
- sn = u'get_discovery_id'
- timeout = 1200
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Generic.get_discovery_id.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x277c090>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c090>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c090>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
- id = 1380578324
- controller = <noc.sa.rpc.Controller object at 0x277c090>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-10-23 09:33:58,740 UNHANDLED EXCEPTION (2014-10-23 09:33:58.735057)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKDUBES001-Cisco.IOS.get_version-2014-10-23-09-33-58.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKDUBES001 SCRIPT: Cisco.IOS.get_version'
- chars = '!'
- m =
- '[2014-10-23 09:33:58] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKDUBES001 SCRIPT: Cisco.IOS.get_version\n'
- self = <Script(Thread-30, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x277e980>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cd90>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e520>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-33-58'
- p = u'RUMSKDUBES001'
- object_name = u'RUMSKDUBES001'
- timeout = 1200
- kwargs = {}
- self = <Script(Thread-30, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cd90>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e520>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_version'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKDUBES001'
- sn = u'get_version'
- timeout = 1200
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x277c790>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c790>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c790>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
- id = 2116065186
- controller = <noc.sa.rpc.Controller object at 0x277c790>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-10-23 09:34:13,893 UNHANDLED EXCEPTION (2014-10-23 09:34:13.887870)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKKALES001-Cisco.IOS.get_config-2014-10-23-09-34-13.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKKALES001 SCRIPT: Cisco.IOS.get_config'
- chars = '!'
- m =
- '[2014-10-23 09:34:13] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKKALES001 SCRIPT: Cisco.IOS.get_config\n'
- self = <Script(Thread-31, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d90c0>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277ced0>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e750>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-34-13'
- p = u'RUMSKKALES001'
- object_name = u'RUMSKKALES001'
- timeout = 1200
- kwargs = {}
- self = <Script(Thread-31, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277ced0>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e750>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_config'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKKALES001'
- sn = u'get_config'
- timeout = 1200
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x277c4d0>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c4d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x277c4d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
- id = 28982613
- controller = <noc.sa.rpc.Controller object at 0x277c4d0>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-10-23 09:34:20,994 UNHANDLED EXCEPTION (2014-10-23 09:34:20.988668)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKNARES001-Cisco.IOS.get_interfaces-2014-10-23-09-34-20.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_interfaces'
- chars = '!'
- m =
- '[2014-10-23 09:34:20] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_interfaces\n'
- self = <Script(Thread-32, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d91a0>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1cd0>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d9670>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-34-20'
- p = u'RUMSKNARES001'
- object_name = u'RUMSKNARES001'
- timeout = 240
- kwargs = {}
- self = <Script(Thread-32, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1cd0>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d9670>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_interfaces.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_interfaces'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKNARES001'
- sn = u'get_interfaces'
- timeout = 240
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_interfaces.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
- id = 824156139
- controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-10-23 09:34:22,033 UNHANDLED EXCEPTION (2014-10-23 09:34:22.027870)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKKADVG001-Generic.get_ip_discovery-2014-10-23-09-34-22.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKKADVG001 SCRIPT: Generic.get_ip_discovery'
- chars = '!'
- m =
- '[2014-10-23 09:34:22] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKKADVG001 SCRIPT: Generic.get_ip_discovery\n'
- self = <Script(Thread-33, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d9280>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1d50>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d98a0>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-34-22'
- p = u'RUMSKKADVG001'
- object_name = u'RUMSKKADVG001'
- timeout = 1200
- kwargs = {}
- self = <Script(Thread-33, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1d50>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d98a0>
- script_class = <class 'noc.sa.profiles.Generic.get_ip_discovery.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_ip_discovery'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKKADVG001'
- sn = u'get_ip_discovery'
- timeout = 1200
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Generic.get_ip_discovery.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x28e1c90>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1c90>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1c90>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
- id = 1373684517
- controller = <noc.sa.rpc.Controller object at 0x28e1c90>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-10-23 09:34:36,219 UNHANDLED EXCEPTION (2014-10-23 09:34:36.213639)
- Working directory: /opt/noc
- <type 'exceptions.IOError'>
- [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKNARES001-Cisco.IOS.get_mac_address_table-2014-10-23-09-34-36.log'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 357)
- Function: cli_debug
- 350 if not self.log_cli_sessions_path:
- 351 return
- 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
- 353 if chars:
- 354 m += chars * 50
- 355 m += "\n"
- 356 m += str(msg) + "\n"
- 357 ==> with open(self.log_cli_sessions_path, "a") as f:
- 358 f.write(m)
- 359
- 360 def is_stale(self):
- 361 """Checks script is stale and must be terminated"""
- 362 return time.time() - self.start_time > self._timeout
- 363
- Variables:
- msg = u'IP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_mac_address_table'
- chars = '!'
- m =
- '[2014-10-23 09:34:36] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_mac_address_table\n'
- self = <Script(Thread-34, initial)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 244)
- Function: __init__
- 237 and self.activator.log_cli_sessions_script_re.search(self.name):
- 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
- 239 for k, v in [
- 240 ("ip", self.access_profile.address),
- 241 ("script", self.name),
- 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
- 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
- 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
- 245 # Finally call setup_script() for additional script tuning
- 246 if profile.setup_script:
- 247 profile.setup_script(self)
- 248
- 249 @classmethod
- 250 def template_clean_result(cls, result):
- Variables:
- a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d9360>
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e14d0>
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d92f0>
- parent = None
- k = 'ts'
- v = '2014-10-23-09-34-36'
- p = u'RUMSKNARES001'
- object_name = u'RUMSKNARES001'
- timeout = 1200
- kwargs = {}
- self = <Script(Thread-34, initial)>
- _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 364)
- Function: run_script
- 357 Begin script execution
- 358 """
- 359 pv, pos, sn = script_name.split(".", 2)
- 360 profile = profile_registry["%s.%s" % (pv, pos)]()
- 361 script_class = script_registry[script_name]
- 362 if not timeout:
- 363 timeout = script_class.TIMEOUT
- 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
- 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
- 366 access_profile.address, timeout))
- 367 with self.script_lock:
- 368 self.script_threads[script] = callback
- 369 logging.info("%d script threads (%d max)" % (
- 370 len(self.script_threads), self.max_script_threads))
- Variables:
- profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e14d0>
- pv = u'Cisco'
- access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d92f0>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_mac_address_table.Script'>
- self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
- pos = u'IOS'
- script_name = u'Cisco.IOS.get_mac_address_table'
- callback = <function script_callback at 0x226f398>
- object_name = u'RUMSKNARES001'
- sn = u'get_mac_address_table'
- timeout = 1200
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/service.py (Line: 91)
- Function: script
- 84 return
- 85 # Deserialize additional arguments
- 86 kwargs = {}
- 87 for a in request.kwargs:
- 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
- 89 self.activator.run_script(request.object_name, request.script,
- 90 request.access_profile, script_callback, request.timeout,
- 91 ==> **kwargs)
- 92
- 93 def ping_check(self, controller, request, done):
- 94 """
- 95 Start ping check of addresses
- 96 """
- 97 def ping_check_callback(status):
- Variables:
- profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_mac_address_table.Script'>
- script_callback = <function script_callback at 0x226f398>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- controller = <noc.sa.rpc.Controller object at 0x28e1790>
- done =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- kwargs = {}
- self = <noc.sa.activator.service.Service object at 0x19f72d0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
- Function: _CallMethod
- 164 request: Request protocol message.
- 165 callback: A callback to invoke after the method has completed.
- 166 """
- 167 if method_descriptor.containing_service != self.descriptor:
- 168 raise RuntimeError(
- 169 'CallMethod() given method descriptor for wrong service type.')
- 170 method = getattr(srvc, method_descriptor.name)
- 171 ==> return method(rpc_controller, request, callback)
- 172
- 173 def _GetRequestClass(self, method_descriptor):
- 174 """Returns the class of the request protocol message.
- 175
- 176 Args:
- 177 method_descriptor: Descriptor of the method for which to return the
- Variables:
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1790>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- method =
- <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
- Function: _WrapCallMethod
- 139
- 140 # CallMethod needs to operate with an instance of the Service class. This
- 141 # internal wrapper function exists only to be able to pass the service
- 142 # instance to the method that does the real CallMethod work.
- 143 def _WrapCallMethod(srvc, method_descriptor,
- 144 rpc_controller, request, callback):
- 145 return self._CallMethod(srvc, method_descriptor,
- 146 ==> rpc_controller, request, callback)
- 147 self.cls = cls
- 148 cls.CallMethod = _WrapCallMethod
- 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
- 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
- 151 cls.GetRequestClass = self._GetRequestClass
- 152 cls.GetResponseClass = self._GetResponseClass
- Variables:
- rpc_controller = <noc.sa.rpc.Controller object at 0x28e1790>
- method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
- request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
- callback =
- <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/rpc.py (Line: 423)
- Function: rpc_handle_request
- 416 req.ParseFromString(request.serialized_request)
- 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
- 418 controller = Controller(self)
- 419 controller.transaction = self.transactions.begin(id=id,
- 420 method=request.method)
- 421 try:
- 422 self.service.CallMethod(method, controller,
- 423 ==> req, self.send_response)
- 424 except:
- 425 self.send_error(id, ERR_INTERNAL,
- 426 "RPC Call to %s failed" % request.method)
- 427 error_report()
- 428 else:
- 429 self.send_error(id, ERR_INVALID_METHOD,
- Variables:
- self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
- req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
- request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
- id = 1243333650
- controller = <noc.sa.rpc.Controller object at 0x28e1790>
- method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement