Using COMMAND Collections in the Extractor

The COMMAND Extractor provides a means for data to be extracted from the output generated by specified command entries into Records. The actual command entry is placed into the <input-filename> parameter of the EXTRACTOR Configuration, this entry can be any appropriate Windows, UNIX or HPE NonStop command, such as DIR, USRSTAT, TYPE, FUP etc...

For full detail on the Extractor Configuration, refer to EXTRACTOR Configuration Syntax.

Example:

If the collection interval is 10 seconds then the COMMAND "getfiles.bat %s" will be expanded to "getfiles.bat 10" as it is executed.

EXTRACT COMMAND (FSCOL, TEST.EXE, getfile.bat %s, 0)

Example:

%u  Where %u contains a unique number for each request.

EXTRACT COMMAND (FSCOL, TEST.EXE, ECHO %u, 0)

View Based Commands

In normal situations the COMMAND Extractor forces views, such as Displays, Thresholds and Analysts, to receive information from a single data source, this can limit the ability to perform cross-interval calculations. To overcome this limitation the 'OneExtractorPerView' parameter can be used in the EXTRACTOR Configuration. This parameter takes the options of '0' for a single data source or '1' for a separate data source for each view.

Example:

EXTRACT COMMAND (FSCOL, DIR.EXT, DIR \-C, 0, 0, , ,OneExtractorPerView=0)

In addition, a global configuration entry can be made using the EXTRACT CONFIG statement which will affect all scripts executed by the specified server.

EXTRACT CONFIG (<extractor-name>, OneExtractorPerView, <n>)

Example

EXTRACT CONFIG (FSCOL, OneExtractorPerView, 1)

Extractor Command Behavior (for HPE NonStop)

Extractor commands behave differently when executed from a command line rather than from a process. When you want to find out what a command does, execute the command to an output file, then use this output to help you create scripts. Do not execute the command to the screen, as the View format is different from the Report format.

Example:

MEDIACOM Report format output (view output with PERUSE):

MEDIACOM /IN [#MYTERM], OUT $S.#TAPE/ STATUS TAPEDRIVE

MEDIACOM View format output:

MEDIACOM /IN [#MYTERM]/ STATUS TAPEDRIVE

It is the former output that the Extractor receives when it executes the MEDIACOM command.

Provide feedback on this article