[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[2]: PGSQL logfile errors

From: Raj Gupta
Subject: Re: Re[2]: PGSQL logfile errors
Date: Fri, 7 Sep 2007 09:05:32 -0700

I double-checked this and looks like it is not monit that is causing this problem!!

There must be something else periodically polling the postgresql server.

The clue came when I sent you the message with the log file entries, and saw that they were spaced 5 minutes apart. I was running monit to poll at an interval of 2 minutes. So, even when I shut down monit, the messages keep appearing.

Thanks for your help.


On Sep 7, 2007, at 2:56 AM, Tatsuya Nonogaki wrote:

Uhhhhn, sad.

There is one last suggestion I can make.
I have written a SELECT query in protocols/pgsql.c and it is comment-ou
t'ed. I made sure it is left in Monit-4.9 source code. Then, uncomment
the section starting with

  /** Doing this is too suspicious maybe.

and under the line that says
/** This is where suspicious people can do SELECT query that I dont


    socket_write(s, (unsigned char *)requestQuery, sizeof(requestQuer

Then do make.

This will make monit do a REAL JOB so PostgreSQL may satisfy itself. To see these lines are processed, edit postgresql.conf to include these s
ettings and restart PostgreSQL;

log_connections = yes
log_statement = yes
(on PostgreSQL 8.x, set log_statement to `all')

If the queries `select 1 as a' dont appear in postgresql log, something
 totally wrong is going on and I have to give up.

I hope this helps solve the problem.
     Tatsuya Nonogaki

Hi Nonogaki san,

 Thank you for your prompt response.

I've tried different combinations as you suggest. I even tried the unixso cket check as you suggested, but am still getting these in my pgsql log fil

 2007-09-07 01:05:50 LOG:  incomplete startup packet
 2007-09-07 01:10:50 LOG:  incomplete startup packet

 I am using Postgresql version 7.4.7

I think the test is working properly, as it is able to connect to the dat
abase and make sure the connection is possible.

On searching a bit on the web (e.g., see <http://www.mail- address@hidden/msg20274.html>) I found out that this could be happ ening because the monitoring client is disconnecting too quickly for postgr
esql's liking.


On Sep 6, 2007, at 8:56 PM, Tatsuya Nonogaki wrote:


I suspect monit is actually using pgsql test. Bellow are would-be list
of possibility.

* Are TEST type names case insensitive and `port' optional? Try this (I
am not sure...)

if failed port 5432 protocol pgsql
then ...

* PGSQL TEST was written for front-end protocol version 3.0 which had
been implemented since PostgreSQL 7.4. If you are using pre-7.4
PostgreSQL server, the TEST may not work properly.

* Does your PostgreSQL allow root to connect to `root' DB you have
created? Ensure pg_hba.conf has something like;

host   root  root  trust
local  root  root                ident sameuser

(Note that this pg_hba.conf format is based on PostgreSQL 8.x. It varies
on 7.4.x)
The second line is needed for pgsql TEST through UNIX Socket and
unnecessarry for TCP. But I personally recommend using UNIX Socket
unless you REALLY need to examine PostgreSQL availability through TCP.
In that case, monit definition should be;

if failed unixsocket /tmp/.s.PGSQL.5432 protocol pgsql
then ...

Best regards.
Tatsuya Nonogaki


I've just downloaded monit and have been playing around with it to star
monitoring our Apache/Tomcat/Postgresql based web application.

(Since the application went down for a few hours this weekend, we've be
looking for an automated re-start solution, and are glad to have found

When checking for Postgresql I've been using the PGSQL entry like this:

 check process postgresql with pidfile /var/run/
    start program = "/etc/init.d/postgresql start"
    stop program  = "/etc/init.d/postgresql stop"
    if failed protocol PGSQL then restart
    if 5 restarts within 5 cycles then timeout

I've also added the user root and database root to avoid having spuriou
messages in my pglog file complaining about user root and database root.

 I still keep getting errors in the PGLOG file like:

 LOG:  incomplete startup packet

Can someone suggest a way to not get these errors. Since I am monitorin
every 2 minutes this will create too many messages in our log file and I
worried we might miss some other critical messages.


 Raj Gupta                          address@hidden
 1684 Nightingale Avenue     Suite 201
 Sunnyvale, CA 94087            408-733-2737(fax)


To unsubscribe:

To unsubscribe:

To unsubscribe:

To unsubscribe:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]