Friday, January 10, 2014

Finding System Information for Middleware Engineers.




SOLARIS

How to Determine Whether a System Has 32–bit or 64–Bit Solaris Capabilities Enabled


Use the isainfo command to determine whether a system has 32–bit or 64-bit capabilities enable



The isainfo command, run without specifying any options, displays the name or names of the native instruction sets for applications supported by the current OS version.

 -v

Prints detailed information about the other options

 -b

Prints the number of bits in the address space of the native instruction set.

 -n

Prints the name of the native instruction set used by portable applications supported by the current version of the OS.

 -k

Prints the name of the instruction set or sets that are used by the OS kernel components such as device drivers and STREAMS modules.



Example:

$ isainfo -v

 64-bit sparcv9 applications

                 32-bit sparc applications



                 $ isainfo -b

  32


prtdiag is used for printing the system information in solaris.



Displaying System Information (Task Map)
Task 
Description 
Determine whether a system has 32 bit or 64–bit capabilities enabled. 
Use the isainfo command to determine whether a system has 32–bit or 64-bit capabilities enabled. For x86 based systems, you can use the isalist command to display this information.
Display Solaris Release Information 
Display the contents of the /etc/release file to identify your Solaris release version.
Display General System Information. 
Use the showrev command to display general system information.
Display a system's Host ID number. 
Use the hostid command to display your system's host id.
Display a System's product name 
Starting with the Solaris Express 7/05 release, you can use the prtconf -b command to display the product name of a system.
Display a System's Installed Memory 
Use the prtconf command to display information about your system's installed memory.
Display a system's date and time. 
Use the date command to display your system's date and time.
Display a system's physical processor type. 
Use the psrinfo -p command to list the total number of physical processors on a system.
Use the psrinfo -pv command to list all physical processors on a system and the virtual processors that is associated with each physical processor.
Display a system's logical processor type. 
Use the psrinfo -v command to display a system's logical processor type.
Display locales that are installed on a system. 
Use the localeadm command to display locales that are installed on your system.
Determine if a locale is installed on a system. 
Use the -q option of the localeadm command and a locale to determine if a locale is installed on your system.





Displaying System Information
The following table describes commands that enable you to display general system information.
Table  Commands for Displaying System Information
Command 
System Information Displayed 
date
Date and time 
hostid
Host ID number 
isainfo
The number of bits supported by native applications on the running system, which can be passed as a token to scripts
isalist
Processor type for x86 based systems 
localeadm
Locales installed on the system 
prtconf
System configuration information, installed memory, and product name 
psrinfo
Processor type 
showrev
Host name, host ID, release, kernel architecture, application architecture, hardware provider, domain, and kernel version 
uname
Operating system name, release, version, node name, hardware name, and processor type 



 Linux:

For Linux users
If you are running Linux, you can check your distribution with the uname command:
uname -m
The output will read x86_64 for 64-bit and i686 or similar for 32-bit.

To find whether java binary is 32 bit or 64 bit

cd <JAVA_HOME>/bin
<JAVA_HOME>/bin:##  file java
java: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.4.0, dynamically linked (uses shared libs), not stripped

View process environment details with proc

$ cat /proc/<javaPID>/environ | tr "\000" "\n" 


View System information


$ cat /proc/cpuinfo
$ cat /proc/meminfo
$ cat /proc/version 
or uname -mrs 
   uname -a

How to X session forwarding over SSH

$ ssh -X user@remotehost xclock
$ ssh -C -X user@remotehost xclock
$ ssh -v -X user@remotehost xclock

Find out information about Linux Memory

$ free -m
$ free -g

Find out user shell name:

$ ps -p $$ | tail -1 | awk '{ print $4 }' 

Dump Linux kernel variables:

$ /sbin/sysctl -a 

Network card and IP address information:

$ ifconfig -a
$ ifconfig -a|less

Display routing information:

$ route -n 
$ route 


Display list of all open ports

$ netstat -tulpn

Find how long the system has been running

$ uname
$ w

Show who is logged on and what they are doing

$ w
$ who

Display list of tasks

$ top

Display all running process

$ ps aux
$ ps aux | grep process-name

Display list of all installed software on Redhat / CentOS / Fedora

rpm -qa 
rpm -qa | grep 'software-name' 
rpm -qa | less

Find out disk space usage:

df -h 

Find/Estimate file space usage:

$  du -h