~ubuntu-branches/ubuntu/saucy/nagios3/saucy-proposed

« back to all changes in this revision

Viewing changes to html/docs/extcommands.html

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt
  • Date: 2009-08-16 14:14:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090816141423-efjzq1r3jekwd7l7
Tags: 3.2.0-1
* New upstream release (Closes: #542957)
  - Timeperiods should work as expected now (Closes: #539882)
  - Recovery notifications fixed (Closes: #543657)
* Update standards version 
  - Add README.source
* Manpage errors fixed (Closes: #540554)
* Split up the webfrontend into its own package (Closes: #479338, #485466)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
 
 
3
 
<html>
4
 
<head>
5
 
<title>External Commands</title>
6
 
 
7
 
<STYLE type="text/css">
8
 
<!--
9
 
        .Default { font-family: verdana,arial,serif; font-size: 8pt; }
10
 
        .PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
11
 
-->      
12
 
</STYLE>
13
 
 
14
 
</head>
15
 
 
16
 
<body bgcolor="#FFFFFF" text="black" class="Default">
17
 
 
18
 
<div align="center">
19
 
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
20
 
<h1 class="PageTitle">External Commands</h1>
21
 
</div>
22
 
 
23
 
<hr>
24
 
 
25
 
<p>
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>
28
 
</p>
29
 
 
30
 
<p>
31
 
<strong><u>Introduction</u></strong>
32
 
</p>
33
 
 
34
 
<p>
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.
36
 
</p>
37
 
 
38
 
<img src="images/externalcommands.png" border="0" style="float: right;" alt="External Commands" title="External Commands">
39
 
 
40
 
<p>
41
 
<strong><u>Enabling External Commands</u></strong>
42
 
</p>
43
 
 
44
 
<p>
45
 
In order to have Nagios process external commands, make sure you do the following:
46
 
</p>
47
 
 
48
 
<ul>
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>.
53
 
</ul>
54
 
 
55
 
<p>
56
 
<strong><u>When Does Nagios Check For External Commands?</u></strong>
57
 
</p>
58
 
 
59
 
<ul>
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.
62
 
</ul>
63
 
 
64
 
<p>
65
 
<strong><u>Using External Commands</u></strong>
66
 
</p>
67
 
 
68
 
<p>
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.  
70
 
</p>
71
 
 
72
 
<p>
73
 
<strong><u>Command Format</u></strong>
74
 
</p>
75
 
 
76
 
<p>
77
 
External commands that are written to the <a href="configmain.html#command_file">command file</a> have the following format...
78
 
</p>
79
 
 
80
 
<pre>
81
 
[<i>time</i>] <i>command_id</i>;<i>command_arguments</i>
82
 
</pre>
83
 
 
84
 
<p>
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.
86
 
</p>
87
 
 
88
 
<p>
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:
90
 
</p>
91
 
<p>
92
 
<a href="http://www.nagios.org/developerinfo/externalcommands/" target="_blank">http://www.nagios.org/developerinfo/externalcommands/</a>
93
 
</p>
94
 
 
95
 
 
96
 
<hr>
97
 
 
98
 
</body>
99
 
</html>
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
2
 
 
3
 
 
4
 
 
5
<html>
 
6
 
 
7
<head>
 
8
 
 
9
<title>External Commands</title>
 
10
 
 
11
 
 
12
 
 
13
<STYLE type="text/css">
 
14
 
 
15
<!--
 
16
 
 
17
        .Default { font-family: verdana,arial,serif; font-size: 8pt; }
 
18
 
 
19
        .PageTitle { font-family: verdana,arial,serif; font-size: 16pt; font-weight: bold; }
 
20
 
 
21
-->      
 
22
 
 
23
</STYLE>
 
24
 
 
25
 
 
26
 
 
27
</head>
 
28
 
 
29
 
 
30
 
 
31
<body bgcolor="#FFFFFF" text="black" class="Default">
 
32
 
 
33
 
 
34
 
 
35
<div align="center">
 
36
 
 
37
<img src="images/nagios.jpg" border="0" alt="Nagios" title="Nagios">
 
38
 
 
39
<h1 class="PageTitle">External Commands</h1>
 
40
 
 
41
</div>
 
42
 
 
43
 
 
44
 
 
45
<hr>
 
46
 
 
47
 
 
48
 
 
49
<p>
 
50
 
 
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>
 
52
 
 
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>
 
54
 
 
55
</p>
 
56
 
 
57
 
 
58
 
 
59
<p>
 
60
 
 
61
<strong><u>Introduction</u></strong>
 
62
 
 
63
</p>
 
64
 
 
65
 
 
66
 
 
67
<p>
 
68
 
 
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.
 
70
 
 
71
</p>
 
72
 
 
73
 
 
74
 
 
75
<img src="images/externalcommands.png" border="0" style="float: right;" alt="External Commands" title="External Commands">
 
76
 
 
77
 
 
78
 
 
79
<p>
 
80
 
 
81
<strong><u>Enabling External Commands</u></strong>
 
82
 
 
83
</p>
 
84
 
 
85
 
 
86
 
 
87
<p>
 
88
 
 
89
In order to have Nagios process external commands, make sure you do the following:
 
90
 
 
91
</p>
 
92
 
 
93
 
 
94
 
 
95
<ul>
 
96
 
 
97
<li>Enable external command checking with the <a href="configmain.html#check_external_commands">check_external_commands</a> option.
 
98
 
 
99
<li>Set the frequency of command checks with the <a href="configmain.html#command_check_interval">command_check_interval</a> option.
 
100
 
 
101
<li>Specify the location of the command file with the <a href="configmain.html#command_file">command_file</a> option.
 
102
 
 
103
<li>Setup proper permissions on the directory containing the external command file, as described in the <a href="quickstart.html">quickstart guide</a>.
 
104
 
 
105
</ul>
 
106
 
 
107
 
 
108
 
 
109
<p>
 
110
 
 
111
<strong><u>When Does Nagios Check For External Commands?</u></strong>
 
112
 
 
113
</p>
 
114
 
 
115
 
 
116
 
 
117
<ul>
 
118
 
 
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
 
120
 
 
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.
 
122
 
 
123
</ul>
 
124
 
 
125
 
 
126
 
 
127
<p>
 
128
 
 
129
<strong><u>Using External Commands</u></strong>
 
130
 
 
131
</p>
 
132
 
 
133
 
 
134
 
 
135
<p>
 
136
 
 
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.  
 
138
 
 
139
</p>
 
140
 
 
141
 
 
142
 
 
143
<p>
 
144
 
 
145
<strong><u>Command Format</u></strong>
 
146
 
 
147
</p>
 
148
 
 
149
 
 
150
 
 
151
<p>
 
152
 
 
153
External commands that are written to the <a href="configmain.html#command_file">command file</a> have the following format...
 
154
 
 
155
</p>
 
156
 
 
157
 
 
158
 
 
159
<pre>
 
160
 
 
161
[<i>time</i>] <i>command_id</i>;<i>command_arguments</i>
 
162
 
 
163
</pre>
 
164
 
 
165
 
 
166
 
 
167
<p>
 
168
 
 
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.
 
170
 
 
171
</p>
 
172
 
 
173
 
 
174
 
 
175
<p>
 
176
 
 
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:
 
178
 
 
179
</p>
 
180
 
 
181
<p>
 
182
 
 
183
<a href="http://www.nagios.org/developerinfo/externalcommands/" target="_blank">http://www.nagios.org/developerinfo/externalcommands/</a>
 
184
 
 
185
</p>
 
186
 
 
187
 
 
188
 
 
189
 
 
190
 
 
191
<hr>
 
192
 
 
193
 
 
194
 
 
195
</body>
 
196
 
 
197
</html>
 
198