Target  --default--
	directory-desc	= "PostgreSQL"
	rrd-datafile	= %dataDir%/%auto-target-name%.rrd
	target-type	= pg_conn

	# change the next 4 lines for your configuration
	initial_db	= template1
	pg_user		= postgres
	pg_pass		= secret
	parse-script	=	"/home/cricket/bin/get_pgsql_conn_info.pl %auto-target-name% %initial_db% %pg_user% %pg_pass%"

datasource total_conn
	ds-source = "exec:0:%parse-script%"
        desc            =       "Connections"
        rrd-ds-type     =       GAUGE

datasource pct_conn_used
	ds-source = "exec:1:%parse-script%"
        desc            =       "% Connections Used"
        rrd-ds-type     =       GAUGE

datasource nonidle_conn
	ds-source = "exec:2:%parse-script%"
        desc            =       "Non Idle Conns"
        rrd-ds-type     =       GAUGE

datasource idle_conn
	ds-source = "exec:3:%parse-script%"
        desc            =       "All Idle Conns"
        rrd-ds-type     =       GAUGE

datasource longidle_conn
	ds-source = "exec:4:%parse-script%"
        desc            =       "Long Idle Conns"
        rrd-ds-type     =       GAUGE

datasource resting_conn
	ds-source = "exec:5:%parse-script%"
        desc            =       "Resting Conns"
        rrd-ds-type     =       GAUGE


targetType	pg_conn
	ds = "total_conn,pct_conn_used,nonidle_conn,idle_conn,longidle_conn,resting_conn"
        view    =       "Connections: total_conn pct_conn_used nonidle_conn idle_conn longidle_conn resting_conn"


graph total_conn
        legend = "Active Connections"
        y-axis = "Connections"
        draw-as = LINE1

graph pct_conn_used
        legend = "Pct of Connections Used"
        y-axis = "Connections"
        draw-as = LINE1

graph nonidle_conn
        legend = "Non Idle Connections"
        y-axis = "Connections"
        draw-as = LINE1

graph idle_conn
        legend = "All Idle Connections"
        y-axis = "Connections"
        draw-as = LINE1

graph longidle_conn
        legend = "Long Idle Connections"
        y-axis = "Connections"
        draw-as = LINE1

graph resting_conn
        legend = "Resting Connections"
        y-axis = "Connections"
        draw-as = LINE1

