Using REXEC to Query UNIX

Establish a connection to a UNIX-based system that uses the Remote Execution Protocol and add the measures that you want to monitor.

  1. On the Real-Time Monitoring tab, in the Monitor group, click System.
  2. Click Select from predefined Data Sources and then click Next.
  3. Expand the Custom Data folder, click Rexec Data, and then click Next.
  4. In the Hostname text box, specify the machine to be monitored.
  5. Optional: In the Alias text box, specify the alias name. The alias must be a highly descriptive synonym for the monitored server. It is recommended that you group measures on a particular machine. For example, both WebLogic and IIS might be installed on the same computer. Both servers require monitoring, but the two performance measures must appear in separate menu trees.
  6. Specify the port, username, and password that are appropriate for the username.
  7. Click Next. The Add Rexec Measures page opens.
  8. Specify the appropriate values to create the measure that you want to monitor.
    Option Description
    Measure type For the specified command, enter a type name. All measurements with the same type name are assembled into one group.
    Measure name Enter the measurement name for the specified rexec command. This name is displayed in the Performance Explorer chart.
    Is an average measure Check this check box for the rexec command to be considered an average measurement. This setting affects only the generation of TSD files.
    Explanation Type additional information for the specified rexec command. This information is displayed in Performance Explorer.
    Command Specify the rexec command to execute on the remote machine for data collection, such as ps -ef | egrep -c “.*”
    Single execution Check this check box if you want the PDCE to connect to the remote machine and execute the command every time a new data point is requested. With short intervals, this setting might place some load on the remote machine. However, the PDCE does not start a new command on the remote machine if the command of the last interval has not finished.

    By unchecking the Single execution check box, multiple execution is enabled.

    Regular expr Every line of data that is returned by the remote machine is filtered by using the given regular expression. If the regular expression does not match a certain line, the line is discarded. Only the remaining lines are used for further steps. By default, ^.*$ are entered.
    For example, a command's response might appear as follows for each interval:
    XXXXXXXX XXXXXXXX XXXXXXXXX
             123400   103093   121092
    Only the lines with numbers are of interest. The following regular expression allows only lines with numbers and spaces.
    [1234567890 ].*
    Any other lines are ignored.
    Field index The line used for data generation is separated into fields. The separation is accomplished by using either white-space characters or custom separator characters.

    Use this text box to specify the field index that must be converted into a numerical value and used as the next measurement value.

    This index is a one-based index.

    Separators Use this text box to specify the custom separator characters to use to separate the lines for data generation into fields.

    By default, the Whitespaces are separators check box is checked.

    Whitespaces are separators Check this check box to insert a separator for each empty space.
    Lines to skip Use this text box to specify the number of lines the PDCE ignores after the start of the command on the remote machine. This option might be useful to filter out garbage data that the command returns at the beginning. Only lines that match the provided regular expression use this setting. If more than one valid line is provided for an interval, the last line is used for data calculation.
  9. Click Add.
  10. Repeat the previous steps until you have entered all the commands that you require for measure collection, then click Close. The Select displayed measures page opens.
  11. Check the check boxes for those measures that you want to include in the initial monitor view and then click Finish.
A connection to the specified host is established, and an initial view that contains the measures you selected is displayed.

Example

Enter the command, in slightly modified form, that was used when defining multiple executions as follows:
while [true]; do
  ps -ef | egrep -c “.*”;
  sleep {%Interval};
done
Note: The command sleep {%Interval} is a placeholder for a number provided by Performance Explorer. This number is the collection interval. For example, Performance Explorer might collect new data every five seconds.
A command's response might appear as follows for each interval:
XXXXXXXX XXXXXXXX XXXXXXXXX
         123400   103093   121092

The Field index value specifies the column that is relevant for your defined measure. If Field index 1 is specified, the value 123400 is returned from the table. If Field index 2 is specified, the value 103093 is returned.

Columns in the preceding example are separated by white spaces. However, other characters, such as colons, can be used. Such values are specified in the Separators text box. White spaces are the default separators.