Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

setup was unable to find the baseline data visual studio 2005, wwwxxx., xxxconhd, wwwxxx 0cm, wwwwxxxx cal pack all, file_get_contents php memory, mail, www. xxx. con, Yahoomail wwwxxx, wwwxxx.md2



#1: mrtg xact/sec plugin

Posted on 2006-07-28 18:21:42 by Jeff Frost

So I wrote a quick and dirt mrtg plugin that graphs xacts/sec and I'm
wondering if it would be worthwhile to submit it as a contrib project (or
maybe I should submit to mrtg)? If so, where do I submit it?

Here it is for anyone who would find it useful and/or has ideas on how to
make it better:


XACT=`$PSQL --tuples-only -c 'select sum(xact_commit) + sum(xact_rollback) as
transactions from pg_stat_database;' -h $PGSERVER -U $PGUSER $ADMINDB`

echo $XACT
echo 0
echo `su -c "ssh $PGSERVER uptime" postgres`

and here's the readme:

This mrtg plugin queries the committed and rolledback transactions from
the DB and outputs it in a format that MRTG can graph.

You'll likely want to change these variables.


Also, you'll note this line which just grabs the uptime of the
db server:

echo `su -c "ssh $PGSERVER uptime" postgres`

it requires that the postgres user be able to ssh to the server with
no password (i.e. using key based authentication).

If you don't care about that or don't feel comfortable allowing your
postgres user to ssh into your DB server with no password, you might
want to just set that to:


Here's an example mrtg config excerpt:

Target[db1-xacts]: `/usr/local/bin/ db1`
MaxBytes[db1-xacts]: 1250000
Title[db1-xacts]: db1 Database transactions per second
PageTop[db1-xacts]: <H1>Database transactions per
YLegend[db1]: xacts per second
ShortLegend[db1]: tps
Legend1[db1]: Transactions per second
LegendI[db1]: :
Options[db1]: nopercent

Jeff Frost, Owner <>
Frost Consulting, LLC
Phone: 650-780-7908 FAX: 650-649-1954

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

Report this message