Aoik

Statping command service to run a command and check exit code, stdout and stderr

I have made a pull request to add the command service type, which can run a command and check exit code, stdout and stderr.

The command service's config format:

{
  "Cmd": "_CMD_PATH_(required)",
  "Args": [_ARGS_LIST_(optional)],
  "Dir": "_DIR_PATH_(optional)",
  "Env": {_ENV_VARS_MAP_(optional)},
  "Stdin": "_STDIN_STR_(optional)",
  "Stdout": "_STDOUT_REGEX_(optional)",
  "Stderr": "_STDERR_REGEX_(optional)"
}

Example:

{
  "Cmd": "/usr/bin/ping",
  "Args": ["-c", "1", "-W", "1", "example.com"],
  "Stdout": ".+1 received.+"
}

Example:

{
  "Cmd": "/bin/bash",
  "Args": ["-c", "/usr/bin/ping -c 1 -W 1 example.com"]
}

Comments:

Reply to: