System Administration Guide, Volume 2

Chapter 27 Examining and Changing System Information (Tasks)

This chapter describes tasks required to examine and change the most common system information. This is a list of the step-by-step instructions in this chapter.

Using Commands to Display System Information

The following table describes commands that enable you to display general system information.

Table 27-1 Commands for Displaying System Information

Command 

Enables You to Display a System's ... 

psrinfo(1M)

Processor type 

isainfo(1)

Supported applications and it reports the number of bits supported by native applications on the running system, which can be passed as a token to scripts

showrev(1M)

Hostname, host identification number, release, kernel architecture, application architecture, hardware provider, domain, and kernel version 

uname(1)

Operating system name, release, and version; node name; hardware name; processor type 

hostid(1)

Host ID number 

prtconf(1M)

Installed memory 

date(1)

Date and time 

How to Determine Whether a System Can Run the 64-bit Solaris Operating Environment

Currently, the only platform capable of supporting the 64-bit Solaris operating environment is an UltraSPARC system. You can verify whether a system is an UltraSPARC system by using the following command:


$ uname -m
sun4u

If the output of the uname -m command is sun4u, then the machine is an UltraSPARC system.

If you are running the Solaris 8 release, you can verify this by using the psrinfo command:


# psrinfo -v 		
Status of processor 0 as of: 07/12/99 09:41:47
  Processor has been on-line since 07/08/99 13:51:11.
  The sparcv9 processor operates at 333 MHz,
        and has a sparcv9 floating point processor.

If the processor type is sparcv9, the platform is capable of running the 64-bit Solaris operating environment. This test does not work on previous versions of the psrinfo command, where all platforms report the less precise sparc as the processor type.

How to Determine Whether a System Has 64-bit Solaris Capabilities Enabled

You can use the isainfo command to determine whether a system has 64-bit capabilities enabled, which means the system is booted with the 64-bit kernel.

Examples--Determining Whether a System Has 64-bit Solaris Capabilities Enabled

An UltraSPARC system running a 32-bit kernel looks like this:


$ isainfo -v
32-bit sparc applications

The output means this system is capable of supporting only 32-bit applications.

An UltraSPARC system running a 64-bit kernel looks like this:


 $ isainfo -v 
64-bit sparcv9 applications 
32-bit sparc applications

This output means this system is capable of supporting both 32-bit and 64-bit applications.

Use the isainfo -b command to display the number of bits supported by native applications on the running system.

The output from a SPARC, IA, or UltraSPARC system running the 32-bit Solaris operating environment looks like this:


$ isainfo -b
32  

The output from a 64-bit UltraSPARC system running the 64-bit Solaris operating environment looks like:


$ isainfo -b
64

The command returns 64 only. Even though a 64-bit UltraSPARC system is capable of running both types of applications, 64-bit applications are the best kind of applications to run on a 64-bit system.

The uname -p output remains sparc or i386 to ensure that existing 32-bit applications continue to run without interruption.

How to Display System and Software Release Information

To display specific system and software release information, use the showrev command.


$ showrev [-a]

-a

Displays all system release information available. 

Example--Displaying System and Software Release Information

The following example shows showrev command output.


$ showrev -a
Hostname: starbug
Hostid: nnnnnnnn
Release: 5.8
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain: solar.com
Kernel version: SunOS 5.8 s28_26 February 2000

OpenWindows version: 
OpenWindows Version 3.6.2  9 August 1999

No patches are installed
$ 

How to Display General System Information (uname)

To display system information, use the uname command.


$ uname[-a] 

-a

Displays the operating system name as well as the system node name, operating system release, operating system version, hardware name, and processor type. 

Example--Displaying General System Information

The following example shows uname command output.


$ uname
SunOS
$ uname -a
SunOS starbug 5.8 Generic sun4u sparc SUNW,Ultra-5_10
$

How to Display a System's Host ID Number

To display the host identification number in hexadecimal format, use the hostid command.


$ hostid

Example--Displaying a System's Host ID Number

The following example shows sample output from the hostid command.


$ hostid
80a5d34c

How to Display a System's Installed Memory

To display the amount of memory installed on your system, use the prtconf command.


$ prtconf [| grep Memory]

grep Memory

Focuses output from this command to display memory information only. 

Example--Displaying a System's Installed Memory

The following example shows sample output from the prtconf command.


# prtconf | grep Memory
Memory size: 128 Megabytes

How to Display the Date and Time

To display the current date and time according to your system clock, use the date command.


$ date

Example--Displaying the Date and Time

The following example shows sample output from the date command.


$ date
Thu Sep 16 14:06:44 MDT 1999
$

Using Commands to Change System Information

The table below shows man page references and descriptions for some commands that enable you to change general system information.

Table 27-2 Commands for Changing System Information

Command 

Enables You to Change a System's ... 

rdate(1M)

Date and time to match those of another system 

date(1)

Date and time to match your specifications 

Using these commands, you can set a system's date and time to synchronize with the date and time of another system, such as a server. Or you can change a system's date and time by specifying new information.

The message of the day (MOTD) facility, located in /etc/motd, enables you to send announcements or inquiries to all users of a system when they log in. Use this facility sparingly, and edit this file regularly to remove obsolete messages.

By editing the /etc/system file, you can:

Using Network Time Protocol (NTP) in Your Network

The Network Time Protocol (NTP) public domain software from the University of Delaware is included in the Solaris software starting with the Solaris 2.6 release.

NTP enables you to manage precise time and network clock synchronization in a network environment. The xntpd daemon sets and maintains the system time-of-day. The xntpd daemon is a complete implementation of the version 3 standard, as defined by RFC 1305.

The xntpd daemon reads the /etc/inet/ntp.conf file at system startup. See xntpd(1M) for information about configuration options.

Keep the following in mind when using NTP in your network:

How to Set Up an NTP Server

  1. Become superuser.

  2. Change to the /etc/inet directory.

  3. Copy the ntp.server file to the ntp.conf file.


    # cp ntp.server ntp.conf
    
  4. Change to the /etc/init.d directory.

  5. Start the xntpd daemon.


    # ./xntpd start
    

How to Set Up an NTP Client

  1. Become superuser.

  2. Change to the /etc/inet directory.

  3. Copy the ntp.client file to the ntp.conf file.


    # cp ntp.client ntp.conf
    
  4. Change to the /etc/init.d directory.

  5. Start the xntpd daemon.


    # ./xntpd start
    

How to Synchronize Date and Time From Another System

  1. Become superuser.

  2. To reset the date and time to synchronize with another system, use the rdate command.


    # rdate another-system
    

    another-system

    Name of another system. 

  3. Verify that you have reset your system's date correctly by checking your system's date and time using the date command.

    The output should show a date and time that matches that of the other system.

Example--Synchronizing Date and Time From Another System

The following example shows how to use rdate to synchronize the date and time of one system with another. In this example, the system earth, running several hours behind, is reset to match the date and time of the server starbug.


earth# date
Thu Sep 16 11:08:27 MDT 1999
earth# rdate starbug
Thu Sep 16 14:06:37 1999
earth# date
Thu Sep 16 14:06:40 MDT 1999

How to Set a System's Date and Time Manually

  1. Become superuser.

  2. Enter the new date and time.


    # date mmddHHMM[[cc]yy]
    

    mm

    Month, using two digits. 

    dd

    Day of the month, using two digits. 

    HH

    Hour, using two digits and a 24-hour clock. 

    MM

    Minutes, using two digits. 

    cc

    Century, using two digits. 

    yy

    Year, using two digits. 

  3. Verify that you have reset your system's date correctly by checking your system's date and time using the date command with no options.

    The output should show a date and time that matches that of the other system.

Example--Setting a System's Date and Time Manually

The following example shows how to use date to manually set a system's date and time.


# date
Thu Sep 16 14:00:00 MDT 1999
# date 0916141099
Thu Sep 16 14:10:00 MDT 1999

How to Set Up a Message of the Day

  1. Become superuser.

  2. Edit the /etc/motd file and add a message of your choice.

    Edit the text to include the message that will be displayed during the user login process, including spaces, Tabs, and Returns.

  3. Verify the changes by displaying the contents of the /etc/motd.


    $ cat /etc/motd
    Welcome to the UNIX Universe. Have a nice day.

Example--Setting Up a Message of the Day

The default message of the day, provided when you install Solaris software, contains SunOS version information:


$ cat /etc/motd
Sun Microsystems Inc.   SunOS 5.8       Generic  February 2000

The following example shows an edited /etc/motd file that provides information about system availability to each user who logs in.


$ cat /etc/motd
The system will be down from 7:00 a.m to 2:00 p.m.on
Saturday, July 10, for upgrades and maintenance.
Do not try to access the system during those hours.
Thank you... 

How to Set the Number of Processes per User

  1. Become superuser.

  2. Edit the /etc/system file and add the following line.


    set maxuprc=value
    

    value

    Number of processes a user can run at once. 

  3. Verify the maxuprc value change.


    # grep maxuprc /etc/system
    set maxuprc=100
  4. Reboot the system.

Example--Setting the Number of Processes per User

The following example shows the line you would add to the /etc/system file to allow users to run 100 processes each.


set maxuprc=100 

How to Increase Shared Memory Segments

  1. Become superuser.

  2. Edit the /etc/system file and add the following variables to increase shared memory segments.


    set shmsys:shminfo_shmmax=value
    set shmsys:shminfo_shmmin=value
    set shmsys:shminfo_shmmni=value
    set shmsys:shminfo_shmseg=value
    set semsys:seminfo_semmap=value
    set semsys:seminfo_semmni=value
    set semsys:seminfo_semmns=value
    set semsys:seminfo_semmsl=value
    set semsys:seminfo_semmnu=value
    set semsys:seminfo_semume=value
    

    shmsys:shminfo_shmmax

    Maximum shared memory segment size 

    shmsys:shminfo_shmmin

    Minimum shared memory segment size 

    shmsys:shminfo_shmmni

    Number of shared memory identifiers 

    shmsys:shminfo_shmseg

    Number of segments, per process 

    semsys:seminfo_semmap

    Number of entries in the semaphore map 

    semsys:seminfo_semmni

    Number of semaphore identifiers 

    semsys:seminfo_semmns

    Number of semaphores in the system 

    semsys:seminfo_semmsl

    Maximum number of semaphores, per ID 

    semsys:seminfo_semmnu

    Number of processes using the undo facility

    semsys:seminfo_semume

    Maximum number of undo structures per process

  3. Verify the shared memory value changes.


    # grep shmsys /etc/system
    
  4. Reboot the system.


    # init 6
    

Example--Increasing Shared Memory Segments

The following shared memory values accommodate a system with a large amount of memory (for example, 128 MBytes) that is running a large database application.


set shmsys:shminfo_shmmax=268435456
set shmsys:shminfo_shmmin=200
set shmsys:shminfo_shmmni=200
set shmsys:shminfo_shmseg=200
set semsys:seminfo_semmap=250
set semsys:seminfo_semmni=500
set semsys:seminfo_semmns=500
set semsys:seminfo_semmsl=500
set semsys:seminfo_semmnu=500
set semsys:seminfo_semume=100