Merge lp:~matthew-hart/lava-lab/dt-munin-script into lp:lava-lab

Proposed by Matthew Hart on 2013-09-11
Status: Merged
Approved by: Matthew Hart on 2013-09-11
Approved revision: 308
Merged at revision: 308
Proposed branch: lp:~matthew-hart/lava-lab/dt-munin-script
Merge into: lp:lava-lab
Diff against target: 47 lines (+35/-0)
2 files modified
lava/munin/init.sls (+5/-0)
lava/munin/lava_queue_per_devicetype (+30/-0)
To merge this branch: bzr merge lp:~matthew-hart/lava-lab/dt-munin-script
Reviewer Review Type Date Requested Status
Matthew Hart Approve on 2013-09-11
Review via email: mp+185008@code.launchpad.net

Description of the change

Add munin script for pending jobs per device-type

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava/munin/init.sls'
2--- lava/munin/init.sls 2013-03-20 02:26:09 +0000
3+++ lava/munin/init.sls 2013-09-11 10:19:46 +0000
4@@ -11,3 +11,8 @@
5 file.managed:
6 - source: salt://lava/munin/lava_queue
7 - mode: 755
8+
9+/etc/munin/plugins/lava_queue_per_devicetype:
10+ file.managed:
11+ - source: salt://lava/munin/lava_queue_per_devicetype
12+ - mode: 755
13
14=== added file 'lava/munin/lava_queue_per_devicetype'
15--- lava/munin/lava_queue_per_devicetype 1970-01-01 00:00:00 +0000
16+++ lava/munin/lava_queue_per_devicetype 2013-09-11 10:19:46 +0000
17@@ -0,0 +1,30 @@
18+#!/usr/bin/python2.7
19+
20+import xmlrpclib
21+from sys import argv
22+
23+server = xmlrpclib.ServerProxy("http://validation.linaro.org/RPC2")
24+types = server.scheduler.all_device_types()
25+pending = server.scheduler.pending_jobs_by_device_type()
26+
27+
28+if len(argv) > 1:
29+ if argv[1] == "autoconf":
30+ print("yes")
31+ exit(0)
32+
33+ if argv[1] == "config":
34+ print("graph_title LAVA pending per device-type")
35+ print("graph_args --base 1000 -l 0")
36+ print("graph_scale no")
37+ print("graph_vlabel Number of pending jobs")
38+ print("graph_category LAVA")
39+ for dt in types:
40+ print("lava_queue_%s.label lava_queue_%s" % (dt['name'],dt['name']))
41+ print("lava_queue_%s.draw AREA" % (dt['name']))
42+ print("lava_queue_%s.warning 10" % (dt['name']))
43+ print("lava_queue_%s.critical 20" % (dt['name']))
44+ exit(0)
45+
46+for dt in types:
47+ print("lava_queue_%s.value %s" % (dt['name'],pending[dt['name']]))

Subscribers

People subscribed via source and target branches