| Line | |
|---|
| 1 |
<module> |
|---|
| 2 |
<name>external</name> |
|---|
| 3 |
<description><para>The external module performs checks via external processes like more traditional monitoring systems. While this approach is far less efficient and does not scale well on a single system, it provides easier transition from existing monitoring systems. Checks should exit normally with an exit status of 0 for success, 1 or 2 for failure and 3 for unknown. Exiting with a status of 3 is highly discouraged. The standard output is provided as the status of the check.</para></description> |
|---|
| 4 |
<loader>C</loader> |
|---|
| 5 |
<image>external.so</image> |
|---|
| 6 |
<moduleconfig> |
|---|
| 7 |
<parameter name="user" |
|---|
| 8 |
required="optional" |
|---|
| 9 |
allowed=".+">The user under which the external checks should be executed.</parameter> |
|---|
| 10 |
<parameter name="group" |
|---|
| 11 |
required="optional" |
|---|
| 12 |
allowed=".+">The group under which the external checks should be executed.</parameter> |
|---|
| 13 |
</moduleconfig> |
|---|
| 14 |
<checkconfig> |
|---|
| 15 |
<parameter name="command" |
|---|
| 16 |
required="required" |
|---|
| 17 |
allowed=".+">The path to the command to be executed. This is the first argument to the execve system call.</parameter> |
|---|
| 18 |
<parameter name="arg0" |
|---|
| 19 |
required="optional" |
|---|
| 20 |
allowed=".+">The program name. If not specified, it is derived from the command argument. Normal interpolation rules apply.</parameter> |
|---|
| 21 |
<parameter name="arg\d+" |
|---|
| 22 |
required="optional" |
|---|
| 23 |
allowed=".+">The arguments to the program. The external module will start with arg1 and increment collecting arguments until argN is not found. Normal interpolation rules apply.</parameter> |
|---|
| 24 |
<parameter name="env_\S+" |
|---|
| 25 |
required="optional" |
|---|
| 26 |
allowed=".+">These parameters allow the setting of environment variables for the command execution. The text following env_ is the key and the parameter value is the value of the environment variable to be set via execve.</parameter> |
|---|
| 27 |
</checkconfig> |
|---|
| 28 |
<examples> |
|---|
| 29 |
<example> |
|---|
| 30 |
<title>Checking a service via the /path/to/check_foo command.</title> |
|---|
| 31 |
<para>The hypothetical check_foo command takes a target host with the -H parameter, runs a check and returns its health via exit code and stdout. We set the environment variable QUUX to the value BAZ. The check is against host 10.10.2.2.</para> |
|---|
| 32 |
<programlisting><![CDATA[ |
|---|
| 33 |
<noit> |
|---|
| 34 |
<modules> |
|---|
| 35 |
<module image="external" name="external"/> |
|---|
| 36 |
</modules> |
|---|
| 37 |
<checks> |
|---|
| 38 |
<check uuid="1e8edc38-0d88-11de-93ee-af2195eab5d5" |
|---|
| 39 |
module="external" name="foo" target="10.10.2.2"> |
|---|
| 40 |
<config> |
|---|
| 41 |
<command>/path/to/check_foo</command> |
|---|
| 42 |
<arg1>-H</arg1> |
|---|
| 43 |
<arg2>%[target]</arg2> |
|---|
| 44 |
<env_QUUX>BAZ</env_QUUX> |
|---|
| 45 |
</config> |
|---|
| 46 |
</check> |
|---|
| 47 |
</checks> |
|---|
| 48 |
</noit> |
|---|
| 49 |
]]></programlisting> |
|---|
| 50 |
</example> |
|---|
| 51 |
</examples> |
|---|
| 52 |
</module> |
|---|