diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-03-07 09:48:38 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-03-07 12:13:39 +0200 |
commit | f6769c969ee779c43ab0df18f7388b9d5a307f96 (patch) | |
tree | 8d976ee0f482d33528898ebe89723f6cb02adec4 /.gitignore | |
parent | 417659b757afc85fc437f3da462c09a4b86c1282 (diff) | |
download | ping903-f6769c969ee779c43ab0df18f7388b9d5a307f96.tar.gz ping903-f6769c969ee779c43ab0df18f7388b9d5a307f96.tar.bz2 |
Simplify entry point structure.
The /ip entry point is gone. The /hosts entry point accepts new query
arguments: (1) select=LIST, which introduces a list of IP addresses
(hostnames) to query and (2) attr=LIST - a list of attributes to return
in each stat object. In both cases, LIST is a comma-separated list of
values. The "select" argument can be used together with explicit host
(/hosts/IP?select=LIST), which is equivalent to /hosts/?select=IP,LIST.
The /match entry point takes the "select" query argument as well.
It return array of match objects. Each match object contains at least
the following attributes:
- name: original host name used in the request
- hosts: array of monitored host names or IPs corresponding to that name,
(can be empty).
If an error occurred (e.g. host name cannot be resolved) the "error"
attribute contains the textual description of the error.
The ping903q utility now accepts one or more IP addresses as arguments
in all modes, except nagios check. The statistics or matches for each
IP are returned separately.
* README: Document changes.
* doc/ping903q.1: Likewise.
* src/ping903.c (http_log): Log query arguments, if any.
(ept_host_stat): Accept query arguments: select and attr.
Return array of stat objects.
(ept_ip_stat): Remove.
(ept_ip_match): Accept query arguments: select.
Rewrite output.
(endpoint): Remove /ip
* src/ping903.h (get_ipaddr_stat): Remove.
(get_host_matches): Change signature.
* src/ping903q.c (HTTP_BUF_INITIALIZER): New macro.
(http_buf_init, http_buf_free): New functions.
(query_host,match_host): Removed.
(query_hosts,match_hosts): Removed.
(query_host_nagios): New function.
* src/pinger.c (get_ipaddr_stat): Remove.
(hostping_match): New function.
(get_host_matches): Rewrite.
Diffstat (limited to '.gitignore')
-rw-r--r-- | .gitignore | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -8,6 +8,7 @@ ChangeLog Makefile Makefile.in +TAGS aclocal.m4 autom4te.cache/ compile |