1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
|
<html>
<head>
<title>External Commands</title>
<STYLE type="text/css">
<!--
.Default { font-family: verdana,arial,serif; font-size: 8pt; }
.PageTitle { font-family: verdana,arial,serif; font-size: 12pt; font-weight: bold; }
-->
</STYLE>
</head>
<body bgcolor="#FFFFFF" text="black" class="Default">
<p>
<div align="center">
<h2 class="PageTitle">External Commands</h2>
</div>
</p>
<hr>
<p>
<strong><u>Introduction</u></strong>
</p>
<p>
Nagios can process commands from external applications (including CGIs - see the <a href="cgis.html#cmd_cgi">command CGI</a> for an example) and alter various aspects of its monitoring functions based on the commands it receives.
</p>
<p>
<strong><u>Enabling External Commands</u></strong>
</p>
<p>
By default, Nagios <i>does not</i> check for or process any external commands. If you want to enable external command processing, you'll have to do the following...
</p>
<p>
<ul>
<li>Enable external command checking with the <a href="configmain.html#check_external_commands">check_external_commands</a> option
<li>Set the frequency of command checks with the <a href="configmain.html#command_check_interval">command_check_interval</a> option
<li>Specify the location of the command file with the <a href="configmain.html#command_file">command_file</a> option. Its best to put the external command file in its own directory (i.e. <i>/usr/local/nagios/var/rw</i>).
<li>Setup proper permissions on the directory containing the external command file. Details on how to do this can be found <a href="commandfile.html">here</a>.
</ul>
</p>
<p>
<strong><u>When Does Nagios Check For External Commands?</u></strong>
</p>
<p>
<ul>
<li>At regular intervals specified by the <a href="configmain.html#command_check_interval">command_check_interval</a> option in the main configuration file
<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.
</ul>
</p>
<p>
<strong><u>Using External Commands</u></strong>
</p>
<p>
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.
</p>
<p>
<strong><u>Command Format</u></strong>
</p>
<p>
External commands that are written to the <a href="configmain.html#command_file">command file</a> have the following format...
</p>
<p>
<font color="red">
<strong>
[<i>time</i>] <i>command_id</i>;<i>command_arguments</i>
</strong>
</font>
</p>
<p>
...where <i>time</i> is the time (in <i>time_t</i> format) that the external application or CGI committed the external command to the command file. Some of the commands that are available are described in the table below, along with their <i>command_id</i> and a description of their <i>command_arguments</i>.
</p>
<p>
<strong><u>Implemented Commands</u></strong>
</p>
<p>
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:
</p>
<p>
<a href="http://www.nagios.org/developerinfo/externalcommands/" target="_blank">http://www.nagios.org/developerinfo/externalcommands/</a>
</p>
<hr>
</body>
</html>
|