aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-02-13 15:28:56 +0200
committerSergey Poznyakoff <gray@gnu.org>2020-02-13 15:28:56 +0200
commit4263bf8b57b7d8a0b5f73a586c55e9ee2a07b6ca (patch)
tree8489b1f0ec53564fc780f480a3a75804e9d4e6e2 /doc
parent47bed8e5bc0e1a58e10c6237d27ce578bb50d7d6 (diff)
downloadping903-4263bf8b57b7d8a0b5f73a586c55e9ee2a07b6ca.tar.gz
ping903-4263bf8b57b7d8a0b5f73a586c55e9ee2a07b6ca.tar.bz2
Implement IP lookup and match mode.
* src/ping903.c: Implement two new endpoints: /ip and /match, for IP lookup and match mode. * src/ping903.h (get_ipaddr_stat) (get_host_matches): New protos. * src/pinger.c (get_ipaddr_stat) (get_host_matches): New functions. * src/ping903q.c (resolve_ip): New global. (query_host): Use /host or /ip depending on the value of resolve_ip. (match_host): New function. * doc/ping903q.1: Update.
Diffstat (limited to 'doc')
-rw-r--r--doc/ping903q.130
1 files changed, 25 insertions, 5 deletions
diff --git a/doc/ping903q.1 b/doc/ping903q.1
index 2d351a3..326ca81 100644
--- a/doc/ping903q.1
+++ b/doc/ping903q.1
@@ -21,14 +21,16 @@ ping903q \- ping903 query tool
[\fB\-hVv\fR]\
[\fB\-f \fIFILE\fR]\
[\fIIP\fR]
-
-or
-
+.PP
\fBping903q\fR\
[\fB\-f \fIFILE\fR]\
\fB\-H \fIHOST\fR\
\fB\-c \fIRTA\fB,\fIPCT\fB%\fR\
- \fB\-w \fIRTA\fB,\fIPCT\fB%\fR
+ \fB\-w \fIRTA\fB,\fIPCT\fB%\fR
+.PP
+\fBping903q\fR\
+ [\fB\-f \fIFILE\fR]\
+ \fB\-m\fR
.SH DESCRIPTION
Queries monitoring statistics from the \fBping903\fR daemon. When
used with a single argument (\fIIP\fR), displays information about
@@ -54,6 +56,10 @@ When the \fB\-H\fR, \fB\-c\fR, and \fB\-w\fR options are used, the
program enters \fINagios check mode\fR. In this mode its output
complies with the requirements for external \fBNagios\fR check
programs.
+.SS Match mode
+When invoked with the \fB\-m\fR option, \fBping903q\fR checks if
+\fIHOST\fR is monitored by the server. If so, it prints the matching
+host names and exits with code 0.
.SH EXIT CODE
When called with one argument, the program exits with code 0 (success)
if the IP is alive and 2 otherwise.
@@ -73,6 +79,9 @@ Warning condition.
.B 2
Critical condition.
.PP
+In match mode, the program exits with code 0 if the requested host is
+monitored by the server, and with code 2 if it is not.
+.PP
If any error is encountered, \fBping903q\fR exits with status \fB3\fR.
.SH OPTIONS
.TP
@@ -83,12 +92,19 @@ Read configuration from \fIFILE\fR instead of from the default
.B \-h
Print a short usage summary.
.TP
+.B \-r
+Resolve host argument to IP address and use the IP address to query
+the server. Using this option you can supply a symbolic host name
+as argument even if the server uses the corresponding IP and still get
+a meaningful result. Otherwise, you can use the matching mode (see
+below).
+.TP
.B \-V
Print program version, copyright information, and exit.
.TP
.B \-v
Turn on verbose output.
-.SS Options valid in Nagios check mode
+.SS Options specific for Nagios check mode
The presense of any of these options switches \fBping903q\fR to Nagios
check mode. For this mode to succeed, all three options must be specified.
.TP
@@ -107,6 +123,10 @@ also that the use of the percent sign is mandatory.
\fB\-w \fIRTA\fB,\fIPCT\fB%\fR
Sets the warning threshold value. See above for the discussion of the
arguments.
+.SS Options specific for match mode
+.TP
+.B \-m
+Switch to the host match mode.
.SH SEE ALSO
.BR ping903 (8),
.BR Nagios <https://www.nagios.org/>.

Return to:

Send suggestions and report system problems to the System administrator.