Skip to content
This repository has been archived by the owner on Nov 25, 2017. It is now read-only.

Commit

Permalink
First cut at trac_tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobian committed Feb 29, 2008
1 parent 74a4f1e commit 959314b
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions trac_tickets
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/python

import sys
import munin

class TracTickets(munin.Plugin):

def _connect(self):
# Both of the below won't work if PYTHONPATH and TRAC_ENV aren't
# set in the munin-node plugin conf.
from trac.env import Environment
return Environment()

def fetch(self):
return [
('unreviewed.value', 10),
('accepted.value', 10),
('decision.value', 10),
('someday.value', 10),
('closed.value', 10),
]

def config(self):
return [
('graph_title', 'Trac tickets'),
('graph_args', '-l 0 --base 1000'),
('graph_vlabel', 'Tickets'),
('graph_scale', 'no'),
('graph_category', 'Trac'),
('graph_info', 'Shows current Trac ticket counts'),
('unreviewed.label', 'unreviewed'),
('unreviewed.info', 'Unreviewed'),
('unreviewed.type', 'GAUGE'),
('accepted.label', 'accepted'),
('accepted.info', 'Accepted'),
('accepted.type', 'GAUGE'),
('decision.label', 'decision'),
('decision.info', 'Design decision needed'),
('decision.type', 'GAUGE'),
('someday.label', 'someday'),
('someday.info', 'Someday/Maybe'),
('someday.type', 'GAUGE'),
('closed.label', 'closed'),
('closed.info', 'Closed'),
('closed.type', 'GAUGE'),
]

def autoconf(self):
try:
self._connect()
except:
return False
return True

if __name__ == '__main__':
munin.run(TracTickets)

0 comments on commit 959314b

Please sign in to comment.