Guest User

Untitled

a guest
Feb 25th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.64 KB | None | 0 0
  1.  
  2. 2014-02-25 20:49:29,762 [inv.discovery] Running scheduler
  3. 2014-02-25 20:49:29,762 [inv.discovery] Running initial submit for rep_discovery
  4. 2014-02-25 20:49:29,773 [inv.discovery] Running initial submit for mac_discovery
  5. 2014-02-25 20:49:29,789 [inv.discovery] Running initial submit for config_discovery
  6. 2014-02-25 20:49:29,796 [inv.discovery] Running initial submit for version_inventory
  7. 2014-02-25 20:49:29,803 [inv.discovery] Running initial submit for oam_discovery
  8. 2014-02-25 20:49:29,808 [inv.discovery] Running initial submit for lldp_discovery
  9. 2014-02-25 20:49:29,814 [inv.discovery] Running initial submit for asset_discovery
  10. 2014-02-25 20:49:29,820 [inv.discovery] Running initial submit for ip_discovery
  11. 2014-02-25 20:49:29,826 [inv.discovery] Running initial submit for interface_discovery
  12. 2014-02-25 20:49:29,832 [inv.discovery] Running initial submit for id_discovery
  13. 2014-02-25 20:49:29,839 [inv.discovery] Running initial submit for stp_discovery
  14. 2014-02-25 20:49:29,844 [inv.discovery] Running initial submit for udld_discovery
  15. 2014-02-25 20:49:29,850 [inv.discovery] Running initial submit for vlan_discovery
  16. 2014-02-25 20:49:29,858 [inv.discovery] Running initial submit for bfd_discovery
  17. 2014-02-25 20:49:29,864 [inv.discovery] Running initial submit for cdp_discovery
  18. 2014-02-25 20:49:29,879 [inv.discovery] Running job rep_discovery(dgs.sw.pu.ru)
  19. 2014-02-25 20:49:29,909 [inv.discovery] Running job cdp_discovery(SAE)
  20. 2014-02-25 20:49:29,948 [inv.discovery] Running job mac_discovery(math10g.sw.pu.ru)
  21. 2014-02-25 20:49:29,971 [inv.discovery] Running job performance_report(performance_report)
  22. 2014-02-25 20:49:29,971 [inv.discovery] CPU(U/S): 0.744046/0.148009 MEM(RSS): 67536
  23. 2014-02-25 20:49:29,971 [inv.discovery] RUNNING GROUPS: discovery-7: 1, discovery-3: 1, discovery-1: 1
  24. 2014-02-25 20:49:29,971 [inv.discovery] Job performance_report(performance_report) is completed successfully (0.000257sec)
  25. 2014-02-25 20:49:29,977 UNHANDLED EXCEPTION (2014-02-25 20:49:29.971875)
  26. Working directory: /opt/noc
  27. <type 'exceptions.OSError'>
  28. [Errno 13] Permission denied: '/tmp/jobs/performance_report'
  29. START OF TRACEBACK
  30. ------------------------------------------------------------------------
  31. File: /opt/noc/lib/python2.7/os.py (Line: 157)
  32. Function: makedirs
  33. 150 makedirs(head, mode)
  34. 151 except OSError, e:
  35. 152 # be happy if someone already created the path
  36. 153 if e.errno != errno.EEXIST:
  37. 154 raise
  38. 155 if tail == curdir: # xxx/newdir/. exists if xxx/newdir exists
  39. 156 return
  40. 157 ==> mkdir(name, mode)
  41. 158
  42. 159 def removedirs(name):
  43. 160 """removedirs(path)
  44. 161
  45. 162 Super-rmdir; remove a leaf directory and all empty intermediate
  46. 163 ones. Works like rmdir except that, if the leaf directory is
  47. Variables:
  48. tail = 'performance_report'
  49. head = '/tmp/jobs'
  50. name = '/tmp/jobs/performance_report'
  51. mode = 511
  52. ------------------------------------------------------------------------
  53. File: /opt/noc/lib/fileutils.py (Line: 39)
  54. Function: safe_rewrite
  55. 32 """
  56. 33 Create new file filled with "text" safely
  57. 34 """
  58. 35 if isinstance(text, unicode):
  59. 36 text = text.encode("utf-8")
  60. 37 d = os.path.dirname(path)
  61. 38 if d and not os.path.exists(d):
  62. 39 ==> os.makedirs(d)
  63. 40 b = os.path.basename(path)
  64. 41 h, p = tempfile.mkstemp(suffix=".tmp", prefix=b, dir=d)
  65. 42 f = os.fdopen(h, "w")
  66. 43 f.write(text)
  67. 44 f.close()
  68. 45 if os.path.exists(path):
  69. Variables:
  70. text = ''
  71. path = '/tmp/jobs/performance_report/performance_report'
  72. d = '/tmp/jobs/performance_report'
  73. mode = None
  74. ------------------------------------------------------------------------
  75. File: /opt/noc/lib/scheduler/scheduler.py (Line: 307)
  76. Function: _complete_job
  77. 300 job.on_failure()
  78. 301 s = job.S_FAILED
  79. 302 self._complete_job(job, s, tb)
  80. 303
  81. 304 def _complete_job(self, job, status, tb):
  82. 305 if self.to_log_jobs:
  83. 306 path = os.path.join(self.log_jobs, job.name, str(job.key))
  84. 307 ==> safe_rewrite(path, job.get_job_log())
  85. 308 group = job.get_group()
  86. 309 if group is not None:
  87. 310 with self.running_lock:
  88. 311 self.running_count[group] -= 1
  89. 312 if not self.running_count[group]:
  90. 313 del self.running_count[group]
  91. Variables:
  92. status = 'S'
  93. path = '/tmp/jobs/performance_report/performance_report'
  94. job =
  95. <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
  96. tb = None
  97. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  98. ------------------------------------------------------------------------
  99. File: /opt/noc/lib/scheduler/scheduler.py (Line: 302)
  100. Function: _job_wrapper
  101. 295 else:
  102. 296 self.info("Job %s(%s) is failed (%fsec)" % (
  103. 297 job.name, job.get_display_key(),
  104. 298 time.time() - t0
  105. 299 ))
  106. 300 job.on_failure()
  107. 301 s = job.S_FAILED
  108. 302 ==> self._complete_job(job, s, tb)
  109. 303
  110. 304 def _complete_job(self, job, status, tb):
  111. 305 if self.to_log_jobs:
  112. 306 path = os.path.join(self.log_jobs, job.name, str(job.key))
  113. 307 safe_rewrite(path, job.get_job_log())
  114. 308 group = job.get_group()
  115. Variables:
  116. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  117. job =
  118. <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
  119. t0 = 1393346969.971403
  120. s = 'S'
  121. r = True
  122. kwargs = {}
  123. tb = None
  124. ------------------------------------------------------------------------
  125. File: /opt/noc/lib/scheduler/scheduler.py (Line: 274)
  126. Function: _run_job_handler
  127. 267 if job.threaded:
  128. 268 t = threading.Thread(target=self._job_wrapper,
  129. 269 args=(job,), kwargs=kwargs
  130. 270 )
  131. 271 t.daemon = True
  132. 272 t.start()
  133. 273 else:
  134. 274 ==> return self._job_wrapper(job, **kwargs)
  135. 275
  136. 276 def _job_wrapper(self, job, **kwargs):
  137. 277 tb = None
  138. 278 t0 = time.time()
  139. 279 try:
  140. 280 r = job.handler(**kwargs)
  141. Variables:
  142. job =
  143. <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
  144. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  145. kwargs = {}
  146. ------------------------------------------------------------------------
  147. File: /opt/noc/lib/scheduler/scheduler.py (Line: 264)
  148. Function: run_job
  149. 257 t = ReduceTask.create_task(
  150. 258 job.get_managed_object(), # Managed object is in key
  151. 259 None, {},
  152. 260 job.map_task, job.get_map_task_params()
  153. 261 )
  154. 262 self.active_mrt[t] = job
  155. 263 else:
  156. 264 ==> self._run_job_handler(job)
  157. 265
  158. 266 def _run_job_handler(self, job, **kwargs):
  159. 267 if job.threaded:
  160. 268 t = threading.Thread(target=self._job_wrapper,
  161. 269 args=(job,), kwargs=kwargs
  162. 270 )
  163. Variables:
  164. s = ''
  165. job =
  166. <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
  167. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  168. ------------------------------------------------------------------------
  169. File: /opt/noc/lib/scheduler/scheduler.py (Line: 438)
  170. Function: run_pending
  171. 431 continue
  172. 432 # Check for group limits
  173. 433 group = job.get_group()
  174. 434 if self.can_run(job):
  175. 435 if group is not None:
  176. 436 with self.running_lock:
  177. 437 self.running_count[group] += 1
  178. 438 ==> self.run_job(job)
  179. 439 n += 1
  180. 440 return n
  181. 441
  182. 442 def run(self):
  183. 443 if self.reset_running:
  184. 444 # Change running to waiting
  185. Variables:
  186. qs = <pymongo.cursor.Cursor object at 0x51d6c90>
  187. group = None
  188. jcls = <class 'noc.inv.discovery.jobs.performance_report.PerformanceReportJob'>
  189. keys = [1, 2, 3, 4, 5, 6, 7]
  190. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  191. job_data =
  192. {u'_id': ObjectId('5308f3c3b06de20bc2452bd6'),
  193. u'data': {},
  194. u'f': 0,
  195. u'jcls': u'performance_report',
  196. u'key': u'performance_report',
  197. u'last': datetime.datetime(2014, 2, 25, 20, 49, 26, 962000),
  198. u'ldur': 0.00046896934509277344,
  199. u'log': [],
  200. u'ls': u'S',
  201. u'runs': 4052,
  202. u's': u'W',
  203. u'schedule': {u'failed_interval': 60,
  204. u'interval': 60,
  205. u'offset': 0,
  206. u'randomize': False},
  207. u'tb': None,
  208. u'ts': datetime.datetime(2014, 2, 25, 20, 47)}
  209. t0 = 1393346969.863487
  210. n = 3
  211. q =
  212. {'s': 'W', 'ts': {'$lte': datetime.datetime(2014, 2, 25, 20, 49, 29, 868984)}}
  213. job =
  214. <noc.inv.discovery.jobs.performance_report.PerformanceReportJob object at 0x5282250>
  215. x = {u'_id': ObjectId('530b2b3cb06de213da6bb47f'), u'key': 7}
  216. ------------------------------------------------------------------------
  217. File: /opt/noc/lib/scheduler/scheduler.py (Line: 454)
  218. Function: run
  219. 447 self.ATTR_STATUS: self.S_RUN
  220. 448 }, {
  221. 449 "$set": {self.ATTR_STATUS: self.S_WAIT}
  222. 450 }, multi=True, safe=True)
  223. 451 self.ensure_indexes()
  224. 452 self.info("Running scheduler")
  225. 453 while True:
  226. 454 ==> if not self.run_pending():
  227. 455 time.sleep(1)
  228. 456 else:
  229. 457 self.cleanup()
  230. 458
  231. 459 def get_faults(self, job_name, key=None):
  232. 460 """
  233. Variables:
  234. self = <noc.inv.discovery.scheduler.DiscoveryScheduler object at 0x491aed0>
  235. ------------------------------------------------------------------------
  236. File: /opt/noc/inv/discovery/daemon.py (Line: 36)
  237. Function: run
  238. 29
  239. 30 def run(self):
  240. 31 try:
  241. 32 PerformanceReportJob.submit(self.scheduler,
  242. 33 key="performance_report", interval=60)
  243. 34 except self.scheduler.JobExists:
  244. 35 pass
  245. 36 ==> self.scheduler.run()
  246. 37
  247. 38 def load_config(self):
  248. 39 super(DiscoveryDaemon, self).load_config()
  249. 40 self.load_beef_map()
  250. 41 log_jobs = self.config.get("main", "log_jobs") or None
  251. 42 self.scheduler.set_job_log(log_jobs)
  252. Variables:
  253. self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x7f21cef62910>
  254. ------------------------------------------------------------------------
  255. File: /opt/noc/lib/daemon.py (Line: 364)
  256. Function: guarded_run
  257. 357
  258. 358 def guarded_run(self):
  259. 359 """
  260. 360 Run daemon and catch common exceptions
  261. 361 :return:
  262. 362 """
  263. 363 try:
  264. 364 ==> self.run()
  265. 365 except KeyboardInterrupt:
  266. 366 pass
  267. 367 except MemoryError:
  268. 368 logging.error("Out of memory. Exiting.")
  269. 369 except SystemExit:
  270. 370 logging.info("Exiting")
  271. Variables:
  272. self = <noc.inv.discovery.daemon.DiscoveryDaemon object at 0x7f21cef62910>
  273. ------------------------------------------------------------------------
  274. END OF TRACEBACK
  275. 2014-02-25 20:49:29,995 Removing pidfile: /srv/noc/run/noc-discovery.pid
  276. 2014-02-25 20:49:29,995 STOP
Advertisement
Add Comment
Please, Sign In to add comment