Sponsored Content
Top Forums UNIX for Advanced & Expert Users How do we check the Linux machine OS? Post 302950456 by cjcox on Friday 24th of July 2015 05:07:00 PM
Old 07-24-2015
varies (and my knowledge is a few years old)... you might try:

Code:
cat /proc/sysinfo


Ok... that probably doesn't help much, but this might (this is old .... older mainframes and z):

Code:
sysinfo=`cat /proc/sysinfo'
ztype=`echo "$sysinfo" | sed -n 's/^Type:[ ]*\(.*\)/\1/p'`
                        zmodel=`echo "$sysinfo" | sed -n 's/^Model:[ ]*\(.*\)/\1/p'`
                        if [ "$ztype" -a "$zmodel" ]; then

                                productid="${ztype}-${zmodel}"
                                # Determine mainframe product
                                case "${ztype}" in
                                4381)
                                        product="4381"
                                ;;
                                3090)
                                        product="3090"
                                ;;
                                9221|9121)
                                        product="S/390 9221"
                                ;;
                                2003)
                                        product="S/390 Multiprise 2000"
                                ;;
                                3000)
                                        product="S/390 Multiprise 3000"
                                ;;
                                9672)
                                        product="S/390 9672"
                                        case "${zmodel}" in
                                        R11|R21|R31|R41|R51|R61|E*|P*)
                                                gen="G1"
                                        ;;
                                        RA2|R12|R22|R32|R42|R52|R72|R53|R73|R83|RX3|RA4|RB4|RC4|R14|R24|R34|R44|R54|R64|R74|R84|R94|RX4)
                                                gen="G2"
                                        ;;
                                        RY4)
                                                gen="G3"
                                        ;;
                                        RA5|RB5|RC5|R15|R25|R35|R45|R55|R65|R75|R85|R95|RX5|RY5)
                                                gen="G4"
                                        ;;
                                        R16|R26|RC6|RD6|T16|T26|R36|R46|R56|R66|R76|R86|R96|RX6|Y16|Y26|Y36|Y46|Y56|Y66|Y76|Y86|Y96|YX6)
                                                gen="G5"
                                        ;;
                                        X17|X27|X37|X47|X57|X67|X77|X87|X97|XX7|XY7|XZ7|Z17|Z27|Z37|Z47|Z57|Z67|Z77|Z87|Z97|ZX7|ZY7|ZZ7)
                                                gen="G6"
                                        ;;
                                        esac
                                        if [ "$gen" ]; then
                                                product="${product} ${gen}"
                                        fi
                                ;;
                                9021)
                                        product="ES/9000"
                                ;;
                                2066)
                                        product="zSeries 800"
                                ;;
                                2086)
                                        product="zSeries 890"
                                ;;
                                2096)
                                        product="System z9 BC"
                                        case "${zmodel}" in
                                        A0[123]|B0[123]|C0[123]|D0[123]|E0[123]|F0[12]|G01|H01|I01|J01|R07)
                                                gen="R07"
                                        ;;
                                        K04|L0[34]|M0[34]|N0[234]|O0[234]|P0[234]|Q0[234]|R0[1234]|S0[1234]|T0[1234]|U0[1234]|V0[1234]|W0[1234]|X0[1234]|Y0[1234]|Z0[1234]|S07)
                                                gen="S07"
                                        ;;
                                        esac
                                        if [ "$gen" ]; then
                                                product="${product} Model ${gen}"
                                        fi
                                ;;
                                2064)
                                        product="zSeries 900"
                                        case "${zmodel}" in
                                        10[12345678X])
                                                gen="10X"
                                        ;;
                                        1C[123456789X]|11[0123456])
                                                gen="1CX"
                                        ;;
                                        2C[123456789X]|21[0123456])
                                                gen="2CX"
                                        ;;
                                        esac
                                        if [ "$gen" ]; then
                                                product="${product} Model ${gen}"
                                        fi
                                ;;
                                2084)
                                        product="zSeries 990"
                                ;;
                                2094)
                                        product="System z9 EC"
                                ;;
                                2097)
                                        product="System z10"
                                ;;
                                2098)
                                        product="System z10 BC"
                                ;;
                                2817)
                                        product="zEnterprise 196"
                                ;;
                                esac
                        fi

YMMV if this gets you anywhere... this is from some work I did 3 years ago or so. Maybe IBM has a tool now... but at one time it really was this hard. Maybe somebody has something more contemporary....
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check for a file on a remote machine

Hi, Can someone tell me how to check if a file exists on a remote machine using rexec command?I'm using ksh. Thanks (3 Replies)
Discussion started by: Sheema
3 Replies

2. Shell Programming and Scripting

SSH into a linux machine from a windows machine

I basically want to login into different linux machines( on the same network) from a windows machine. I know i can use ssh <machine name>. But i want to automate this process. I dont want to enter the username and password. Is there any way to do it. Can i make some sort of a batch script for it. (4 Replies)
Discussion started by: lassimanji
4 Replies

3. Programming

Check if user logged into remote machine via C++ / Java

Hi, I have a program running on HP-UX and it must checkwhether a user has already logged-in to another machine. The hostname of the other machine is known when the check has to be made. Is there a way which this can be accomplished using C++ or Java? If not I could parse the output of a... (6 Replies)
Discussion started by: johnmmcparland
6 Replies

4. Shell Programming and Scripting

check for file existence on remote machine using sftp

Hi all, I am a beginner to shell script.Can any one please help me on the below requirement I need to check whether the file (called 3Com_Files_Delivered.txt) exists on the remote mechaine or not? if so i need to copy all the files from there to my local mechaine.Especially i am... (7 Replies)
Discussion started by: narasimha123
7 Replies

5. Shell Programming and Scripting

Check file exists on remote machine.

I am haveing one script haveing one issue with this could any one can reply soon it is very urgent. :p if ssh hcp_ftp@$1 'ls '$2/stop.txt' 1>&2 2>/dev/null'; then exit 1; else scp -p hcp_ftp@$1:$2/VAT*.dat $3 <<EOF EOF cd $3 pwd echo 'About to find file' SOURCE_FILE=$(ls -rt VAT*.dat|tail... (2 Replies)
Discussion started by: marpadga18
2 Replies

6. Shell Programming and Scripting

shell script to copy files frm a linux machine to a windows machine using SCP

I need a shell script to copy files frm a linux machine to a windows machine using SCP. The files keeps changing day-to-day. I have to copy the latest file to the windows machine frm the linux machine. for example :In Linux, On July 20, the file name will be 20.txt and it should be copied to... (3 Replies)
Discussion started by: nithin6034
3 Replies

7. Shell Programming and Scripting

I have a requirement to check whose accounts are expired in Linux machine and send a mail to root

I have a requirement to check whose accounts are expired in Linux machine and send a mail to root user about the accounts. How can i achieve this in Linux? (1 Reply)
Discussion started by: mnmonu
1 Replies

8. UNIX for Advanced & Expert Users

How to check number of threads running per processor in Linux machine?

I have a machine which has 32 processor but i am really not sure how many threads are running. It has hyperthreading enabled. Is there a way i can find that all 32 processors are being used and how many threads are there in my linux box. Its a 64 bit processor. I am having very high load average... (3 Replies)
Discussion started by: Moon1234
3 Replies

9. Shell Programming and Scripting

Control machine and check value

I'm thinking how to control and execute command to control my machine like update them, scenario is creating a cron in machine 1 machine 2 machine 3 which download .txt file from core machine, this txt file contain update function like: kernel=1 yum=0 ssl=1 and store this file in... (4 Replies)
Discussion started by: nimafire
4 Replies

10. UNIX for Beginners Questions & Answers

How to check everything are migrated after the physical to vmware virtual machine?

I have a physical machine , just use vmware tools migrated data to virtual machine . how can I check these two servers - old and new server , the data are the same , all files are copy to new server ? thanks (2 Replies)
Discussion started by: ust3
2 Replies
All times are GMT -4. The time now is 04:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy