Operating System - HP-UX
1832089 Members
3086 Online
110037 Solutions
New Discussion

Re: Generate list of all HPUX servers

 
Rpger Tavener
Occasional Advisor

Generate list of all HPUX servers

How can I generate a list of all the HPUX servers. I would like to route the output to a file.

Thanks
When the only tool you own is a hammer, every problem looks like a nail!
7 REPLIES 7
Pete Randall
Outstanding Contributor

Re: Generate list of all HPUX servers

roger,

I would expect that you might already have a list in /etc/hosts. If you have other servers listed in there, you can edit it to put in comments that identify the type of server like this:

130.1.0.249 dam dam.holstein.com #unixhost#dam


Other than that, I can't think of a way to find this information from the command line.


Pete

Pete
Bharat Katkar
Honored Contributor

Re: Generate list of all HPUX servers

It seems to be impossible one.

Just to add something:

I can get list of IP address rather than names of all hosts in the network. And that is possible by doing ==>

#ping > /tmp/hostsIP



You need to know a lot to actually know how little you know
Geoff Wild
Honored Contributor

Re: Generate list of all HPUX servers

You might be able to use something like snmpwalk

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
RAC_1
Honored Contributor

Re: Generate list of all HPUX servers

How about using expect for this?

Telnet to box, if you get hp-ux string, it is hp-ux server else not.
(But this is not a very reliable way and you can always change the stuff that is displayed during login)

Hope this helps.

Anil
There is no substitute to HARDWORK
Gregory Fruth
Esteemed Contributor

Re: Generate list of all HPUX servers

First of all, why do you want to do this?

Secondly, presumably you mean all the
HP-UX servers on your LAN or in your
domain, not the entire Internet!

The tricky part is figuring out what hosts
you want to query. /etc/hosts might
have such a list, but if you're using
NIS or DNS you'll have to use something
like nslookup to get the list. Try the
"ls" command inside of nslookup. ("ls -h"
supposedly lists the CPU and OS info
records for all machines in a domain, but
that info is not always reliable.)

Once you have the list of servers you're
interested in, try using telnet (in a
script) and check the banner, e.g.:

HP-UX hpux_box B.11.22 U ia64 (tc)

HTH
Dani Seely
Valued Contributor

Re: Generate list of all HPUX servers

Hey Roger,
Anil touched on the very thought I had. I know of no other method to obtain this information than using telnet to obtain the
initial system message, i.e.:

HP-UX rufus 11.00 U 9000/800 (ta)

This is actual output of a test (rufus is the hostname) and you can not only tell the OS type (HP-UX), but the version (11.00). However, as Anil mentioned, this is not always reliable as the message can be changed or removed and you can be returned nothing or a fake string (an SA can make the system report that it's a MAC OS or some other OS).

Also, some telnet sessions do not automatically timeout so it would be hard to generate a script that can obtain this info, dump it into a file, and then break out '^]' of the telnet session and continue.

If you trust that nobody has changed the system string on the systems that you are trying to obtain this information from then this is a valid option and won't take a lot of time. Also, if you are not good at writing scripts but you have a GUI screen, you can simply cut and paste the hostname/IP you are performing the telnet to and the system string you receive.

Hope this helps. Good luck!
Together We Stand!
Dani Seely
Valued Contributor

Re: Generate list of all HPUX servers

Hello Roger,
I assume this is your first experience on the ITRC forum as you did not award points to the forumers for the answers you were provided. May I suggest that you take a look at the following link to learn about the points system in use here. Thanks.

http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Please read the article, assess the assistance you were provided by the forumers, then reward them. Thanks!
Together We Stand!