[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 3

mksensor Command

Purpose

Adds an event sensor command to the resource monitoring and control (RMC) subsystem.

Syntax

mksensor [-i seconds] [-n host] [-h ] [-v | -V] name command

Description

The mksensor command adds the specified command to the resource monitoring and control (RMC) subsystem to be run periodically to retrieve a user-defined value from the system. Usually this value is used to cause an event to occur by means of the event response resource manager (ERRM). For example, if the specified command returns the number of users logged on to the system (a variable that none of the standard RMC resource managers return currently), an ERRM condition and response can be written to run a response when the number of users logged on exceeds a certain value. This enables administrators to extend the RMC monitoring capabilities without having to write a resource manager.

The specified command returns the value it retrieves from the system by sending it to standard output in the form prop=value. The property name used depends on the type of the value and is one of these: String, Int32, Uint32, Int64, Uint64, Float32, Float64, or Quantum. If only the value is sent to standard output, the property name is assumed to be String.

If more than one type of data is to be returned, a series of prop=value pairs are sent to standard output, separated by blanks, for example: Int32=10 String="abcdefg". These property names are also the dynamic properties that can be used in the ERRM condition. The exit value of the script is stored in the dynamic property ExitValue and can also be used in an ERRM condition. When the ERRM condition is written, the IBM.Sensor resource class should be specified, and the selection string should normally be name='name', where name is the name of the sensor being defined by this mksensor command.

The command parameter represents the command that should be run periodically to retrieve the desired system value. By default, this command is run by RMC under the same user name that originally ran the mksensor command to add this sensor.

The mksensor command can be run on the management server or on any node. It normally operates on the local node where it is run unless the CT_CONTACT environment variable is set. If you want mksensor to run on all of the nodes in a domain, use the CT_MANAGEMENT_SCOPE environment variable. See the Environment variables section for more information.

This command returns the error messages and exit status of the underlying RMC command mkrsrc.

Flags

-i seconds
Specifies how often to periodically run the command. This interval is in seconds. The minimum value is 10 seconds. The default value is 60 seconds.
-n host
Specifies the node on which the sensor should be created. By default, the sensor is created on the local node. This flag is only appropriate in a management domain or a peer domain.
-h
Writes the command's usage statement to standard output.
-v | -V
Writes the command's verbose messages to standard output. Use this flag to see the underlying RMC command that is being run. This can help to interpret error messages that are displayed.

Parameters

name
Specifies the name of the sensor that is being created.
command
Specifies the command that should be run to retrieve the system value that this sensor monitors.

Security

The user needs write permission for the IBM.Sensor resource class in order to run mksensor. Permissions are specified in the access control list (ACL) file on the contacted system. See the RSCT Guide and Reference for details on the ACL file and how to modify it.

Exit Status

0
The command has run successfully.
1
An incorrect combination of flags and parameters has been entered.

If an error occurs in the RMC layer, the RMC return code will be returned as the exit status.

Environment Variables

CT_CONTACT
When the CT_CONTACT environment variable is set to a host name or IP address, the command contacts the resource monitoring and control (RMC) daemon on the specified host. If this environment variable is not set, the command contacts the RMC daemon on the local system where the command is being run. The resource class or resources that are displayed or modified by the command are located on the system to which the connection is established.
CT_MANAGEMENT_SCOPE
Determines the management scope used for the command's RMC daemon session.

The valid values are:

0
Specifies local scope.
1
Specifies local scope.
2
Specifies peer domain scope.
3
Specifies management domain scope.

If this environment variable is not set, local scope is used.

Examples

  1. To create a new sensor called NumLogins that runs a script called numlogins to find out how many users are currently logged in, enter:
    mksensor NumLogins /usr/local/bin/numlogins
    The numlogins script looks like this:
    #!/usr/bin/perl
    my @output=`who`;
    print 'Int32='scalar(@output), "\n";
    exit;

Location

/usr/sbin/rsct/bin/mksensor
Contains the mksensor command

Related Information

Commands: chsensor, lscondition, lssensor, mkcondition, mkcondresp, mkresponse, mkrsrc, rmsensor

Files: see the rmccli man page for information about prop=value syntax.

Books: see the RSCT Guide and Reference for information about the ACL authorization file, ERRM, and ERRM environment variables.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]