chsensor Command

Purpose

Changes the attributes of a resource monitoring and control (RMC) sensor.

Syntax

chsensor [-m[-i seconds] [ -a | -n host1 [ , host2 , … ] | -N { node_file | "-" } ] [-h] [ -v-V ] sensor_name attr1=value1 [attr2=value2 ...]

Description

The chsensor command changes the attributes of a resource monitoring and control (RMC) sensor. Use the sensor_name parameter to specify which sensor you are changing.

The chsensor command runs on any node. If you want chsensor to run on all of the nodes in a domain, use the -a flag. If you want chsensor to run on a subset of nodes in a domain, use the -n flag. Instead of specifying multiple node names using the -n flag, you can use the -N node_file flag to indicate that the node names are in a file. Use -N "–" to read the node names from standard input.

If Cluster Systems Management (CSM) is installed on your system, you can use CSM defined node groups as node name values to refer to more than one node. For information about working with CSM node groups and using the CSM nodegrp command, see the CSM: Administration Guide and the CSM: Command and Technical Reference.

Flags

-a
Changes sensors that match the specified name on all nodes in the domain. The CT_MANAGEMENT_SCOPE environment variable determines the cluster scope. If CT_MANAGEMENT_SCOPE is not set, first the management domain scope is chosen if it exists, then the peer domain scope is chosen if it exists, and then local scope is chosen, until the scope is valid for the command. The command will run once for the first valid scope found. For example, if both a management domain and a peer domain exist, chsensor -a with CT_MANAGEMENT_SCOPE not set will run in the management domain. In this case, to run in the peer domain, set CT_MANAGEMENT_SCOPE to 2.
-i seconds
Specifies the interval in which the sensor command is run to update the values of the sensor attributes. seconds is an integer value and must be greater than or equal to 10. The sensor command is run at the specified interval only when a sensor resource is monitored. If the interval is set to 0, the sensor command will not be automatically run. Using the refsensor command is independent of interval updates.
-m
Specifies that the resource to be changed is a microsensor resource.
-n host1[,host2…]
Specifies the node on which the sensor should be changed. By default, the sensor is changed on the local node. This flag is only appropriate in a management domain or a peer domain.
-N {node_file | "-"}
Specifies a file or standard input listing the nodes on which the sensor must be removed. This flag is only appropriate in a Cluster Systems Management (CSM) or a peer domain cluster.
-h
Writes the command's usage statement to standard output.
-v │ -V
Writes the command's verbose messages to standard output.

Parameters

sensor_name
Specifies the name of the sensor to change.
attr1=value1 [attr2=value2 ...]
Specifies one or more sensor or microsensor attributes and the their new values.

You can change the values of these sensor attributes:

Name
Specifies the new name of the sensor. If the new name is a string that contains spaces or special characters, it must be enclosed in quotation marks.
ControlFlags
Specifies whether special handling is required for this sensor. You can specify any combination of these values:
0
Indicates that no special handling is required. This is the default.

The sensor command runs at the interval that is defined for sensor_name. The sensor command does not run when monitoring begins or when the lssensor command is run. A sensor command is a command or script that the sensor resource manager runs to set and update a sensor's attribute values.

1
Indicates that the sensor command runs when monitoring begins. The sensor command also runs at the interval that is defined for sensor_name. The sensor command does not run when the lssensor command is run.

Specifying this value is not recommended, unless you expect the sensor command to run quickly. If the sensor command does not run quickly, it could block other requests to the sensor resource manager. These requests are not processed until the sensor command finishes running.

2
Indicates that output from the command in the SavedData field is not saved permanently to SavedData persistent resource attributes. If this value is not specified, the sensor resource manager updates data in the registry's resource table whenever the command's standard output contains the line: SavedData="any-string".
3
Indicates a combination of values 1 and 2
4
Indicates that the sensor resource manager runs the command after monitoring is stopped.
5
Indicates a combination of values 1 and 4.
6
Indicates a combination of values 2 and 4.
7
Indicates a combination of values 1, 2, and 4.
8
Indicates that the sensor resource manager resets the dynamic attribute values after monitoring is stopped.
UserName
Specifies the name of a user whose privileges are used to run the command. The user should already be defined on the system.
Description
Provides a description of the sensor and what it is monitoring.
ErrorExitValue
Specifies which exit values are interpreted as errors, as follows:
0
No exit values are interpreted as errors.
1
Exit values other than 0 are interpreted as errors.
2
An exit value of 0 is interpreted as an error.
If the exit value indicates an error as specified by this attribute, no dynamic attribute values (except ExitValue) are updated.

You can change the values of these microsensor attributes:

Name
Specifies the new name of the microsensor. If the new name is a string that contains spaces or special characters, it must be enclosed in quotation marks.
Description
Provides a description of the microsensor and what it is monitoring.

Security

The user needs write permission for the IBM.Sensor resource class in order to run chsensor. Permissions are specified in the access control list (ACL) file on the contacted system. See the RSCT: Administration Guide 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.
6
No sensor resources were found.
n
Based on other errors that can be returned by the RMC subsystem.

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_IP_AUTHENT
When the CT_IP_AUTHENT environment variable exists, the RMC daemon uses IP-based network authentication to contact the RMC daemon on the system that is specified by the IP address to which the CT_CONTACT environment variable is set. CT_IP_AUTHENT only has meaning if CT_CONTACT is set to an IP address; it does not rely on the domain name system (DNS) service.
CT_MANAGEMENT_SCOPE
Determines the management scope that is used for the session with the RMC daemon to monitor and control the resources and resource classes. The management scope determines the set of possible target nodes where the resources and resource classes can be monitored and controlled.
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.

Implementation Specifics

This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.

Examples

  1. To change the Name attribute of the SensorA sensor to Sensor1A, enter:
    chsensor SensorA Name=Sensor1A
  2. To change the update interval of the SensorA sensor to 10, enter:
    chsensor -i 10 SensorA
  3. To change the Name attribute of the SensorA sensor to Sensor1A on the nodes listed in the /u/joe/common_nodes file, enter:
    chsensor -N /u/joe/common_nodes SensorA Name=Sensor1A

    where /u/joe/common_nodes contains:

    # common node file
    #
    node1.myhost.com    main node
    node2.myhost.com    backup node
  4. To change the Name attribute of microsensor IBM®.msensorq to IBM.MSensorQ, enter:
    chsensor -m IBM.msensorq Name=IBM.MSensorQ

Location

/usr/sbin/rsct/bin/chsensor