Teach the client about backslash escape sequences
[nsca-ng.git] / man / send_nsca.in
blobbc21ca2d7e285be3d88d96e1a51dfe5a5d439da0
1 .\" Copyright (c) 2013 Holger Weiss <holger@weiss.in-berlin.de>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions are met:
6 .\"
7 .\" 1. Redistributions of source code must retain the above copyright notice,
8 .\"    this list of conditions and the following disclaimer.
9 .\"
10 .\" 2. Redistributions in binary form must reproduce the above copyright notice,
11 .\"    this list of conditions and the following disclaimer in the documentation
12 .\"    and/or other materials provided with the distribution.
13 .\"
14 .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15 .\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18 .\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 .\" POSSIBILITY OF SUCH DAMAGE.
26 .TH send_nsca 8 "@date@" "Version @version@" "The NSCA\-ng Manual"
28 .SH NAME
30 .B send_nsca
31 \- send monitoring commands to NSCA\-ng server
33 .SH SYNOPSIS
35 .B send_nsca
36 .RB [ \-CSstv ]
37 .RB [ \-c
38 .IR file ]
39 .RB [ \-D
40 .IR delay ]
41 .RB [ \-d
42 .IR delimiter ]
43 .RB [ \-e
44 .IR separator ]
45 .RB [ \-H
46 .IR server ]
47 .RB [ \-o
48 .IR timeout ]
49 .RB [ \-p
50 .IR port ]
52 .PP
53 .B send_nsca
54 .BR \-h " | " \-V
56 .SH DESCRIPTION
58 The
59 .B send_nsca
60 utility transmits one or more check results or monitoring commands to an
61 .BR nsca\-ng (8)
62 server.
63 The communication with the server is
64 .SM TLS
65 encrypted and authenticated using pre-shared keys (as per
66 .SM RFC
67 4279).
68 By default,
69 .B send_nsca
70 reads host or service check results from the standard input.
71 Multiple check results must be separated with an
72 .SM ASCII ETB
73 character (octal value: 27).
74 Service check results are expected to be in the following format:
76 .PP
77 .IR     host [tab] service [tab] status [tab] message [newline]
79 .PP
80 where
81 .I host
82 and
83 .I service
84 are the host name and service description as configured in Nagios,
85 .I status
86 is the numeric return code, and
87 .I message
88 is the output string.
89 Host check results are expected to be in the same format, just without
90 the
91 .I service
92 description:
94 .PP
95 .IR     host [tab] status [tab] message [newline]
97 .PP
98 Note that multiline
99 .IR message s
100 are supported.
102 .SH OPTIONS
105 .B \-C
107 Instead of accepting host or service check results in the format
108 described above, read \(lqraw\(rq monitoring commands for submission to
109 the Nagios command file from the standard input, one command per line.
110 The commands are expected to be in the format described in the Nagios
111 documentation; except that the leading bracketed timestamp may be
112 omitted, in which case the current timestamp is prepended to the
113 provided command by
114 .BR send_nsca .
117 .BI \-c\  file
119 Read the configuration from the specified
120 .I file
121 instead of using the default configuration file
122 .IR @sysconfdir@/send_nsca.cfg .
125 .BI \-D\  delay
127 Wait for a random number of seconds between 0 and the specified
128 .I delay
129 before contacting the server.
130 This might be useful to reduce the server load if many
131 .B send_nsca
132 clients are invoked simultaneously.
133 The default setting is 0, which tells
134 .B send_nsca
135 to connect to the server immediately.
136 If this option is specified, the
137 .B delay
138 setting in the
139 .BR send_nsca.cfg (5)
140 file is ignored.
143 .BI \-d\  delimiter
145 Use the specified
146 .I delimiter
147 instead of a horizontal tab to separate the fields when parsing host or
148 service check results.
150 .I delimiter
151 must be a single character, a C-style backslash escape sequence, the
152 octal value of a character with a leading zero, or the hexadecimal value
153 of a character prefixed with \(lq0x\(rq.
155 .SM ASCII
156 character other than a backslash, newline,
157 .SM ETB,
159 .SM NUL
160 is allowed.
161 This option is ignored if the
162 .B \-C
163 option is specified.
166 .BI \-e\  separator
168 Use the specified
169 .I separator
170 instead of an
171 .SM ASCII ETB
172 character to separate multiple host or service check results.
174 .I separator
175 must be a single character, a C-style backslash escape sequence, the
176 octal value of a character with a leading zero, or the hexadecimal value
177 of a character prefixed with \(lq0x\(rq.
179 .SM ASCII
180 character is allowed, but note that multiline check result messages
181 cannot be submitted if a newline character is used.
182 This option is ignored if the
183 .B \-C
184 option is specified.
187 .BI \-H\  server
189 Connect and talk to the specified
190 .I server
191 address or host name.
192 By default,
193 .B send_nsca
194 attempts to communicate with \(lqlocalhost\(rq.
195 This option takes precedence over the
196 .B server
197 setting in the
198 .BR send_nsca.cfg (5)
199 file.
202 .B \-h
204 Print usage information to the standard output and exit.
207 .BI \-o\  timeout
209 Close the connection if the server didn't respond for the specified
210 number of seconds.
211 If the
212 .I timeout
213 is set to 0,
214 .B send_nsca
215 won't enforce connection timeouts.
216 The default
217 .I timeout
218 is 15 seconds.
219 This option is provided for compatibility with
220 .SM NSCA
221 2.x.
222 If it's specified, the
223 .B timeout
224 setting in the
225 .BR send_nsca.cfg (5)
226 file is ignored.
229 .BI \-p\  port
231 Connect to the specified service name or
232 .I port
233 number instead of using the default
234 .I port
235 (5668).
236 This option takes precedence over the
237 .B port
238 setting in the
239 .BR send_nsca.cfg (5)
240 file.
243 .B \-S
245 Write all messages to the standard error output.
246 This is the default behaviour.
249 .B \-s
251 Send all messages (except for usage errors) to the system logger.
252 This option may be combined with the
253 .B \-S
254 option.
257 .B \-t
259 This option is ignored.
260 It is accepted for compatibility with
261 .SM NSCA
262 2.x.
265 .B \-V
267 Print version information to the standard output and exit.
270 .B \-v
272 Generate a message for each check result or monitoring command sent to
274 .BR nsca\-ng (8)
275 server.
276 This option can be specified up to three times in order to increase the
277 verbosity.
279 .SH "EXIT STATUS"
282 .B send_nsca
283 utility exits 0 on success, and >0 if an error occurs.
285 .SH FILES
288 .I @sysconfdir@/send_nsca.cfg
291 .BR send_nsca.cfg (5)
292 configuration file.
294 .SH "SEE ALSO"
296 .BR send_nsca.cfg (5),
297 .BR nsca\-ng (8),
298 .BR nsca\-ng.cfg (5)
301 .I http://www.nagios.org/developerinfo/externalcommands/
303 .SH AUTHOR
305 Holger Weiss <holger@weiss.in-berlin.de>
307 .\" vim:set filetype=nroff textwidth=72: