Avatar of YZlat
YZlat
Flag for United States of America asked on

Get a list of UNIX servers via scripting

I need to retrieve a l;ist of all UNIX servers onm the network via UNIX script.  Can anyone point me in the right direction?
Unix OSShell Scripting

Avatar of undefined
Last Comment
slightwv (䄆 Netminder)

8/22/2022 - Mon
slightwv (䄆 Netminder)

The best way is to contact your sys admins and ask them.

That said, check nmap:
http://nmap.org/book/man-os-detection.html

You probably won't get an inclusive list because I would hope the servers on your network were protected from this type of scanning.

Running a scanning tool like this can be against your corporate policies.  Check with your security folks to make sure you are allowed to do this.
omarfarid

What type of network do you have and are all the systems on the network are unix servers?

Do you know the range of IPs used on your network?
Mazdajai

I think slighttwv covered most basis.

Another novice way is to use passive os detection with TTL packet.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
YZlat

ASKER
Not all servers are the UNIX servers, most are Windows servers
Mazdajai

You can do a ping sweep. In general, TTL of 128 is Windows, 64 is Linux and 255 is Unix.
slightwv (䄆 Netminder)

I should also point out that you will likely miss some servers that are protected by the network and of course, those powered down...

For example:  You have a Unix web server sitting in the DMZ.  I would hope your admins have that protected well enough that you will not be able to scan that server from the machine where you wish to run your script.

Mind if I ask what you are hoping to gain with this type of a script?
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
YZlat

ASKER
I need to create a report that would consist of all the database servers and Oracle databases on them
slightwv (䄆 Netminder)

"all the database servers" is different than "list of all UNIX servers".

"and Oracle databases on them" is a new requirement to the question.

I'm afraid that scripting this to be dynamic will be problematic, pretty intrusive and very time consuming.

How do you plan on getting database instances running on a server?

The things that you will miss:
1: I have a test server with 10 Oracle instances and the server is shut down when you run your script.

2: I have a server with 10 instances on it and 3 of instances are shut down.

This is on top of the issue of just scanning an entire network trolling for servers.  To repeat again: Most companies frown on this practice.

I would just ask your DBA's.  If you have been tasked with doing this then you should have the backing of Management which should have penalities for non-compliance to your requests.
YZlat

ASKER
I can accomplish what I want by querying MGMT$TARGET management repository view. Any idea how can I do that?
Your help has saved me hundreds of hours of internet surfing.
fblack61
ASKER CERTIFIED SOLUTION
slightwv (䄆 Netminder)

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question