lssensor Command
Purpose
Displays information about sensors and microsensors that are defined to the resource monitoring and control (RMC) subsystem.
Syntax
lssensor [-m] [ -a | -n host1[,host2…] | -N { node_file "–" } ] [ -l | -t | -d | -D delimiter ] [-x] [-h] [ -v | -V ] [ -A | sensor_name1 [ sensor_name2…] ]
Description
The lssensor command displays the attributes of one or more sensors. If you do not specify any name parameters, the lssensor command lists the names of all of the sensors. Use the -A flag to list all of the sensors and all of their attributes and values. Use the -m flag to display information about microsensors.
The lssensor command displays values for attributes that you can set using a sensor command or a microsensor module, if the attributes are monitored. If the attributes are not monitored, lssensor does not display their values. A sensor command is a command or script that the sensor resource manager runs to set and update a sensor's attribute values. A microsensor module is a loadable module that the microsensor resource manager runs to set and update a microsensor's attribute values.
Use the -l, -t, -d, or -D flags to display the output in long format, table format, or delimiter format. The -x flag omits headings when any of these flags are used.
The lssensor command runs on any node. If you want lssensor to run on all of the nodes in a domain, use the -a flag. If you want lssensor 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.
Field | Description |
---|---|
Name | The name of the sensor. |
Command | The command that is run to update the sensor attributes |
ConfigChanged | Information about changes to access or to persistent attributes |
ControlFlags | Indicates whether any special handling is required for this sensor |
Description | This field is not used |
ErrorExitValue | Indicates how the exit value is interpreted by the sensor resource manager |
ErrorMessage | This field is not used |
ExitValue | The exit code from the command that is running |
Float32 | The type float32 attribute for this sensor resource |
Float64 | The type float64 attribute for this sensor resource |
Int32 | The type int32 attribute for this sensor resource |
Int64 | The type int64 attribute for this sensor resource |
MonitorStatus | This attribute is set to 1 when certain sensor attributes are being monitored |
NodeNameList | The name of the node where the sensor resource is defined |
RefreshInterval | The interval (in seconds) during which the sensor attribute values are updated when the sensor command is run |
SavedData | An output string from the sensor command |
SD | Contains all dynamic resource attributes except ConfigChanged, Quantum, and ExitValue as its elements |
String | The type string attribute for this sensor resource |
TimeCommandRun | Indicates the date and time that the sensor command was run |
Uint32 | The type uint32 attribute for this sensor resource |
Uint64 | The type uint64 attribute for this sensor resource |
UserName | The user ID that is used when run the sensor command is run |
Field | Description |
---|---|
Name | The name of the microsensor. |
ActivePeerDomain | The peer domain for which information is being displayed. |
Arguments | The arguments for this microsensor resource. |
ConfigChanged | Information about changes to persistent attributes or to access. |
CustomDynamicAttributes | The custom dynamic attributes for this microsensor resource. |
Description | Information about the microsensor and what it monitors. |
Float32 | The type float32 attribute for this microsensor resource. |
Float32Array | The type float32 array attribute for this microsensor resource. |
Float64 | The type float64 attribute for this microsensor resource. |
Float64Array | The type float64 array attribute for this microsensor resource. |
Int32 | The type int32 attribute for this microsensor resource. |
Int32Array | The type int32 array attribute for this microsensor resource. |
Int64 | The type int64 attribute for this microsensor resource. |
Int64Array | The type int64 array attribute for this microsensor resource. |
LastQueryRC | The return code from the microsensor module from the last time the microsensor was called for an attribute of the microsensor resource. |
LastQueryTime | The time of LastQueryRC. |
ModuleName | The path name to the loadable microsensor module. |
MonitorStatus | This attribute is set to 1 when any of the other microsensor attributes is being monitored. |
NodeNameList | The name of the node where this microsensor is defined. |
RefreshInterval | The interval (in seconds) during which the microsensor attribute values are updated when the microsensor callback is called. |
String | The type string attribute for this microsensor resource. |
StringArray | The type string array attribute for this microsensor resource. |
UInt32 | The type uint32 attribute for this microsensor resource. |
UInt32Array | The type uint32 array attribute for this microsensor resource. |
UInt64 | The type uint64 attribute for this microsensor resource. |
UInt64Array | The type uint64 array attribute for this microsensor resource. |
Flags
- -a
- Lists 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, lssensor -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.
- -A
- Displays all of the sensors with their attributes and values.
- –d
- Specifies delimiter-formatted output. The default delimiter is a colon (:). Use the -D flag if you want to change the default delimiter.
- –D delimiter
- Specifies delimiter-formatted output that uses the specified delimiter. Use this flag to specify something other than the default colon (:). An example is when the data to be displayed contains colons. Use this flag to specify a delimiter of one or more characters.
- –l
- Specifies that the information be displayed in "long" format. Each attribute is displayed on a separate line.
- -m
- Specifies that information about microsensors will be displayed.
- -n host1[,host2…]
- Specifies the node from which the sensor should be listed. By default, the sensor is listed from the local node. This flag is only appropriate in a management domain or a peer domain.
- -N {node_file | "-"}
- Specifies that node names are read from a file or from standard
input. Use -N node_file to indicate that the node names
are in a file.
- There is one node name per line in node_file
- A number sign (#) in column 1 indicates that the line is a comment
- Any blank characters to the left of a node name are ignored
- Any characters to the right of a node name are ignored
- –t
- Specifies table format. Each attribute is displayed in a separate column, with one sensor resource per line.
- -x
- Suppresses header printing when -l, -t, -d, or -D is specified.
- -h
- Writes the command's usage statement to standard output.
- -v │ -V
- Writes the command's verbose messages to standard output.
Parameters
- sensor_name1 [sensor_name2…]
- Specifies the names of one or more sensors to display.
Security
To display sensor information using this command, you need read permission for the IBM®.Sensor resource class. To display microsensor information using this command, you need read permission for the IBM.MicroSensor resource class. Permissions are specified in the access control list (ACL) file on the contacted system. See the Administering RSCT 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.
Implementation Specifics
This command is part of the Reliable Scalable Cluster Technology (RSCT) fileset for AIX®.
Examples
- To list the names of all of the sensors, enter:
The output will look like this:lssensor
sensor1 sensor2 sensor3
- To list the names and attributes of all sensors, enter:
The output will look like this:lssensor -A
Name = sensor1 ActivePeerDomain = Command = /usr/local/bin/sensorcmd1 ConfigChanged = 0 ControlFlags = 1 Description = ErrorExitValue = 1 ExitValue = 0 Float32 = 1.06381e+06 Float64 = 1.06381e+06 Int32 = 1063814 Int64 = 1063814 NodeNameList = {somenode.pok.ibm.com} RefreshInterval = 60 SavedData = Last SavedData SD = [string from sensor1,1063814,1063814,1063814,1063814,1.06381e+06,1.06381e+06] String = string from sensor1 Uint32 = 1063814 Uint64 = 1063814 UserName = root ------------------- Name = CFMRootModTime ActivePeerDomain = Command = /opt/csm/csmbin/mtime/cfmroot ConfigChanged = 0 ControlFlags = 0 Description = ErrorExitValue = 1 ExitValue = 0 Float32 = 0 Float64 = 0 Int32 = 0 Int64 = 0 NodeNameList = {somenode.pok.ibm.com} RefreshInterval = 60 SavedData = SD = [,0,0,0,0,0,0] String = Uint32 = 0 Uint64 = 0 UserName = root ------------------- Name = ErrorLogSensor ActivePeerDomain = Command = /opt/csm/csmbin/monerrorlog ConfigChanged = 0 ControlFlags = 0 Description = ErrorExitValue = 1 ExitValue = 0 Float32 = 0 Float64 = 0 Int32 = 0 Int64 = 0 NodeNameList = {somenode.pok.ibm.com} RefreshInterval = 60 SavedData = SD = [,0,0,0,0,0,0] String = Uint32 = 0 Uint64 = 0 UserName = root ------------------- . . .
- To list the attributes of sensor2, enter:
The output will look like this:lssensor sensor2
Name = sensor2 Command = /usr/local/bin/sensorcmd2 ConfigChanged = 0 ControlFlags = 0 Description = ErrorExitValue = 1 ExitValue = 127 Float32 = 0 Float64 = 0 Int32 = 0 Int64 = 0 NodeNameList = {somenode.pok.ibm.com} RefreshInterval = 60 SavedData = SD = [,0,0,0,0,0,0] String = Uint32 = 0 Uint64 = 0 UserName = root
- To list all of the sensors' information using delimited output,
enter:
The output will look like this:lssensor -dA
Displaying sensor information: Name:ActivePeerDomain:Command:ConfigChanged:ControlFlags:Description:ErrorExitValue:ErrorMessage:ExitValue: Float32:Float64:Int32:Int64:MonitorStatus:NodeNameList:RefreshInterval:SD:SavedData: String:TimeCommandRun:Uint32:Uint64:UserName: JoeExample:JoeDomain:cat /etc/motd:0:0::1::0: ::::0:{node1.myhost.com}:60:[,0,0,0,0,0,0]:: :Fri Feb 6 19:00:00 2009:::root: JoeSample:JoeDomain:/opt/rsct/install/bin/ctversion:0:0::1::0: ::::0:{node1.myhost.com}:60:[,0,0,0,0,0,0]:: :Fri Feb 6 19:00:00 2009:::root: JoeSens:JoeDomain:/tmp/sensor/numusers:0:1::1::0: ::::0:{node1.myhost.com}:0:[,2,0,0,0,0,0]:: :Tue Mar 3 10:27:19 2009:::root:
- To list the names of all of the sensors on the nodes that are
listed in the /u/joe/common_nodes file, enter:
where /u/joe/common_nodes contains:lssensor -N /u/joe/common_nodes
The output will look like this:# common node file # node1.myhost.com main node node2.myhost.com backup node
sensor1 sensor2 sensor3
- To list the names of all of the microsensors, enter:
The output will look like this:lssensor -m
IBM.MSensor1 IBM.MSensor2 IBM.MSensor3
- To list the attributes of the microsensor IBM.MSensor2, enter:
The output will look like this:lssensor -m IBM.MSensor2
Name = IBM.MSensor2 ActivePeerDomain = Arguments = all ConfigChanged = 0 CustomDynamicAttributes = {[CDA1,19,1,3,0,1],[CDA2,20,2,2,0,1],[CDA3,21,3,2,0,1] Description = Float32 = Float32Array = Float64 = Float64Array = Int32 = 52 Int32Array = {36, 45, 2, 73} Int64 = Int64Array = LastQueryRC = 0 LastQueryTime = Tue Mar 31 18:00:00 2009 ModuleName = /usr/slib/msensors/sensor2 MonitorStatus = 0 NodeNameList = {node2.gumby.com} RefreshInterval = 600 String = StringArray = UInt32 = UInt32Array = UInt64 = UInt64Array =
Location
- /opt/rsct/bin/lssensor