1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5
<title>External Commands</title>
7
<STYLE type="text/css">
9
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
10
.PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
16
<body bgcolor="#FFFFFF" text="black" class="Default">
19
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
20
<h1 class="PageTitle">External Commands</h1>
26
<img src="images/upto.gif" border="0" align="middle" alt="Up To" title="Up To">Up To: <a href="toc.html">Contents</a><br>
27
<img src="images/seealso.gif" border="0" align="middle" alt="See Also" title="See Also"> See Also: <a href="passivechecks.html">Passive Checks</a>, <a href="adaptive.html">Adaptive Monitoring</a>
31
<strong><u>Introduction</u></strong>
35
Nagios can process commands from external applications (including the CGIs) and alter various aspects of its monitoring functions based on the commands it receives. External applications can submit commands by writing to the <a href="configmain.html#command_file">command file</a>, which is periodically processed by the Nagios daemon.
38
<img src="images/externalcommands.png" border="0" style="float: right;" alt="External Commands" title="External Commands">
41
<strong><u>Enabling External Commands</u></strong>
45
In order to have Nagios process external commands, make sure you do the following:
49
<li>Enable external command checking with the <a href="configmain.html#check_external_commands">check_external_commands</a> option.
50
<li>Set the frequency of command checks with the <a href="configmain.html#command_check_interval">command_check_interval</a> option.
51
<li>Specify the location of the command file with the <a href="configmain.html#command_file">command_file</a> option.
52
<li>Setup proper permissions on the directory containing the external command file, as described in the <a href="quickstart.html">quickstart guide</a>.
56
<strong><u>When Does Nagios Check For External Commands?</u></strong>
60
<li>At regular intervals specified by the <a href="configmain.html#command_check_interval">command_check_interval</a> option in the main configuration file
61
<li>Immediately after <a href="eventhandlers.html">event handlers</a> are executed. This is in addtion to the regular cycle of external command checks and is done to provide immediate action if an event handler submits commands to Nagios.
65
<strong><u>Using External Commands</u></strong>
69
External commands can be used to accomplish a variety of things while Nagios is running. Example of what can be done include temporarily disabling notifications for services and hosts, temporarily disabling service checks, forcing immediate service checks, adding comments to hosts and services, etc.
73
<strong><u>Command Format</u></strong>
77
External commands that are written to the <a href="configmain.html#command_file">command file</a> have the following format...
81
[<i>time</i>] <i>command_id</i>;<i>command_arguments</i>
85
...where <i>time</i> is the time (in <i>time_t</i> format) that the external application submitted the external command to the command file. The values for the <i>command_id</i> and <i>command_arguments</i> arguments will depend on what command is being submitted to Nagios.
89
A full listing of external commands that can be used (along with examples of how to use them) can be found online at the following URL:
92
<a href="http://www.nagios.org/developerinfo/externalcommands/" target="_blank">http://www.nagios.org/developerinfo/externalcommands/</a>
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
9
<title>External Commands</title>
13
<STYLE type="text/css">
17
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
19
.PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
31
<body bgcolor="#FFFFFF" text="black" class="Default">
37
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
39
<h1 class="PageTitle">External Commands</h1>
51
<img src="images/upto.gif" border="0" align="middle" alt="Up To" title="Up To">Up To: <a href="toc.html">Contents</a><br>
53
<img src="images/seealso.gif" border="0" align="middle" alt="See Also" title="See Also"> See Also: <a href="passivechecks.html">Passive Checks</a>, <a href="adaptive.html">Adaptive Monitoring</a>
61
<strong><u>Introduction</u></strong>
69
Nagios can process commands from external applications (including the CGIs) and alter various aspects of its monitoring functions based on the commands it receives. External applications can submit commands by writing to the <a href="configmain.html#command_file">command file</a>, which is periodically processed by the Nagios daemon.
75
<img src="images/externalcommands.png" border="0" style="float: right;" alt="External Commands" title="External Commands">
81
<strong><u>Enabling External Commands</u></strong>
89
In order to have Nagios process external commands, make sure you do the following:
97
<li>Enable external command checking with the <a href="configmain.html#check_external_commands">check_external_commands</a> option.
99
<li>Set the frequency of command checks with the <a href="configmain.html#command_check_interval">command_check_interval</a> option.
101
<li>Specify the location of the command file with the <a href="configmain.html#command_file">command_file</a> option.
103
<li>Setup proper permissions on the directory containing the external command file, as described in the <a href="quickstart.html">quickstart guide</a>.
111
<strong><u>When Does Nagios Check For External Commands?</u></strong>
119
<li>At regular intervals specified by the <a href="configmain.html#command_check_interval">command_check_interval</a> option in the main configuration file
121
<li>Immediately after <a href="eventhandlers.html">event handlers</a> are executed. This is in addtion to the regular cycle of external command checks and is done to provide immediate action if an event handler submits commands to Nagios.
129
<strong><u>Using External Commands</u></strong>
137
External commands can be used to accomplish a variety of things while Nagios is running. Example of what can be done include temporarily disabling notifications for services and hosts, temporarily disabling service checks, forcing immediate service checks, adding comments to hosts and services, etc.
145
<strong><u>Command Format</u></strong>
153
External commands that are written to the <a href="configmain.html#command_file">command file</a> have the following format...
161
[<i>time</i>] <i>command_id</i>;<i>command_arguments</i>
169
...where <i>time</i> is the time (in <i>time_t</i> format) that the external application submitted the external command to the command file. The values for the <i>command_id</i> and <i>command_arguments</i> arguments will depend on what command is being submitted to Nagios.
177
A full listing of external commands that can be used (along with examples of how to use them) can be found online at the following URL:
183
<a href="http://www.nagios.org/developerinfo/externalcommands/" target="_blank">http://www.nagios.org/developerinfo/externalcommands/</a>