Adds an event sensor command to the resource monitoring and control (RMC) subsystem.
mksensor [-i seconds] [-n host] [-h ] [-v | -V] name command
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.
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.
If an error occurs in the RMC layer, the RMC return code will be returned as the exit status.
The valid values are:
If this environment variable is not set, local scope is used.
mksensor NumLogins /usr/local/bin/numloginsThe numlogins script looks like this:
#!/usr/bin/perl my @output=`who`; print 'Int32='scalar(@output), "\n"; exit;
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.