One thing I like with Request Tracker is that it relies on a
RDBMS. So, anything which is not done by RT can be easily implemented
in SQL. (See the recurrent thread abou reporting.)
Today, a small Python program to gather statistics from the RT
database and to output them in MRTG format. That way, the managers
can spend the whole day watching the work of the support staff
It uses PostgreSQL but the SQL is standard and it should work with
MySQL.
#!/usr/bin/python
$Id: rt2mrtg.py,v 1.1 2002/04/29 10:59:46 bortzmeyer Exp $
import string
from pyPgSQL import PgSQL
dsn = â::rt2â
db = PgSQL.connect(dsn)
st = db.cursor()
st.execute(âSELECT count(id) FROM tickets WHERE status = âopenâ OR status = ânewââ)
res = st.fetchone()
all_tickets = res[0]
If you are not using priorities, display something else, such as
tickets older than a month.
st.execute(âSELECT count(id) FROM tickets WHERE (status = âopenâ OR status = ânewâ) AND priority > 0â)
res = st.fetchone()
high_pri_tickets = res[0]
print high_pri_tickets
print all_tickets
print âuptime is not meaningful for Request Trackerâ
print "database " + dsn
MRTG configuration:
Target[rt]: python ./rt2mrtg.py
MaxBytes[rt]: 10000000
Title[rt]: Tickets open in Request Tracker
Colours[rt]: orange#ff2222,blue#1111ff,DARK GREEN#006600,VIOLET#ff00ff
Options[rt]: growright,nopercent,gauge,noinfo
YLegend[rt]: Tickets
ShortLegend[rt]: tickets
LegendO[rt]: allÂ
LegendI[rt]: high priÂ
Legend1[rt]: Tickets open (with priority>0)
Legend2[rt]: Tickets open
PageTop[rt]:
To do
We do sorta the same thing. But I wrote an snmp daemon for RT, and using
that, we just have MRTG poll the SNMP MIBs that I defined. Works great
for us.
a message of 3 lines which said:
We do sorta the same thing. But I wrote an snmp daemon for RT, and using
that, we just have MRTG poll the SNMP MIBs that I defined. Works great
for us.
Yes, I saw your work in, contrib/. Letâs say that your solution is
better if you have SNMP/MIB knowledge inside (the current MIB does not
provide a lot of objects so you have to extend it if you just want,
say, the tickets with a priority>0 ) and mine is preferrable if you
have SQL knowledge in your company.
|+ Yes, I saw your work in, contrib/. Letâs say that your solution is
|+ better if you have SNMP/MIB knowledge inside (the current MIB does not
|+ provide a lot of objects so you have to extend it if you just want,
|+ say, the tickets with a priority>0 ) and mine is preferrable if you
|+ have SQL knowledge in your company.
True. I wrote the MIB with room for people to expand it themselves. I
could have gone through and added a lot more MIBs for general use, but I
didnât know who would want what. We currently have about 20 different
MIBs defined in ours, but other companies may only need 2 of those
I guess I could write documentation on how to add other mibs to it.
-darrin (who is playing with your script on my testing server)
Just curious, whatâs MRTG?
James.-----Original Message-----
From: Darrin Walton [mailto:darrinw@nixc.net]
Sent: Monday, April 29, 2002 6:51 AM
To: Stephane Bortzmeyer
Cc: rt-users@lists.fsck.com
Subject: Re: [rt-users] A MRTG script for Request Tracker
|+ Yes, I saw your work in, contrib/. Letâs say that your solution is
|+ better if you have SNMP/MIB knowledge inside (the current MIB does not
|+ provide a lot of objects so you have to extend it if you just want,
|+ say, the tickets with a priority>0 ) and mine is preferrable if you
|+ have SQL knowledge in your company.
True. I wrote the MIB with room for people to expand it themselves. I
could have gone through and added a lot more MIBs for general use, but I
didnât know who would want what. We currently have about 20 different MIBs
defined in ours, but other companies may only need 2 of those
I guess I could write documentation on how to add other mibs to it.
-darrin (who is playing with your script on my testing server)
rt-users mailing list
rt-users@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-users
Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
a message of 33 lines which said:
Just curious, whatâs MRTG?
http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html
Looks spiffy, but I fail to see how this is generating useful reports from
rt2. Any chance of seeing a screenshot of the output you guys are getting
from what youâve written?
James.From: Stephane Bortzmeyer [mailto:bortzmeyer@netaktiv.com]
Sent: Monday, April 29, 2002 8:35 AM
To: James Satterfield
Cc: âDarrin Waltonâ; Stephane Bortzmeyer; rt-users@lists.fsck.com
Subject: Re: [rt-users] A MRTG script for Request Tracker
a message of 33 lines which said:
Just curious, whatâs MRTG?
http://people.ee.ethz.ch/~oetiker/webtools/mrtg/mrtg.html
James Satterfield JSatterfield@ciphergen.com �crit :
Just curious, whatâs MRTG?
Multi router traffic grapher
URL:http://people.ee.ethz.ch/~oetiker/webtools/mrtg/, you canât
live without it.
Marc Baudoin | Institut Pasteur
babafou@pasteur.fr | P�le informatique - syst�mes et r�seau
|+ Looks spiffy, but I fail to see how this is generating useful reports from
|+ rt2. Any chance of seeing a screenshot of the output you guys are getting
|+ from what youâve written?
its basically jsut doing wht MRTG does for bandwidth utilization on router
links (such as we use here).
It just shows a graph of open tickets, closed tickets, new tickets, etc
and takes stats at 5 minutes intervals.
a message of 17 lines which said:
Multi router traffic grapher
URL:http://people.ee.ethz.ch/~oetiker/webtools/mrtg/, you canât
live without it.
Some people rather live with Cricket
http://cricket.sourceforge.net/