Skip to content

Example

Christophe Kalt edited this page Dec 3, 2016 · 2 revisions

Invocation Example

Command

shmux -o /tmp/demo -a lnregex -M 2 -t -c 'echo $$; sleep 1; if test "$$" -gt 1600; then echo "Standard Output"; else echo "Standard Error" 1>&2; fi' somehost host anotherhost randomhost oink

  • Outputs will be saved under /tmp/demo
  • Outputs will be analyzed on the fly, line by line
  • There is a maximum limit of 2 children running at any time
  • A test will be run on each target prior to running the command (to ensure things are sane)
  • The command will be run on 5 target hosts: somehost, host, anotherhost randomhost and oink
  • The command run will simply:
    • echo its PID onto standard output
    • sleep for 1 second
    • echo "Standard Output" on its standard output if its PID is greater than 16000
    • echo "Standard Error" on its standard error if its PID is lower than 16000

Result

Sample shmux invocation

Frame #1

Frame #1

As soon as it starts, shmux spawns two children processes (shown as 2 Active)

Frame #2

Frame #2

Probably as a direct result, the load average slightly raises

Frame #3

Frame #3

This frame shows that 2 tests were completed successfully (2 OK), there is at this instant only one active child.

By default, shmux will only run the command on one target first, and then more once the first command has completed successfully.

(The careful reader will note that another child should have been spawned to run a test command. This was a minor bug which was fixed after these screen shots were taken.)

Frame #5

Frame #5

First line of output from the command running on host.

Frame #6

Frame #6

The command running on host sent output on the standard error (shown in bold) which (by default) is considered an error by the analyzer as shown here.
The command has also completed (shown as 1 Done).

Frame #7

Frame #7

As a result, shmux pauses.

(This default behaviour is configurable.)

Frame #8

Frame #8

Once the user presses the enter key, shmux resumes activity, spawning 2 children right away.

Frame #9

Frame #9

Another test has succeeded.

Frame #11

Frame #11

First line of output from the command running on somehost

Frame #12

Frame #12

More output from the command running on somehost,

first line of output from the command running on anotherhost.

Another target is done.

Frame #13

Frame #13

More output from the command running on anotherhost.

Another target is done.

Frame #15

Frame #15

Another test succeeds.

Frame #17

Frame #17

The last test succeeds.

Frame #18

Frame #18

First line of output from randomhost.

Frame #19

Frame #19

First line of output from oink.

More output from randomhost. As with host this is considered to be erroneous.

At this point shmux would pause again (by default), but as there are no more work to be done, it can't do really so. (Running children cannot be paused.)

Frame #20

Frame #20

More output from oink, again, considered to be erroneous

Frame #21

Frame #21

Upon completion, shmux provides a summary of what was done.

Frame #22

Frame #22