Skip to content

Log Insight: li_rexec

One of the great things about Log Insight is that you do not need a CLI to use it. If you do decide to use the CLI you may find yourself wishing to execute commands on every node in a Log Insight cluster. While this can be done with a simple for loop, I wrote a quick wrapper script to make it even easier.

WARNING: This script is not supported by VMware or me. Use at your own risk!

From any node within a Log Insight cluster you can determine all other nodes in the cluster. This means with a simple wrapper script you can point to a single node like a master, worker, or VIP and based on configuration data, issue a command to all nodes within the cluster. Note that this script uses SSH so you will want to have SSH keys configured on the nodes. To use the script I created, simply run li_rexec:

As you can see, the script requires two inputs being the Log Insight instance (e.g. master, worker, VIP, standalone) and the command(s) you wish to run. By default the output is not very verbose:

To make the output more verbose, use the -v flag at the end of the command:

That’s it! So without further adieu, here is the script:

© 2015, Steve Flanders. All rights reserved.

Published inVMware

Be First to Comment

    Leave a Reply

    Your email address will not be published. Required fields are marked *