Xymon Mailing List Archive search

host grepping

list Jeremy Laidman
Tue, 14 Jan 2014 16:27:54 +1100
Message-Id: <user-9bbf94c0edc3@xymon.invalid>

On 10 January 2014 10:01, Galen Johnson <user-87f955643e3d@xymon.invalid> wrote:
Feature request: It would be handy to have xymongrep handle more than just
test lookups to save some scripting time.  I think it would be awesome if
it was extended to allow you to reference a host and have it return the
tests for just that host (especially when it may be spread across multiple
entries) and allow an argument to get the CLIENT, NAME or other modifier as
needed.
Does this help:

$ $XYMON $XYMSRV 'hostinfo host=^hostname'
hostname.example.com
|192.168.67.101|testip|delayred=dns:15,conn:15|delayyellow=dns:10,conn:10|dns=SOA:
example.com|TRENDS:*,vmstat:vmstat\pvmstat3


From the "xymon" man page:

       hostinfo [CRITERIA]
              Retrieves the current configuration of a  host  (i.e.
              the  hosts.cfg(5) definition). CRITERIA selects which
              host(s) to report, and is identical to  the  CRITERIA
              in the xymondboard command.

              The  response  is one line for each host that matches
              the CRITERIA, or all hosts if no criteria  is  speci-
              fied.  The  line  is  composed of a number of fields,
              separated by a pipe-sign. The first two  fields  will
              always  be  the  hostname  and  the  IP-address.  The
              remaining fields - if any - are the hosts.cfg tags in
              no particular order.

I like this one because a client can query its own configuration remotely,
or the test and configuration functions of the Xymon server can
(potentially) be distributed.

J