[collectd] Not seeing postgres data from collectd.

Sebastian Harl sh at tokkee.org
Mon Mar 8 23:09:12 CET 2010


Hi,

On Mon, Mar 08, 2010 at 01:04:19PM -0800, James Armstrong wrote:
> We're trying to add a monitor for some table sizes to collectd for a
> postgres database.  Our configuration is to use a central server to host
> the data, and various machines send the data to that server.
> 
> I've added the following to /etc/collectd.conf on a working machine and
> restarted collectd, but the postgres data is not appearing in the UDP
> packets.  I have confirmed this with tcpdump.
> 
> LoadPlugin "postgresql"
> 
> ...
> 
> <Plugin "postgresql">
>   <Query eventcount>
>     Statement "SELECT COUNT(*) AS count FROM events;"
>     <Result>
>       Type counter
>       InstancePrefix "eventcount"
>       ValuesFrom "count"
>     </Result>
>   </Query>
> 
>   <Database dwh>
>     Host "192.168.X.YY"
>     User "dbuser"
>     Password (correct password)
>     Query eventcount
>   </Database>
> </Plugin>

That config snippet looks fine to me.

> The connection information for the database works, confirmed with psql.

What's the exact psql command line you were using to verify that?

Did you verify that the postgresql plugin actually connects to the
database (select * from pg_stat_activity where datname = 'dwh')?

Given that nobody else accesses the same table, the following query
might give you an idea whether the query is executed at all: select
seq_scan, seq_tup_read from pg_stat_user_tables where relname = 'dwh'.
That query should return numbers that are increased after each collectd
interval. Else, you could also configure PostgreSQL to log every query
to make sure the query is actually executed by collectd.

Which version of collectd do you use?

> There are no error messages in the logfile, we're using the logfile
> plugin at loglevel debug.

To make use of loglevel "debug", collectd has to be compiled with
debugging enabled. Is that the case? You should then see *lots* of
messages in the log file.

HTH,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100308/35c96794/attachment.pgp 


More information about the collectd mailing list