[Reconnoiter-users] help using postgres plug-in
Mark Wong
mark.wong at myemma.com
Thu Nov 4 12:41:29 EDT 2010
Hello everyone,
I was having trouble figuring out how to get the postgres plug-in to
work based off the web page example. I believe it has something to do
with noitd or noit.conf. I'm working with postgres 8.4.4 (on ubuntu
10.04) and the urskek release.
I started with a noit config for postgres similar to what is on the web
page:
http://labs.omniti.com/labs/reconnoiter/docs/ch05s17.html
After some suggestions from Robert Treat I got to:
<postgres period="10000" module="postgres">
<config>
<dsn>host=127.0.0.1 dbname=reconnoiter user=noit password=noit</dsn>
</config>
<check uuid="1b2c1290-f001-46b3-a184-0cc553bcff1d"
name="reconnoiter" target="127.0.0.1">
<config>
<sql>select datname, pg_database_size(datname) as size,
xact_commit, xact_rollback from pg_stat_database</sql>
</config>
</check>
</postgres>
Basically I'm trying to set up noit to check the database that
reconnoiter is set up in, everything running on the same system (a vm).
When I start noit:
# sbin/noitd -c /home/mwong/local/etc/noit.conf -D -d
Found 15 /noit/logs//log stanzas
Found 1 outlets for log 'error'
Module selfcheck successfully loaded.
ping_icmp: send buffer set to 1998848
Module ping_icmp successfully loaded.
Module snmp successfully loaded.
Module ssh2 successfully loaded.
Loading lua module: varnish
Module varnish successfully loaded.
Loading lua module: http
Module http successfully loaded.
Loading lua module: resmon
Module resmon successfully loaded.
Loading lua module: smtp
Module smtp successfully loaded.
Module postgres successfully loaded.
Compiling filterset 'default'
Prepending deny into default
check uuid: '1b2c1290-f001-46b3-a184-0cc553bcff1d' has no timeout
C 1288749940.479 1b2c1290-f001-46b3-a184-0cc553bcff1d
127.0.0.1 postgres reconnoiter
loaded uuid: 1b2c1290-f001-46b3-a184-0cc553bcff1d
Found 4 /noit/listeners//listener stanzas
noit_listener(/tmp/noit, 0, 1, 5, noit_console, (nil))
noit_listener(*, 32322, 1, 5, noit_console, (nil))
noit_listener(*, 32323, 1, 5, noit_console, (nil))
noit_listener(*, 43191, 1, 5, control_dispatch, (nil))
127.0.0.1`reconnoiter <- [timeout]
127.0.0.1`reconnoiter -> [unavailable:bad]
My database log says:
2010-11-02 19:05:41 PDT [18866]: [1-1] user=[unknown],db=[unknown],host=
LOG: connection received: host=127.0.0.1 port=39725
My observation suggests the username and dbname is mishandled between
the noit.conf and making the database connection from noit, assuming
that my noit.conf is correct.
I verified I can connect with psql from the same system:
$ psql -h 127.0.0.1 -U noit -W -d reconnoiter
Password for user noit:
psql (8.4.4)
SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256)
Type "help" for help.
reconnoiter=#
Anything else I can provide that will help?
Regards,
Mark
More information about the Reconnoiter-users
mailing list