Class CommandLineSourceProcessor

java.lang.Object
org.sentrysoftware.metricshub.extension.oscommand.CommandLineSourceProcessor

public class CommandLineSourceProcessor extends Object
Processes command-line data sources to extract and transform the output into structured SourceTable format. This class handles the execution of operating system commands provided through CommandLineSource, applies line and column filtering, and builds a structured table from the results.
  • Constructor Details

    • CommandLineSourceProcessor

      public CommandLineSourceProcessor()
  • Method Details

    • process

      public SourceTable process(CommandLineSource commandLineSource, String connectorId, TelemetryManager telemetryManager)
      Processes an OS command defined in a CommandLineSource, executes it, and converts the output into a structured SourceTable.
      Parameters:
      commandLineSource - The command line source configuration containing the command, filtering, and selection settings.
      connectorId - Identifier for the connector instance processing this source.
      telemetryManager - Provides access to system and host configurations necessary for command execution.
      Returns:
      A SourceTable containing the processed and formatted output of the OS command. Returns an empty table if an error occurs or if the command line is invalid.