Lightest way of checking if postgresql is running at the other end of an ssh tunnel?

Поиск
Список
Период
Сортировка
От Niels Kristian Schjødt
Тема Lightest way of checking if postgresql is running at the other end of an ssh tunnel?
Дата
Msg-id C01E306B-DF31-44C9-A795-8361C6E3F122@autouncle.com
обсуждение исходный текст
Ответы Re: Lightest way of checking if postgresql is running at the other end of an ssh tunnel?  (Karsten Hilbert <Karsten.Hilbert@gmx.net>)
Список pgsql-general
Hi,

We have an ssh connection running from one server to our postgresql database on another server. Some times we
experiencethat the ssh tunnel does not work anymore and needs to be restarted, even though we use the autossh package.
Iwould like to write a script that “pings” postgresql on the specified port, to check if the connection goes through. I
havetried with netcat, but it does not really check if postgresql is in the other end of the tunnel, it only check if
thereis as service (the tunnel) listing on the port on the local machine. Is there another way of pinging the port, to
seeif postgresql is alive at the other end? If possible, I would like to NOT actually establishing a connection to
postgresqllike if i used psql -c “select 1;”, to avoid connection overhead. 

Any ideas?

В списке pgsql-general по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Streaming replication, master recycling
Следующее
От: Karsten Hilbert
Дата:
Сообщение: Re: Lightest way of checking if postgresql is running at the other end of an ssh tunnel?