The Challenge

Metric extensions for running shell commands isn’t as straight-forward as you might hope.  But it doeable.

In the Metric Extension wizard you are provided with various input fields when creating a new adapter.


The Solution

To execute a shell command

  1. Enter the name of your shell in the Command field
  2. Upload a simple script file into the Script field

In this case the script consists of a single line:

ls -l /etc | grep centrifyfd | wc -l

Rabbit Holes

  1. Simply typing the shell command in the Command field does not work
  2. Entering the shell in Command field and typing the command in the Script field doesn’t work either

In both cases I received errors about the ‘ls‘ utility not found (even when qualified with a path) or no permission to execute ‘ls‘.