Re: Find all running postgres DB servers on a network

Lists: pgsql-admin
From: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Find all running postgres DB servers on a network
Date: 2010-11-14 16:52:14
Message-ID: AANLkTikpFCXsXq8o9YEvkkXHoV=BYKqVXghM=Az+wGC4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi,

I wanted to know if there is a way to get the hostnames of all the systems
running PostGres DB servers on a local network on Windows (XP/Vista/7) using
JDBC or any other Java API ?

Regards,
Ojas


From: Gerhard Hintermayer <gerhard(dot)hintermayer(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-15 12:54:18
Message-ID: AANLkTi=9aHeUMcJ-AjDC3QQ0HjD4A5BCL3=QaxUEuSyS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

You could try connecting to each possible IP in your network, but to
catch each instance, you should also check nostandard (i.e. different
from 5432) ports - kind of hacking ...  AFAIK (or read ;-) )
Rendezvous/bonjour was implemented on OS X port only.

regards
Gerhard

On Sun, Nov 14, 2010 at 5:52 PM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:
> Hi,
>
> I wanted to know if there is a way to get the hostnames of all the systems
> running PostGres DB servers on a local network on Windows (XP/Vista/7) using
> JDBC or any other Java API ?
>
>
> Regards,
> Ojas
>


From: Viktor Bojović <viktor(dot)bojovic(at)gmail(dot)com>
To: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-15 12:59:01
Message-ID: AANLkTikazNU=JwOT0y6rAS+3bxfUnC+5ecfmK0LdwFXo@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Sun, Nov 14, 2010 at 5:52 PM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:

> Hi,
>
> I wanted to know if there is a way to get the hostnames of all the systems
> running PostGres DB servers on a local network on Windows (XP/Vista/7) using
> JDBC or any other Java API ?
>
>
> Regards,
> Ojas
>

try to scan ports for each address. you can use nmap scanner for that
purpose.

--
---------------------------------------
Viktor Bojović
---------------------------------------
Wherever I go, Murphy goes with me


From: Frederiko Costa <frederiko(at)gmail(dot)com>
To: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-17 20:53:33
Message-ID: AANLkTimsOkgBCp+=erY8B5n6GNuUQ1_cu-7KxFneekQZ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

nmap is the way to go. Try to scan for port 5432 in a range of IP of your
LAN.

~Fred
Linkedin profile: http://www.linkedin.com/in/frederikocosta

On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:

> Hi,
>
> I wanted to know if there is a way to get the hostnames of all the systems
> running PostGres DB servers on a local network on Windows (XP/Vista/7) using
> JDBC or any other Java API ?
>
>
> Regards,
> Ojas
>


From: Scott Whitney <scott(at)journyx(dot)com>
To: Frederiko Costa <frederiko(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-17 20:56:22
Message-ID: 31372072.18703.1290027382116.JavaMail.root@zimbra.int.journyx.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

That only works in the event that you have PG listening on port 5432.

A product like Spiceworks will provide much more detail, presuming you have the IT credentials to talk to the machines.

nmap is the way to go. Try to scan for port 5432 in a range of IP of your
LAN.

~Fred
Linkedin profile: http://www.linkedin.com/in/frederikocosta

On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:

> Hi,
>
> I wanted to know if there is a way to get the hostnames of all the systems
> running PostGres DB servers on a local network on Windows (XP/Vista/7) using
> JDBC or any other Java API ?
>
>
> Regards,
> Ojas
>


From: Frederiko Costa <frederiko(at)gmail(dot)com>
To: Scott Whitney <swhitney(at)journyx(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-17 21:03:52
Message-ID: AANLkTin4Or+kCSmOmtNs4KkC9SzBFdCorV5SJVy97VyR@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

True. However, I was just assuming that Postgres was running on default
ports. If not, you could also probe in port ranges or even probe the network
for open ports to have an idea and get closer. It might be faster option if
software such as Spiceworks is not being used.

Spiceworks looks a good option too.

~Fred

On Wed, Nov 17, 2010 at 12:56 PM, Scott Whitney <scott(at)journyx(dot)com> wrote:

> That only works in the event that you have PG listening on port 5432.
>
> A product like Spiceworks will provide much more detail, presuming you have
> the IT credentials to talk to the machines.
>
> ------------------------------
>
> nmap is the way to go. Try to scan for port 5432 in a range of IP of your
> LAN.
>
> ~Fred
> Linkedin profile: http://www.linkedin.com/in/frederikocosta
>
>
> On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:
>
> > Hi,
> >
> > I wanted to know if there is a way to get the hostnames of all the
> systems
> > running PostGres DB servers on a local network on Windows (XP/Vista/7)
> using
> > JDBC or any other Java API ?
> >
> >
> > Regards,
> > Ojas
> >
>
>
>


From: Rich <rhdyes(at)gmail(dot)com>
To: Frederiko Costa <frederiko(at)gmail(dot)com>
Cc: Scott Whitney <swhitney(at)journyx(dot)com>, pgsql-admin(at)postgresql(dot)org, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-17 21:21:23
Message-ID: AANLkTin0U3N2GUPh1eyz2G29gWyDgOOi1Mv7S3KoD9rq@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Use nmap. Unless you deliberately changed the IP port you should have no
problem. Are you the one who setup all the servers?

On Wed, Nov 17, 2010 at 4:03 PM, Frederiko Costa <frederiko(at)gmail(dot)com>wrote:

> True. However, I was just assuming that Postgres was running on default
> ports. If not, you could also probe in port ranges or even probe the network
> for open ports to have an idea and get closer. It might be faster option if
> software such as Spiceworks is not being used.
>
> Spiceworks looks a good option too.
>
> ~Fred
>
>
> On Wed, Nov 17, 2010 at 12:56 PM, Scott Whitney <scott(at)journyx(dot)com> wrote:
>
>> That only works in the event that you have PG listening on port 5432.
>>
>> A product like Spiceworks will provide much more detail, presuming you
>> have the IT credentials to talk to the machines.
>>
>> ------------------------------
>>
>> nmap is the way to go. Try to scan for port 5432 in a range of IP of your
>> LAN.
>>
>> ~Fred
>> Linkedin profile: http://www.linkedin.com/in/frederikocosta
>>
>>
>> On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:
>>
>> > Hi,
>> >
>> > I wanted to know if there is a way to get the hostnames of all the
>> systems
>> > running PostGres DB servers on a local network on Windows (XP/Vista/7)
>> using
>> > JDBC or any other Java API ?
>> >
>> >
>> > Regards,
>> > Ojas
>> >
>>
>>
>>
>


From: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
To: Rich <rhdyes(at)gmail(dot)com>
Cc: Frederiko Costa <frederiko(at)gmail(dot)com>, Scott Whitney <swhitney(at)journyx(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-18 15:26:38
Message-ID: AANLkTikRxPF4YTOc9mHfsEiyMatY1t0La3MGnDjT80Ba@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Thank you Rich,Fred,Scott,Viktor and Gerard for your replies.

Actually I am neither the system administrator nor the person who set up all
the servers. I am developing an application which would provide the user
with a list of running Postgres DB servers from which the user can select
one. So I was wondering if scanning ports using nmap or Spiceworks would
get me into trouble with the System administrator for trying to flood the
network with my requests or not ?

Regards,
Ojas

On Thu, Nov 18, 2010 at 2:51 AM, Rich <rhdyes(at)gmail(dot)com> wrote:

> Use nmap. Unless you deliberately changed the IP port you should have no
> problem. Are you the one who setup all the servers?
>
>
> On Wed, Nov 17, 2010 at 4:03 PM, Frederiko Costa <frederiko(at)gmail(dot)com>wrote:
>
>> True. However, I was just assuming that Postgres was running on default
>> ports. If not, you could also probe in port ranges or even probe the network
>> for open ports to have an idea and get closer. It might be faster option if
>> software such as Spiceworks is not being used.
>>
>> Spiceworks looks a good option too.
>>
>> ~Fred
>>
>>
>> On Wed, Nov 17, 2010 at 12:56 PM, Scott Whitney <scott(at)journyx(dot)com>wrote:
>>
>>> That only works in the event that you have PG listening on port 5432.
>>>
>>> A product like Spiceworks will provide much more detail, presuming you
>>> have the IT credentials to talk to the machines.
>>>
>>> ------------------------------
>>>
>>> nmap is the way to go. Try to scan for port 5432 in a range of IP of your
>>> LAN.
>>>
>>> ~Fred
>>> Linkedin profile: http://www.linkedin.com/in/frederikocosta
>>>
>>>
>>> On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
>>> wrote:
>>>
>>> > Hi,
>>> >
>>> > I wanted to know if there is a way to get the hostnames of all the
>>> systems
>>> > running PostGres DB servers on a local network on Windows (XP/Vista/7)
>>> using
>>> > JDBC or any other Java API ?
>>> >
>>> >
>>> > Regards,
>>> > Ojas
>>> >
>>>
>>>
>>>
>>
>


From: Frederiko Costa <frederiko(at)gmail(dot)com>
To: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
Cc: Rich <rhdyes(at)gmail(dot)com>, Scott Whitney <swhitney(at)journyx(dot)com>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-18 17:10:58
Message-ID: AANLkTimqufir3iK4UzMzZkz6ktMn6Z4gEh+SDyayau6x@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

I believe in this case you will have to talk with the sysadmin and have an
agreement about this requirement for your application. I don't know about
Spiceworks, but I see nmap as an application working on layer 3/4, so you
may be subject to firewall rules or anything defined in the security policy.

~Fred

On Thu, Nov 18, 2010 at 7:26 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:

> Thank you Rich,Fred,Scott,Viktor and Gerard for your replies.
>
> Actually I am neither the system administrator nor the person who set up
> all the servers. I am developing an application which would provide the user
> with a list of running Postgres DB servers from which the user can select
> one. So I was wondering if scanning ports using nmap or Spiceworks would
> get me into trouble with the System administrator for trying to flood the
> network with my requests or not ?
>
> Regards,
> Ojas
>
>
> On Thu, Nov 18, 2010 at 2:51 AM, Rich <rhdyes(at)gmail(dot)com> wrote:
>
>> Use nmap. Unless you deliberately changed the IP port you should have no
>> problem. Are you the one who setup all the servers?
>>
>>
>> On Wed, Nov 17, 2010 at 4:03 PM, Frederiko Costa <frederiko(at)gmail(dot)com>wrote:
>>
>>> True. However, I was just assuming that Postgres was running on default
>>> ports. If not, you could also probe in port ranges or even probe the network
>>> for open ports to have an idea and get closer. It might be faster option if
>>> software such as Spiceworks is not being used.
>>>
>>> Spiceworks looks a good option too.
>>>
>>> ~Fred
>>>
>>>
>>> On Wed, Nov 17, 2010 at 12:56 PM, Scott Whitney <scott(at)journyx(dot)com>wrote:
>>>
>>>> That only works in the event that you have PG listening on port 5432.
>>>>
>>>> A product like Spiceworks will provide much more detail, presuming you
>>>> have the IT credentials to talk to the machines.
>>>>
>>>> ------------------------------
>>>>
>>>> nmap is the way to go. Try to scan for port 5432 in a range of IP of
>>>> your
>>>> LAN.
>>>>
>>>> ~Fred
>>>> Linkedin profile: http://www.linkedin.com/in/frederikocosta
>>>>
>>>>
>>>> On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
>>>> wrote:
>>>>
>>>> > Hi,
>>>> >
>>>> > I wanted to know if there is a way to get the hostnames of all the
>>>> systems
>>>> > running PostGres DB servers on a local network on Windows (XP/Vista/7)
>>>> using
>>>> > JDBC or any other Java API ?
>>>> >
>>>> >
>>>> > Regards,
>>>> > Ojas
>>>> >
>>>>
>>>>
>>>>
>>>
>>
>


From: tt <thomas(dot)trenz(at)jdisc(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2010-11-22 16:36:25
Message-ID: 04bced08-d965-41a6-a521-301a7ec01323@k13g2000vbq.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Nov 14, 11:52 am, ojas(dot)du(dot)(dot)(dot)(at)gmail(dot)com (ojas dubey) wrote:
> Hi,
>
> I wanted to know if there is a way to get the hostnames of all the systems
> running PostGres DB servers on a local network on Windows (XP/Vista/7) using
> JDBC or any other Java API ?
>
> Regards,
> Ojas

Hi,

JDisc Discovery is able to discover Postgres (and many other database
servers such as MS SQL Server, Oracle, DB2, and Sybase) installations
together with their database instances. JDisc Discovery does not use a
port scan to find the installations.

Find more information on http://www.jdisc.com


From: ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
To: Frederiko Costa <frederiko(at)gmail(dot)com>
Cc: Rich <rhdyes(at)gmail(dot)com>, Scott Whitney <swhitney(at)journyx(dot)com>, viktor(dot)bojovic(at)gmail(dot)com, gerhard(dot)hintermayer(at)gmail(dot)com, pgsql-admin(at)postgresql(dot)org
Subject: Re: Find all running postgres DB servers on a network
Date: 2011-01-05 06:00:08
Message-ID: AANLkTikrdfvNy2ef-5A51EKBKRQu8OFf7yYG6wxQdDZV@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi everyone,

I have to bring this up again. I ran the nmap command *nmap --open -sV
-p5432 -oG dbserverlist.txt 172.28.26.0/24 *to scan the network for running
instances of Postgres servers on my network. The serverlist had the
following output: (I am excluding the IP addresses with Status:Down to
simplify the output)

# Nmap 5.21 scan initiated Thu Dec 30 12:02:52 2010 as: nmap.exe --open -sV
-p5432 -oG dbserverlist.txt 172.28.26.0/24
Host: 172.28.26.0 () Status: Down
Host: 172.28.26.4 () Status: Down
Host: 172.28.26.5 () Status: Down
Host: 172.28.26.38 () Status: Down
Host: 172.28.26.39 () Status: Down
Host: 172.28.26.1 () Status: Up
Host: 172.28.26.1 () Status: Up
Host: 172.28.26.2 () Status: Up
Host: 172.28.26.2 () Status: Up
Host: 172.28.26.3 () Status: Up
Host: 172.28.26.3 () Status: Up
Host: 172.28.26.7 () Status: Up
Host: 172.28.26.7 () Status: Up
Host: 172.28.26.14 () Status: Up
Host: 172.28.26.14 () Status: Up
Host: 172.28.26.18 () Status: Up
Host: 172.28.26.18 () Status: Up
Host: 172.28.26.19 () Status: Up
Host: 172.28.26.19 () Ports: 5432/open/tcp//tcpwrapped///
Host: 172.28.26.30 () Status: Up
Host: 172.28.26.30 () Status: Up
Host: 172.28.26.36 () Status: Up
Host: 172.28.26.36 () Status: Up
Host: 172.28.26.40 () Status: Up
Host: 172.28.26.40 () Ports: 5432/unknown/tcp//postgresql///
Host: 172.28.26.44 () Status: Down
Host: 172.28.26.48 () Status: Down
Host: 172.28.26.50 () Status: Down
Host: 172.28.26.51 () Status: Down
Host: 172.28.26.253 () Status: Down
Host: 172.28.26.254 () Status: Down
Host: 172.28.26.255 () Status: Down
Host: 172.28.26.41 () Status: Up
Host: 172.28.26.41 () Ports: 5432/open/tcp/////
Host: 172.28.26.42 () Status: Up
Host: 172.28.26.42 () Status: Up
Host: 172.28.26.43 () Status: Up
Host: 172.28.26.43 () Status: Up
Host: 172.28.26.45 () Status: Up
Host: 172.28.26.45 () Ports: 5432/open/tcp/////
Host: 172.28.26.46 () Status: Up
Host: 172.28.26.46 () Ports: 5432/open/tcp/////
Host: 172.28.26.47 () Status: Up
Host: 172.28.26.47 () Ports: 5432/open/tcp/////
Host: 172.28.26.49 () Status: Up
Host: 172.28.26.49 () Ports: 5432/open/tcp/////
Host: 172.28.26.56 () Status: Up
Host: 172.28.26.56 () Ports: 5432/open/tcp/////
Host: 172.28.26.57 () Status: Up
Host: 172.28.26.57 () Status: Up
Host: 172.28.26.61 () Status: Up
Host: 172.28.26.61 () Ports: 5432/open/tcp//tcpwrapped///
Host: 172.28.26.68 () Status: Up
Host: 172.28.26.68 () Status: Up
Host: 172.28.26.74 () Status: Up
Host: 172.28.26.74 () Status: Up
Host: 172.28.26.76 () Status: Up
Host: 172.28.26.76 () Status: Up
Host: 172.28.26.77 () Status: Up
Host: 172.28.26.77 () Status: Up
Host: 172.28.26.78 () Status: Up
Host: 172.28.26.78 () Status: Up
Host: 172.28.26.79 () Status: Up
Host: 172.28.26.79 () Status: Up
Host: 172.28.26.81 () Status: Up
Host: 172.28.26.81 () Status: Up
Host: 172.28.26.85 () Status: Up
Host: 172.28.26.85 () Status: Up
Host: 172.28.26.86 () Status: Up
Host: 172.28.26.86 () Status: Up
Host: 172.28.26.87 () Status: Up
Host: 172.28.26.87 () Ports: 5432/open/tcp/////
Host: 172.28.26.88 () Status: Up
Host: 172.28.26.88 () Status: Up
Host: 172.28.26.89 () Status: Up
Host: 172.28.26.89 () Status: Up
Host: 172.28.26.90 () Status: Up
Host: 172.28.26.90 () Status: Up
Host: 172.28.26.91 () Status: Up
Host: 172.28.26.91 () Status: Up
Host: 172.28.26.92 () Status: Up
Host: 172.28.26.92 () Status: Up
Host: 172.28.26.93 () Status: Up
Host: 172.28.26.93 () Status: Up
Host: 172.28.26.94 () Status: Up
Host: 172.28.26.94 () Status: Up
Host: 172.28.26.96 () Status: Up
Host: 172.28.26.96 () Status: Up
Host: 172.28.26.99 () Status: Up
Host: 172.28.26.99 () Status: Up
Host: 172.28.26.101 () Status: Up
Host: 172.28.26.101 () Status: Up
Host: 172.28.26.103 () Status: Up
Host: 172.28.26.103 () Status: Up
Host: 172.28.26.104 () Status: Up
Host: 172.28.26.104 () Status: Up
Host: 172.28.26.107 () Status: Up
Host: 172.28.26.107 () Status: Up
Host: 172.28.26.108 () Status: Up
Host: 172.28.26.108 () Status: Up
Host: 172.28.26.109 () Status: Up
Host: 172.28.26.109 () Status: Up
Host: 172.28.26.110 () Status: Up
Host: 172.28.26.110 () Status: Up
Host: 172.28.26.111 () Status: Up
Host: 172.28.26.111 () Status: Up
Host: 172.28.26.112 () Status: Up
Host: 172.28.26.112 () Status: Up
Host: 172.28.26.113 () Status: Up
Host: 172.28.26.113 () Status: Up
Host: 172.28.26.114 () Status: Up
Host: 172.28.26.114 () Status: Up
Host: 172.28.26.115 () Status: Up
Host: 172.28.26.115 () Ports: 5432/open/tcp/////
Host: 172.28.26.116 () Status: Up
Host: 172.28.26.116 () Status: Up
Host: 172.28.26.117 () Status: Up
Host: 172.28.26.117 () Status: Up
Host: 172.28.26.118 () Status: Up
Host: 172.28.26.118 () Status: Up
Host: 172.28.26.119 () Status: Up
Host: 172.28.26.119 () Status: Up
Host: 172.28.26.121 () Status: Up
Host: 172.28.26.121 () Status: Up
Host: 172.28.26.122 () Status: Up
Host: 172.28.26.122 () Status: Up
Host: 172.28.26.123 () Status: Up
Host: 172.28.26.123 () Status: Up
Host: 172.28.26.124 () Status: Up
Host: 172.28.26.124 () Status: Up
Host: 172.28.26.125 () Status: Up
Host: 172.28.26.125 () Status: Up
Host: 172.28.26.126 () Status: Up
Host: 172.28.26.126 () Status: Up
Host: 172.28.26.127 () Status: Up
Host: 172.28.26.127 () Status: Up
Host: 172.28.26.130 () Status: Up
Host: 172.28.26.130 () Status: Up
Host: 172.28.26.132 () Status: Up
Host: 172.28.26.132 () Status: Up
Host: 172.28.26.135 () Status: Up
Host: 172.28.26.135 () Status: Up
Host: 172.28.26.136 () Status: Up
Host: 172.28.26.136 () Status: Up
Host: 172.28.26.137 () Status: Up
Host: 172.28.26.137 () Status: Up
Host: 172.28.26.138 () Status: Up
Host: 172.28.26.138 () Status: Up
Host: 172.28.26.139 () Status: Up
Host: 172.28.26.139 () Status: Up
Host: 172.28.26.140 () Status: Up
Host: 172.28.26.140 () Status: Up
Host: 172.28.26.144 () Status: Up
Host: 172.28.26.144 () Status: Up
Host: 172.28.26.145 () Status: Up
Host: 172.28.26.145 () Status: Up
Host: 172.28.26.146 () Status: Up
Host: 172.28.26.146 () Status: Up
Host: 172.28.26.148 () Status: Up
Host: 172.28.26.148 () Status: Up
Host: 172.28.26.149 () Status: Up
Host: 172.28.26.149 () Status: Up
Host: 172.28.26.152 () Status: Up
Host: 172.28.26.152 () Status: Up
Host: 172.28.26.154 () Status: Up
Host: 172.28.26.154 () Status: Up
Host: 172.28.26.157 () Status: Up
Host: 172.28.26.157 () Status: Up
Host: 172.28.26.158 () Status: Up
Host: 172.28.26.158 () Status: Up
Host: 172.28.26.159 () Status: Up
Host: 172.28.26.159 () Status: Up
Host: 172.28.26.160 () Status: Up
Host: 172.28.26.160 () Status: Up
Host: 172.28.26.161 () Status: Up
Host: 172.28.26.161 () Status: Up
Host: 172.28.26.162 () Status: Up
Host: 172.28.26.162 () Status: Up
Host: 172.28.26.163 () Status: Up
Host: 172.28.26.163 () Status: Up
Host: 172.28.26.165 () Status: Up
Host: 172.28.26.165 () Status: Up
Host: 172.28.26.169 () Status: Up
Host: 172.28.26.169 () Status: Up
Host: 172.28.26.170 () Status: Up
Host: 172.28.26.170 () Status: Up
Host: 172.28.26.172 () Status: Up
Host: 172.28.26.172 () Status: Up
Host: 172.28.26.178 () Status: Up
Host: 172.28.26.178 () Status: Up
Host: 172.28.26.181 () Status: Up
Host: 172.28.26.181 () Status: Up
Host: 172.28.26.184 () Status: Up
Host: 172.28.26.184 () Status: Up
Host: 172.28.26.187 () Status: Up
Host: 172.28.26.187 () Ports: 5432/open/tcp/////
Host: 172.28.26.197 () Status: Up
Host: 172.28.26.197 () Status: Up
Host: 172.28.26.202 () Status: Up
Host: 172.28.26.202 () Status: Up
Host: 172.28.26.205 () Status: Up
Host: 172.28.26.205 () Status: Up
Host: 172.28.26.206 () Status: Up
Host: 172.28.26.206 () Status: Up
Host: 172.28.26.208 () Status: Up
Host: 172.28.26.208 () Status: Up
# Nmap done at Thu Dec 30 12:03:02 2010 -- 256 IP addresses (97 hosts up)
scanned in 10.29 seconds

From the above output I concluded that the IP addresses with port status of
the format *Ports: 5432/open/tcp///// *are the running instances of the
dbservers which gave the correct result for my networl. But running the same
command on another network gave me the following output:

# Nmap 5.21 scan initiated Tue Jan 04 21:27:09 2011 as: C:\Documents and
Settings\Administrator\Application Data\nmap\nmap.exe --open -sV -p5432 -oG
dbserverlist.txt 192.168.1.0/24
Host: 192.168.1.0 () Status: Down
Host: 192.168.1.2 () Status: Down
Host: 192.168.1.108 () Status: Down
Host: 192.168.1.109 () Status: Down
Host: 192.168.1.1 () Status: Up
Host: 192.168.1.1 () Status: Up
Host: 192.168.1.11 () Status: Up
Host: 192.168.1.11 () Status: Up
Host: 192.168.1.45 () Status: Up
Host: 192.168.1.45 () Status: Up
Host: 192.168.1.46 () Status: Up
Host: 192.168.1.46 () Status: Up
Host: 192.168.1.56 () Status: Up
Host: 192.168.1.56 () Status: Up
Host: 192.168.1.59 () Status: Up
Host: 192.168.1.59 () Status: Up
Host: 192.168.1.99 () Status: Up
Host: 192.168.1.99 () Status: Up
Host: 192.168.1.100 () Status: Up
Host: 192.168.1.100 () Status: Up
Host: 192.168.1.101 () Status: Up
Host: 192.168.1.101 () Status: Up
Host: 192.168.1.102 () Status: Up
Host: 192.168.1.102 () Status: Up
Host: 192.168.1.106 () Status: Up
Host: 192.168.1.106 () Status: Up
Host: 192.168.1.107 () Status: Up
Host: 192.168.1.107 () Status: Up
Host: 192.168.1.111 () Status: Down
Host: 192.168.1.110 () Status: Up
Host: 192.168.1.110 () Ports: 5432/unknown/tcp//postgresql///
Host: 192.168.1.113 () Status: Down
Host: 192.168.1.114 () Status: Down
Host: 192.168.1.251 () Status: Down
Host: 192.168.1.252 () Status: Down
Host: 192.168.1.253 () Status: Down
Host: 192.168.1.254 () Status: Down
Host: 192.168.1.255 () Status: Down
Host: 192.168.1.112 () Status: Up
Host: 192.168.1.112 () Status: Up
# Nmap done at Tue Jan 04 21:27:13 2011 -- 256 IP addresses (14 hosts up)
scanned in 4.44 seconds
Now I am unable to understand the difference between the port status *Ports:
5432/open/tcp///// *and *Ports: 5432/unknown/tcp//postgresql/// *as in what
does the port status *unknown* imply ?

Also please help me out if I am using the wrong command for detection of the
postgres service. Thanks all in advance.

Regards,
Ojas

On Thu, Nov 18, 2010 at 10:40 PM, Frederiko Costa <frederiko(at)gmail(dot)com>wrote:

> I believe in this case you will have to talk with the sysadmin and have an
> agreement about this requirement for your application. I don't know about
> Spiceworks, but I see nmap as an application working on layer 3/4, so you
> may be subject to firewall rules or anything defined in the security policy.
>
> ~Fred
>
>
> On Thu, Nov 18, 2010 at 7:26 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com> wrote:
>
>> Thank you Rich,Fred,Scott,Viktor and Gerard for your replies.
>>
>> Actually I am neither the system administrator nor the person who set up
>> all the servers. I am developing an application which would provide the user
>> with a list of running Postgres DB servers from which the user can select
>> one. So I was wondering if scanning ports using nmap or Spiceworks would
>> get me into trouble with the System administrator for trying to flood the
>> network with my requests or not ?
>>
>> Regards,
>> Ojas
>>
>>
>> On Thu, Nov 18, 2010 at 2:51 AM, Rich <rhdyes(at)gmail(dot)com> wrote:
>>
>>> Use nmap. Unless you deliberately changed the IP port you should have no
>>> problem. Are you the one who setup all the servers?
>>>
>>>
>>> On Wed, Nov 17, 2010 at 4:03 PM, Frederiko Costa <frederiko(at)gmail(dot)com>wrote:
>>>
>>>> True. However, I was just assuming that Postgres was running on default
>>>> ports. If not, you could also probe in port ranges or even probe the network
>>>> for open ports to have an idea and get closer. It might be faster option if
>>>> software such as Spiceworks is not being used.
>>>>
>>>> Spiceworks looks a good option too.
>>>>
>>>> ~Fred
>>>>
>>>>
>>>> On Wed, Nov 17, 2010 at 12:56 PM, Scott Whitney <scott(at)journyx(dot)com>wrote:
>>>>
>>>>> That only works in the event that you have PG listening on port 5432.
>>>>>
>>>>> A product like Spiceworks will provide much more detail, presuming you
>>>>> have the IT credentials to talk to the machines.
>>>>>
>>>>> ------------------------------
>>>>>
>>>>> nmap is the way to go. Try to scan for port 5432 in a range of IP of
>>>>> your
>>>>> LAN.
>>>>>
>>>>> ~Fred
>>>>> Linkedin profile: http://www.linkedin.com/in/frederikocosta
>>>>>
>>>>>
>>>>> On Sun, Nov 14, 2010 at 8:52 AM, ojas dubey <ojas(dot)dubey(at)gmail(dot)com>
>>>>> wrote:
>>>>>
>>>>> > Hi,
>>>>> >
>>>>> > I wanted to know if there is a way to get the hostnames of all the
>>>>> systems
>>>>> > running PostGres DB servers on a local network on Windows
>>>>> (XP/Vista/7) using
>>>>> > JDBC or any other Java API ?
>>>>> >
>>>>> >
>>>>> > Regards,
>>>>> > Ojas
>>>>> >
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>