[comp.sys.apollo] How can a script determine machine type & OS?

abair@turbinia.oakhill.uucp (Alan Bair) (12/14/89)

We are developing gnumake files to use on all of the machines
we have to support, so we need a way to determine the machine
type and OS.  For the Sun, we grep the first line of /etc/motd,
which is a line from the booting messages that we add.
For example:
Sun UNIX 4.2 Release 3.4 (CALYPSO) #1: Mon Dec 28 10:45:53 CST 1987

We run BSD4.3 on the Apollos, so I looked at doing something similar
to the Sun, but cannot find a log file to obtain similar information
from. I have noticed that when you login, there is a single line
displayed with similar information as follows.

DomainOS Release 10.1 (bsd4.3) Apollo DN10000 serapis

It is displayed just before /etc/motd, presumably by the login
process.  I have checked the normal Apollo startup files, and it does
appear to come from them.

If I could get the above string from a command, then my problem would
be solved.  I would prefer a non-Aegis method, but will accept any
ideas.
--
Alan Bair
SPS CAD                   Logic Simulation & Test
Motorola, Inc.            Austin, Texas
...!cs.utexas.edu!oakhill!turbinia!abair

brian@padouk.ima.isc.com (Brian R. Holt) (12/14/89)

In article <ABAIR.89Dec13152017@turbinia.oakhill.uucp>,
abair@turbinia.oakhill.uucp (Alan Bair) writes:
> We are developing gnumake files to use on all of the machines
> we have to support, so we need a way to determine the machine
> type and OS.  For the Sun, we grep the first line of /etc/motd,

> I have noticed that when you login, there is a single line
> displayed with similar information as follows.
> 
> DomainOS Release 10.1 (bsd4.3) Apollo DN10000 serapis
> 
> It is displayed just before /etc/motd, presumably by the login
> process.  I have checked the normal Apollo startup files, and it does
> appear to come from them.

That is coming from /bin/login. I believe I put that in, back when I
worked at Apollo, from the System V /bin/login. In any case, you should
be able to get the same info from the uname command.

		=brian

Disclaimer: This message brought to you by me, not my employer.
brian@ima.isc.com
US 617-661-7474 x206
near the Charles River

rousseau@apollo.HP.COM (John Rousseau) (12/15/89)

In article <ABAIR.89Dec13152017@turbinia.oakhill.uucp> you write:
>We are developing gnumake files to use on all of the machines
>we have to support, so we need a way to determine the machine
>type and OS.  For the Sun, we grep the first line of /etc/motd,

Well, the command /usr/apollo/bin/bldt will give you a wealth of
interesting information. Although it qualifies as an Aegis command,
it is one of our commands that is meant to be used in any environ.

% bldt

     **** Node 29C15.E582 ****   "//ferrari"
Domain/OS kernel(7), revision 10.2, October 13, 1989  12:51:22 pm

Some creative grep'ing and awk'ing will snarf out the info you want.
the 'kernel(7)' part refers to the sau type. If you want the actual
node type, use /etc/nodestat -l .

-John

--------------------------------------------------------------------------
 John Rousseau         Internet: rousseau@apollo.hp.com 
 Apollo Division       UUCP:  {mit-eddie,yale,uw-beaver}!apollo!rousseau
 Hewlett-Packard       Phone: (508) 256-6600
 Chelmsford, MA 01824  Fax:   (508) 250-0361
 Disclaimer: (you know the words, sing along if you like)
--------------------------------------------------------------------------

kosbab@hp-lsd.COS.HP.COM (Bruce J. Kosbab) (12/15/89)

Use the "uname -a" command to get the information you need.  It gives
the OS version, type (Sys V or BSD), and machine type.

Bruce Kosbab
hp-lsd!kosbab

robinb@merlin.bhpmrl.oz (Robin Brown) (12/21/89)

From article <11360003@hp-lsd.COS.HP.COM>, by kosbab@hp-lsd.COS.HP.COM (Bruce J. Kosbab):

> Use the "uname -a" command to get the information you need.  It gives
> the OS version, type (Sys V or BSD), and machine type.

This is a sys5.3 command only (/sys5.3/bin/uname) and on our system
it prints sys5.3 independant of the current ver setting.  I'd be
interested to know if anyone else has this proplem.

robin
robinb@merlin.bhpmrl.oz
BHP Melbourne Research Laboratories

oj@apollo.HP.COM (Ellis Oliver Jones) (12/22/89)

Nobody has mentioned the environment variables set up automatically
in Domain/OS processes:

SYSTYPE=bsd4.3
ISP=m68k
TERM=apollo_1280_bw
NODETYPE=DN4000
NODEID=14E4F

SYSTYPE,  ISP, and NODETYPE can tell you a lot about what kind of 
machine you're running on.  Avoid depending on TERM, because a lot
of the newer display devices just use the value "apollo."

Beware if you hardcode dependencies on NODETYPE -- sometimes 
beta and early bird versions of new hardware have strange nodetype
values like "DNEXYZ" (which later became "DN2500").

/oj (speaking for myself, not necessarily for HP Apollo Systems Division)