System information(n) "System and processor"

NAME

System information - Functions for retrieving system and processor information

SYNOPSIS

package require twapi

get_os_version
min_os_version osmajor ?osminor? ?spmajor? ?spminor?
get_os_info
get_os_description
get_processor_info PROCESSOR ?options?
get_computer_netbios_name

DESCRIPTION

This module provides procedures for retrieving system configuration including operating system and processor information.

Overview

The commands get_os_version and min_os_version get and verify operating system version information.

The commands get_os_info and get_os_description allow retrieval of more detailed operating system information than the standard Tcl commands which do not distinguish between service packs, Professional versus Server versions and so on.

The command get_computer_netbios_name returns the NETBIOS name of the computer.

The command get_processor_info retrieves information about the processors in the system including type and utilization.

Commands

get_os_version
This command returns the operating system version as list of four elements - the operating system major version number, the operating system minor version number, the service pack major version number, the service pack minor version number.

min_os_version osmajor ?osminor? ?spmajor? ?spminor?
This function checks that the operating system version meets the specified minimum version. It returns 1 if the operating system version is greater than osmajor.osminor.spmajor.spminor. Otherwise it returns 0.

get_os_info
This command retrieves operating system version and configuration information and returns a keyed list with the following fields:

platform
String identifying the operating system base platform. Currently this is always NT.

os_major_version
Major operating system version.

os_minor_version
Minor operating system version.

sp_major_version
Major service pack version.

sp_minor_version
Minor service pack version.

os_build_number
Contains the operating system build number.

system_type
Indicates the operating system base type. This is workstation for Windows NT 4.0 Workstation, Windows 2000 Professional, or any Windows XP operating system versions. If the system is a domain controller, this value is domain_controller. In all other cases, this value is server.

suites
Contains a list of values (see below) that indicate various options that may be installed as part of the operating system.


The suites element in the returned array contains a list of values from the following set that indicates additional operating system components that are present:

backoffice
Microsoft BackOffice components are installed

blade
Windows .NET Server 2003 family Web Edition is installed

terminal
Terminal Services are installed

datacenter
Windows 2000 Datacenter Server or Windows .NET Server 2003 family Datacenter Edition is installed

enterprise
Windows NT 4.0 Enterprise Edition, Windows 2000 Advanced Server, or Windows .NET Server 2003 family Enterprise Edition is installed

smallbusiness
Microsoft Small Business Server is installed

smallbusiness_restricted
Microsoft Small Business Server is installed with the restrictive client license in force

personal
Windows XP Home Edition is installed


get_os_description
This commmand returns the same operating system information as returned by get_os_info but in a form suitable for displaying to a user.

get_processor_info PROCESSOR ?options?
Returns various pieces of information related to the processors in the system. PROCESSOR identifies the processor whose information is to be retrieving. If specified as an empty string, information across all processors in the system is returned. The information returned is in the form of a flat list of the form "field1 value1 field2 value2 ...". The fields returned depend on the specified options and their values may be scalars (e.g. -name) or rate based measured over an interval (e.g. -processorutilization). The option -interval may be used to indicate the interval over which the rate based fields are measured. One of more of the following options may be specified with the command:

-all
Returns all fields listed below.

-apcbypassrate
Returns the field apcbypassrate which is the rate (per second) that kernel APC interrupts were bypassed as computed over the measured interval.

-dpcbypassrate
Returns the field dpcbypassrate which is the rate (per second) that deferred procedure calls were avoided as computed over the measured interval.

-dpcqueuerate
Returns the field dpcqueuerate containing the rate at which deferred procedure calls are being added to the DPC queue as measured over the specified interval.

-dpcrate
Returns the field dpcrate containing the rate at which deferred procedure calls are being added to the DPC queue. This rate is based on the observed value over the last two timer ticks of the processor clock, and not that over the measured interval.

-dpcutilization
Returns the field dpcutilization containing the percentage of time that this processor has spent servicing deferred procedure calls over the measured interval. This is included in the privilegedutilization value.

-interruptrate
Returns the field interruptrate containing the number of hardware interrupts being processed per second over the measured interval.

-interruptutilization
Returns the field interruptutilization containing the percentage of time that this processor has spent servicing interrupts over the measured interval. This is included in the privilegedutilization value.

-privilegedutilization
Returns the field privilegedutilization containing the percentage of time that this processor has spent executing a non-idle thread in privileged mode during the measured interval.

-processorutilization
Returns the field processorutilization containing the percentage of CPU time that this processor has been executing a non-idle thread over the measured interval.

-userutilization
Returns the field userutilization containing the percentage of time that this processor has spent executing a non-idle thread in user mode during the measured interval.


get_computer_netbios_name
Returns the NETBIOS name of the computer.

KEYWORDS

CPU utilization, computer name, interrupts, operating system components, operating system version, performance

COPYRIGHT

Copyright © 2003, Ashok P. Nadkarni