Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2014-02-25 20:49:29,762 [inv.discovery] Running scheduler
- 2014-02-25 20:49:29,762 [inv.discovery] Running initial submit for rep_discovery
- 2014-02-25 20:49:29,773 [inv.discovery] Running initial submit for mac_discovery
- 2014-02-25 20:49:29,789 [inv.discovery] Running initial submit for config_discovery
- 2014-02-25 20:49:29,796 [inv.discovery] Running initial submit for version_inventory
- 2014-02-25 20:49:29,803 [inv.discovery] Running initial submit for oam_discovery
- 2014-02-25 20:49:29,808 [inv.discovery] Running initial submit for lldp_discovery
- 2014-02-25 20:49:29,814 [inv.discovery] Running initial submit for asset_discovery
- 2014-02-25 20:49:29,820 [inv.discovery] Running initial submit for ip_discovery
- 2014-02-25 20:49:29,826 [inv.discovery] Running initial submit for interface_discovery
- 2014-02-25 20:49:29,832 [inv.discovery] Running initial submit for id_discovery
- 2014-02-25 20:49:29,839 [inv.discovery] Running initial submit for stp_discovery
- 2014-02-25 20:49:29,844 [inv.discovery] Running initial submit for udld_discovery
- 2014-02-25 20:49:29,850 [inv.discovery] Running initial submit for vlan_discovery
- 2014-02-25 20:49:29,858 [inv.discovery] Running initial submit for bfd_discovery
- 2014-02-25 20:49:29,864 [inv.discovery] Running initial submit for cdp_discovery
- 2014-02-25 20:49:29,879 [inv.discovery] Running job rep_discovery(dgs.sw.pu.ru)
- 2014-02-25 20:49:29,909 [inv.discovery] Running job cdp_discovery(SAE)
- 2014-02-25 20:49:29,948 [inv.discovery] Running job mac_discovery(math10g.sw.pu.ru)
- 2014-02-25 20:49:29,971 [inv.discovery] Running job performance_report(performance_report)
- 2014-02-25 20:49:29,971 [inv.discovery] CPU(U/S): 0.744046/0.148009 MEM(RSS): 67536
- 2014-02-25 20:49:29,971 [inv.discovery] RUNNING GROUPS: discovery-7: 1, discovery-3: 1, discovery-1: 1
- 2014-02-25 20:49:29,971 [inv.discovery] Job performance_report(performance_report) is completed successfully (0.000257sec)
- 2014-02-25 20:49:29,977 UNHANDLED EXCEPTION (2014-02-25 20:49:29.971875)
- Working directory: /opt/noc
- <type 'exceptions.OSError'>
- [Errno 13] Permission denied: '/tmp/jobs/performance_report'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/lib/python2.7/os.py (Line: 157)
- Function: makedirs
- 150 makedirs(head, mode)
- 151 except OSError, e:
- 152 # be happy if someone already created the path
- 153 if e.errno != errno.EEXIST:
- 154 raise
- 155 if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
- 156 return
- 157 ==> mkdir(name, mode)
- 158
- 159 def removedirs(name):
- 160 """removedirs(path)
- 161
- 162 Super-rmdir; remove a leaf directory and all empty intermediate
- 163 ones. Works like rmdir except that, if the leaf directory is
- Variables:
- tail = 'performance_report'
- head = '/tmp/jobs'
- name = '/tmp/jobs/performance_report'
- mode = 511
- ------------------------------------------------------------------------
- File: /opt/noc/lib/fileutils.py (Line: 39)
- Function: safe_rewrite
- 32 """
- 33 Create new file filled with "text" safely
- 34 """
- 35 if isinstance(text, unicode):
- 36 text = text.encode("utf-8")
- 37 d = os.path.dirname(path)
- 38 if d and not os.path.exists(d):
- 39 ==> os.makedirs(d)
- 40 b = os.path.basename(path)
- 41 h, p = tempfile.mkstemp(suffix=".tmp", prefix=b, dir=d)
- 42 f = os.fdopen(h, "w")
- 43 f.write(text)
- 44 f.close()
- 45 if os.path.exists(path):
- Variables:
- text = ''
- path = '/tmp/jobs/performance_report/performance_report'
- d = '/tmp/jobs/performance_report'
- mode = None
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 307)
- Function: _complete_job
- 300 job.on_failure()
- 301 s = job.S_FAILED
- 302 self._complete_job(job, s, tb)
- 303
- 304 def _complete_job(self, job, status, tb):
- 305 if self.to_log_jobs:
- 306 path = os.path.join(self.log_jobs, job.name, str(job.key))
- 307 ==> safe_rewrite(path, job.get_job_log())
- 308 group = job.get_group()
- 309 if group is not None:
- 310 with self.running_lock:
- 311 self.running_count[group] -= 1
- 312 if not self.running_count[group]:
- 313 del self.running_count[group]
- Variables:
- status = 'S'
- path = '/tmp/jobs/performance_report/performance_report'
- job =
- <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
- tb = None
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 302)
- Function: _job_wrapper
- 295 else:
- 296 self.info("Job %s(%s) is failed (%fsec)" % (
- 297 job.name, job.get_display_key(),
- 298 time.time() - t0
- 299 ))
- 300 job.on_failure()
- 301 s = job.S_FAILED
- 302 ==> self._complete_job(job, s, tb)
- 303
- 304 def _complete_job(self, job, status, tb):
- 305 if self.to_log_jobs:
- 306 path = os.path.join(self.log_jobs, job.name, str(job.key))
- 307 safe_rewrite(path, job.get_job_log())
- 308 group = job.get_group()
- Variables:
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- job =
- <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
- t0 = 1393346969.971403
- s = 'S'
- r = True
- kwargs = {}
- tb = None
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 274)
- Function: _run_job_handler
- 267 if job.threaded:
- 268 t = threading.Thread(target=self._job_wrapper,
- 269 args=(job,), kwargs=kwargs
- 270 )
- 271 t.daemon = True
- 272 t.start()
- 273 else:
- 274 ==> return self._job_wrapper(job, **kwargs)
- 275
- 276 def _job_wrapper(self, job, **kwargs):
- 277 tb = None
- 278 t0 = time.time()
- 279 try:
- 280 r = job.handler(**kwargs)
- Variables:
- job =
- <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- kwargs = {}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 264)
- Function: run_job
- 257 t = ReduceTask.create_task(
- 258 job.get_managed_object(), # Managed object is in key
- 259 None, {},
- 260 job.map_task, job.get_map_task_params()
- 261 )
- 262 self.active_mrt[t] = job
- 263 else:
- 264 ==> self._run_job_handler(job)
- 265
- 266 def _run_job_handler(self, job, **kwargs):
- 267 if job.threaded:
- 268 t = threading.Thread(target=self._job_wrapper,
- 269 args=(job,), kwargs=kwargs
- 270 )
- Variables:
- s = ''
- job =
- <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 438)
- Function: run_pending
- 431 continue
- 432 # Check for group limits
- 433 group = job.get_group()
- 434 if self.can_run(job):
- 435 if group is not None:
- 436 with self.running_lock:
- 437 self.running_count[group] += 1
- 438 ==> self.run_job(job)
- 439 n += 1
- 440 return n
- 441
- 442 def run(self):
- 443 if self.reset_running:
- 444 # Change running to waiting
- Variables:
- qs = <pymongo.cursor.Cursor object at 0x51d6c90>
- group = None
- jcls = <class 'noc.inv.discovery.jobs.performance_report.PerformanceReportJob'>
- keys = [1, 2, 3, 4, 5, 6, 7]
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- job_data =
- {u'_id': ObjectId('5308f3c3b06de20bc2452bd6'),
- u'data': {},
- u'f': 0,
- u'jcls': u'performance_report',
- u'key': u'performance_report',
- u'last': datetime.datetime(2014, 2, 25, 20, 49, 26, 962000),
- u'ldur': 0.00046896934509277344,
- u'log': [],
- u'ls': u'S',
- u'runs': 4052,
- u's': u'W',
- u'schedule': {u'failed_interval': 60,
- u'interval': 60,
- u'offset': 0,
- u'randomize': False},
- u'tb': None,
- u'ts': datetime.datetime(2014, 2, 25, 20, 47)}
- t0 = 1393346969.863487
- n = 3
- q =
- {'s': 'W', 'ts': {'$lte': datetime.datetime(2014, 2, 25, 20, 49, 29, 868984)}}
- job =
- <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
- x = {u'_id': ObjectId('530b2b3cb06de213da6bb47f'), u'key': 7}
- ------------------------------------------------------------------------
- File: /opt/noc/lib/scheduler/scheduler.py (Line: 454)
- Function: run
- 447 self.ATTR_STATUS: self.S_RUN
- 448 }, {
- 449 "$set": {self.ATTR_STATUS: self.S_WAIT}
- 450 }, multi=True, safe=True)
- 451 self.ensure_indexes()
- 452 self.info("Running scheduler")
- 453 while True:
- 454 ==> if not self.run_pending():
- 455 time.sleep(1)
- 456 else:
- 457 self.cleanup()
- 458
- 459 def get_faults(self, job_name, key=None):
- 460 """
- Variables:
- self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
- ------------------------------------------------------------------------
- File: /opt/noc/inv/discovery/daemon.py (Line: 36)
- Function: run
- 29
- 30 def run(self):
- 31 try:
- 32 PerformanceReportJob.submit(self.scheduler,
- 33 key="performance_report", interval=60)
- 34 except self.scheduler.JobExists:
- 35 pass
- 36 ==> self.scheduler.run()
- 37
- 38 def load_config(self):
- 39 super(DiscoveryDaemon, self).load_config()
- 40 self.load_beef_map()
- 41 log_jobs = self.config.get("main", "log_jobs") or None
- 42 self.scheduler.set_job_log(log_jobs)
- Variables:
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x7f21cef62910>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/daemon.py (Line: 364)
- Function: guarded_run
- 357
- 358 def guarded_run(self):
- 359 """
- 360 Run daemon and catch common exceptions
- 361 :return:
- 362 """
- 363 try:
- 364 ==> self.run()
- 365 except KeyboardInterrupt:
- 366 pass
- 367 except MemoryError:
- 368 logging.error("Out of memory. Exiting.")
- 369 except SystemExit:
- 370 logging.info("Exiting")
- Variables:
- self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x7f21cef62910>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-02-25 20:49:29,995 Removing pidfile: /srv/noc/run/noc-discovery.pid
- 2014-02-25 20:49:29,995 STOP
Advertisement
Add Comment
Please, Sign In to add comment