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 |
<parameter name="output_extract" |
---|
28 |
required="optional" |
---|
29 |
allowed=".+">This is a regular expression that is globally applied to the stdout of the command. Each match is turned into a metric. It is a requirement to used named capturing in the regular expression where "key" is the named match of the metric name and "value" is the named match for the matric value. A sample for extracting performance data from Nagios commands would be: <![CDATA[(?<key>\S+)=(?<value>[^;\s]+)(?=[;\s])]]></parameter> |
---|
30 |
</checkconfig> |
---|
31 |
<examples> |
---|
32 |
<example> |
---|
33 |
<title>Checking a service via the /path/to/check_foo command.</title> |
---|
34 |
<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> |
---|
35 |
<programlisting><![CDATA[ |
---|
36 |
<noit> |
---|
37 |
<modules> |
---|
38 |
<module image="external" name="external"/> |
---|
39 |
</modules> |
---|
40 |
<checks> |
---|
41 |
<check uuid="1e8edc38-0d88-11de-93ee-af2195eab5d5" |
---|
42 |
module="external" name="foo" target="10.10.2.2"> |
---|
43 |
<config> |
---|
44 |
<command>/path/to/check_foo</command> |
---|
45 |
<arg1>-H</arg1> |
---|
46 |
<arg2>%[target]</arg2> |
---|
47 |
<env_QUUX>BAZ</env_QUUX> |
---|
48 |
</config> |
---|
49 |
</check> |
---|
50 |
</checks> |
---|
51 |
</noit> |
---|
52 |
]]></programlisting> |
---|
53 |
</example> |
---|
54 |
</examples> |
---|
55 |
</module> |
---|