Collecting SmartOS system information

Modified: 09 Mar 2023 22:10 UTC

SmartOS infrastructure containers provisioned from an image include pre-defined scripts for collecting information on how your infrastructure container is using various resources.

Memory system information

The sm-meminfo script collects information about how your system uses memory compared to the total amount installed.

Before you begin

Before invoking this script, ensure you know the following. You will pass these in as arguments for the script:

Invoking the script

To invoke the script:

  1. SSH into the machine.
  2. Run the sm-meminfo command specifying the type of memory and if you want to generate the information in a machine-readable format. The script will gather memory system information and display it onscreen.

CPU system information

The sm-cpuinfo script collects information about how your system uses available CPU resources compared to the total amount available.

Invoking the Script

To invoke the script:

  1. SSH into your machine.
  2. Run the sm-cpuinfo command. The script will gather CPU system information and display it onscreen. For example:

    # sm-cpuinfo
    * Gathering cpu infomation for 9272333a-80dc-4a2d-a0b6-321e9e4f5a93..
    CPU Cap Used: 6 %
    System CPU Used: 0.0 %

System summary

The sm-summary script collects a basic system summary that includes important properties of the system. The information collected from this script is useful for troubleshooting possible issues that you can quickly share with support representatives. This script also provides information about installed memory and memory usage.

Invoking the script

To invoke the script:

  1. SSH into your machine.
  2. Run the sm-summary command. The script will gather information on system properties and display it onscreen. For example:
    # sm-summary
    * Gathering SmartMachine summary..
    SM UUID             9272333a-80dc-4a2d-a0b6-321e9e4f5a93
    SM ID               257
    Hostname            mydomain.com
    SmartOS build       joyent_20120126T071347Z
    Dataset             newds 3.4.41
    Pkgsrc              https://pkgsrc.smartos.org/sdc6/2011Q4/i386/All
    Processes           42
    Memory (RSS) Cap    2048M
    Memory (RSS) Used   206M
    Memory (RSS) Free   1842M
    Swap Cap            4096M
    Swap Used           574M
    /tmp Used           4.0K
    Disk Quota          62G
    % Disk Used         4%

Working with timezones

You can use the timezone scripts to find a specific timezone and set your SmartMachine to that timezone. These scripts are located in /opt/local/bin/sm-list-timezones and /opt/local/bin/sm-set-timezone respectively.

Listing timezones

Use this script to generate a list of values that you can use with the sm-set-timezone command. You invoke this script by running the sm-list-timezones command. The location of this script is /opt/local/bin/sm-list-timezones.

Invoking the script

To invoke the script:

  1. SSH into your system.
  2. Run the sm-list-timezones command. The script will generate a large list of timezone values that you can then use with the sm-set-timezone command.

    # sm-list-timezones
    * Listing timezones for 9272333a-80dc-4a2d-a0b6-321e9e4f5a93..
    Africa/Abidjan
    Africa/Accra
    Africa/Addis_Ababa
    Africa/Algiers
    Africa/Asmara
    Africa/Asmera
    Africa/Bamako
    Africa/Bangui
    Africa/Banjul
    ...

Setting a timezone

Use this script to set the timezone to the region you specify. You invoke this script by running the sm-set-timezone command. The location of this script is /opt/local/bin/sm-set-timezone.

Before you begin

Before invoking this script, ensure you know the following. You will pass this in an argument for the script:

Invoking the script

To invoke the Script:

  1. SSH into your system.
  2. Run the sm-set-timezone command specifying the timezone to which you want to set the SmartMachine. For example:

    # sm-set-timezone US/Pacific-New
    * Setting timezone for 9272333a-80dc-4a2d-a0b6-321e9e4f5a93..
    * Changed to timezone to US/Pacific-New.  You will need to reboot.
  3. The script will set the timezone and prompt you to reboot the system for the change to take affect.

  4. Reboot the system.

You can reboot the system by running the sm-reboot script.

Process mapping

Use this script to determine how processes are mapped to ports, files, and directories. You invoke this script by running the sm-lsof command. The location of this script is /opt/local/bin/sm-lsof.

Available options

Option Description
-p Displays port information for all running processes including the associated process ID (PID), IP, and port.
-f Displays file information for all processes on the system including the associated process ID and file/device.
-P <PID> Displays all ports used for a process specified by the process ID.
-F <PID> Displays all files used for a process specified by the process ID.
-o <port> Displays all processes that map to the specified port.
-i <file> Displays all processes that map to the specified file.
-d <directory> Displays all processes that map to the specified directory.

Invoking the script

To invoke the script:

  1. SSH into your system.
  2. Run the sm-lsof command specifying an option: