pax_global_header00006660000000000000000000000064132325677100014520gustar00rootroot0000000000000052 comment=fa5ef591ba7a0e1174767f591c1676f2ebf31006 xymonq-0.8/000077500000000000000000000000001323256771000127225ustar00rootroot00000000000000xymonq-0.8/CHANGES.txt000066400000000000000000000065111323256771000145360ustar00rootroot00000000000000CHANGES.txt for xymonq v0.8 (2018-01-26) ----------------------------------------------------------------------------- FEATURES: - new option `-p` to prefix each line of output with the hostname (for `clientlog`, `xymondlog` and `xymondboard` queries). The hostname is taken from `hosts.cfg` and printed in the form `hostname: `. BUG FIXES: - correct spelling-error in usage and man-page: The `config` querytype was mis-named `client` IMPROVEMENTS: - code-improvements: eliminate `eval` where possible; improved function naming v0.7 (2017-12-13) ----------------------------------------------------------------------------- BUG FIXES: - config-loading was broken for the pre v0.6 behaviour of auto-searching the config file. - the list-filter for `clientlog` was to restrictive, resulting in too few sections to show up. It did not match `msgs:` and `logfile:` for instance. Now clientlog-sections are matched against `\[[^]]+\]` resulting in all sections to show up. (command: `xymonq -q clientlog -H myhost -l`) v0.6 (2017-12-10) ----------------------------------------------------------------------------- FEATURES: - add possibility to specify config-file to to use with `-c conf-file`. The default remains the auto-search w/ fallback to internal defaults. - allow more default-values to be set in config-file (TEST, FIELDS, SECTION) - add `config` query to retrieve `.cfg`-files from the xymon-server. The file can be specified with `-f file.cfg`. If no file is specified it defaults to `hosts.cfg`. v0.5 (2016-02-06) ----------------------------------------------------------------------------- FEATURES: - add `hostinfo` query to fetch the configuration from `hosts.cfg` for one or more hosts. While the host-selection is fully available there are currently on output options, thus just the output from `xymon "hostlist [CRITERIA]"` is printed as-is. - `ghostlist` may now be abbreviated as `ghost` BUG FIXES: - the sorting of the test-list (`xymonq -q xymondlog -l -S`) was incorrectly sorting the `HOST=`-separator line. Removed the sorting completely for now. v0.4 (2015-10-15) ----------------------------------------------------------------------------- FEATURES: - add `ghostlist` query to fetch the ghostlist. This also allows to select based on the age of the report. - add `version` / `ping` query to get the version of the Xymon server `xymonq` is communicating with. - read configuration from external config-file, see included sample `xymonq.cfg` and the man-page for details. IMPROVEMENTS: - only build hostlist if needed for further operations - help and man page: more examples, better structure, added shore description for querytypes v0.3 (2015-10-06) ----------------------------------------------------------------------------- Except for the volume-mode corner case (see below) this version can replace v0.2. IMPROVEMENTS: - introduce a `volume-mode`: used in `xymondboard`-mode without `-S`-option; this is not finished yet BUG FIXES: - hostname-search in `xymondboard`-mode: correctly anchor the regex to prevent returning data for too many hosts v0.2 (2015-06-23) ----------------------------------------------------------------------------- First public release v0.1 (2015-05-12) ----------------------------------------------------------------------------- not released to public xymonq-0.8/unescape-xymonq.awk000077500000000000000000000035321323256771000165700ustar00rootroot00000000000000#!/usr/bin/gawk -f #!/usr/bin/mawk -f ## for busybox-test symlink awk first: #!./awk -f ## Idea: ## - we get the field-list by `-vFIELDS=$FIELDS` from xymonq ## - each dataset is one line (as returned by `xymondboard`) ## - all data is put into the data-hash, key is the field-name ## - for the msg-field we have an unescape()-function ## - output: we prefix each line with the hostname and print the ## (unescaped) msg in correct order function unescape(msg) { #print "DEBUG: unescape starting: " msg; gsub("\\\\n", "\n", msg); gsub("\\\\t", "\t", msg); ## do not replace CR as this scrambles output: #gsub("\\\\r", "\r", msg); gsub("\\\\p", "|", msg); sub("\\\\\\\\", "\\", msg); #print "DEBUG: unescape internal result: " msg; return(msg); } BEGIN { ## xymondboard-output is "|"-separated: FS="|" } { ## get our fieldnames and assign data to hash: split(FIELDS, fields_arr, ","); for (idx in fields_arr) { # printf("DEBUG: fields_arr[%s]=%s\n", idx, fields_arr[idx]); data[fields_arr[idx]] = $idx; } # ## print all our fields and gathered data: # printf( "DEBUG: FIELDS=%s\n", FIELDS ); # for ( idx in data) { # printf( "DEBUG: data[%s]=%s\n", idx, data[idx] ); # } ## print all other fields: for ( idx in data) { ## do not print hostname: if ( idx == "hostname" ) continue; ## print msg line-by-line: if ( idx == "msg" ) { data["msg"] = unescape( data["msg"] ); msg_length = split( data["msg"], msg, "\n" ); for ( line = 1; line <= msg_length; line++ ) { if ( length( msg[line] ) == 0 ) { continue; } #printf( "DEBUG: length=%s\n", length( msg[line] ) ); printf( "%s:%s:%s\n", data["hostname"], idx, msg[line] ); } delete msg; continue; } ## all others print as-is: printf( "%s:%s:%s\n", data["hostname"], idx, data[idx] ); #printf( "DEBUG: data[%s]=%s\n", idx, data[idx] ); } } xymonq-0.8/xymonq000077500000000000000000000376321323256771000142160ustar00rootroot00000000000000#!/bin/bash ## ## (c) 2015-2018 Thomas Eckert, http://www.it-eckert.com/ ## ## xymonq is a generic Xymon data query tool; a frontend for the `xymon` ## messages like ## clientlog | xymondlog | xymondboard | ghostlist | ping | ... ## messages/commands of xymon(1). ## TODO: maintained in `tasks.taskpaper` ###################################################################### ## config: MY_NAME="${0##*/}" MY_VERSION="0.8" ## might be set from cmdline `-c`: CONF_FILE="" XYMON_CMD="" XYMON_SRV="" ## optional post-processing filter (shell-command / pipeline; -c option): POST_COMMAND="" ## vars set dynamically below based on cmdline or config-file: QUERYTYPE="" HOSTLIST="" SECTION="" TEST="" COLOR="" ## set by `-L`-option: PRINT_HOSTS_ONLY=0 ## set by `-l`-option: LIST_FLAG=0 ## set by `-p`-option: PREFIX_HOSTNAME=0 ## build dynamically: (host, page, test, color CRITERIA) FILTER_HOST="" FILTER="" ## fields output by xymondboard (hard-wired to "hostname" for _build_hostlist()): FIELDS="" ## print HOST=hostname before sections (controlled by -S option): PRINT_HOST=0 ## enable debug/verbose output: 0=off DEBUG=0 VERBOSE=0 ###################################################################### ## functions: _usage() { cat <&2 fi } ## check if there is something to read from stdin (currently only `-H -`), read ## and handle the data and return 0 (success); otherwise return 1 (failure, i.e. ## nothing to read from stdin _read_stdin() { _debug "${FUNCNAME[0]}() starting" if [ "$FILTER_HOST" = "host=-" ]; then if [ "$QUERYTYPE" = "xymondboard" ]; then ## for volume-mode we craft an discrete hostlist w/o andy regex ## usable by `xymondboard`: HOSTLIST="$(cat | sed -e ':a;/$/{N;s/\n/|/;ba}' | sed -e 's/\./\\./g')" FILTER_HOST="host=$HOSTLIST" else _debug "reading hosts from stdin" HOSTLIST="$(cat)" fi ## in any case we had input from stdin: return 0 else _debug "No hosts to read from stdin." return 1 fi } ## of _read_stdin() _build_hostlist() { ## build the hostlist for printing using info-test (this is available ## always): if ! _read_stdin; then _debug "reading hosts from xymon with: $XYMON_CMD $XYMON_SRV \"xymondboard $FILTER_HOST $FILTER test=$TEST fields=hostname\"" _log "(build hostlist) $XYMON_CMD $XYMON_SRV \"xymondboard $FILTER_HOST $FILTER test=$TEST fields=hostname\"" HOSTLIST="$($XYMON_CMD $XYMON_SRV "xymondboard $FILTER_HOST $FILTER test=$TEST fields=hostname")" fi if [ "$PRINT_HOSTS_ONLY" = "1" ]; then _debug "printing hostlist only ('-L' option specified):" echo "$HOSTLIST" exit fi _debug "evaluated hostlist : $(echo $HOSTLIST)" _debug "requested section : $SECTION" _debug "requested test : $TEST" } ## of _build_hostlist() ## params: [ host ], [ section ] _print_clientlog() { local host="$1" shift _debug "${FUNCNAME[0]}() starting" if [ "$1" != "" ]; then local section="section=$1" fi _debug "${FUNCNAME[0]}() starting" _xymon_cmd "clientlog $host $section" } ## of _print_clientlog() _print_xymondlog() { local host="$1" local test="$2" _debug "${FUNCNAME[0]}() starting" if [ $LIST_FLAG -eq 0 ]; then _xymon_cmd "xymondlog $host.$test" else #_xymon_cmd "xymondboard host=$host fields=testname" ## need to modify global FIELDS here: FIELDS="fields=testname" _print_xymondboard "$host" fi } _print_xymondboard() { local host="$1" local section="$2" _debug "${FUNCNAME[0]}() starting" _xymon_cmd "xymondboard host=^$host\$ test=$TEST $FIELDS" } _print_hostinfo() { local host="$1" local section="$2" _debug "${FUNCNAME[0]}() starting" _xymon_cmd "hostinfo host=^$host\$ test=$TEST $FIELDS" } ## large-volume-mode: get (almost) _all_ information our of xymon at the expense ## of network traffic and filter it locally in _filter_volume() ## Idea: ## - only make one connection to `xymond` with a basic filter (page, host, test, color, X-crits) ## - return large amount of data: 1st line (line1) and full message (msg) ## - post-process the returned data locally: later, we may even replace `xymondlog`-queries by this ## suggested by J.C. Cleaver _print_xymondboard_volume() { _debug "${FUNCNAME[0]}() starting" ## To get almost all data we get the fields `line1,msg` here. Maybe we make ## this a cmdline option later: _xymon_cmd "xymondboard $FILTER_HOST $FILTER test=$TEST $FIELDS" } ## of _print_xymondboard_volume() #_parse_xymondboard_volume() { # #_debug "${FUNCNAME[0]}() starting" # echo "$*" # return #} ## of _parse_xymondboard_volume() _parse_xymondboard_volume() { _debug "${FUNCNAME[0]}() starting" _debug "FIELDS=$FIELDS" "$(dirname "$0")"/unescape-xymonq.awk -vFIELDS="${FIELDS#fields=}" } ## of _parse_xymondboard_volume() ## retrieve and print a config-file: _print_config() { local file="" _debug "${FUNCNAME[0]}() starting" if [ -n "${FIELDS}" ]; then file="${FIELDS#fields=}" else file="hosts.cfg" fi _log "retrieving file=$file" _xymon_cmd "config ${file}" } ## of _print_config() ## print the full ghostlist _print_ghostlist() { _debug "${FUNCNAME[0]}() starting" _xymon_cmd "ghostlist" } _ghostlist_age_filter() { local age_opt="$*" local inverted=0 ## defaults to false local age_ts local ts _debug "${FUNCNAME[0]}() starting" ## check if inverted search is requested: if [ "${age_opt:0:1}" = "-" ]; then inverted=1 ## strip off the "-" marker: age_opt="${age_opt#-}" fi _debug "incoming age_opt=\"$age_opt\" ; inverted=$inverted" ## convert age_ts to timestamp: age_ts="$(date +'%s' -d "$age_opt")" _debug "resulting age_ts=$age_ts" ## xymon-output is separated by "|": OIFS=$IFS IFS="|$IFS" while read hostname ip ts rest do diff=$((ts-age_ts)) _debug "split data: hostname=$hostname ip=$ip ts=$ts rest=$rest age_ts=$age_ts diff=$diff" if [ $diff -ge 0 ]; then if [ $inverted -eq 0 ]; then _debug "if-match: $hostname|$ip|$ts" echo "$hostname|$ip|$ts" else _debug "if-NO-match: $hostname|$ip|$ts" fi else if [ $inverted -eq 0 ]; then _debug "else-NO match: $hostname|$ip|$ts" else _debug "else-INV match: $hostname|$ip|$ts" echo "$hostname|$ip|$ts" fi fi done ## alternative version w/ awk-forking: #awk -F"|" -vage_ts=$age_ts '{ ts=$NF; if ( ts > age_ts ) print; }' ## just in case ;) IFS=$OIFS } ## of _ghostlist_age_filter() ## xymon `ping` is in fact a `version`-query: _print_ping() { _debug "${FUNCNAME[0]}() starting" ## we only care for the version-number: _xymon_cmd "ping" | cut -d" " -f 2 } _prefix_hostname() { local host="$1" _debug "${FUNCNAME[0]}() starting" [ "$PREFIX_HOSTNAME" = "0" ] && cat - || sed -e "s/^/$host: /" } _xymon_cmd() { local xymon_msg="$@" ## print our "HOST="-tag: if [ $PRINT_HOST -ne 0 ] && [ "$QUERYTYPE" != "ghostlist" ]; then echo "HOST=$host" fi if [ "$POST_COMMAND" = "" ]; then _debug "command: $XYMON_CMD $XYMON_SRV \"$xymon_msg\"" _log "$XYMON_CMD $XYMON_SRV \"$xymon_msg\"" $XYMON_CMD $XYMON_SRV "$xymon_msg" else _debug "command: $XYMON_CMD $XYMON_SRV \"$xymon_msg\" | eval $POST_COMMAND" _log "$XYMON_CMD $XYMON_SRV \"$xymon_msg\" | eval $POST_COMMAND" $XYMON_CMD $XYMON_SRV "$xymon_msg" | eval "$POST_COMMAND" fi } ## of _xymon_cmd() _main() { local my_host ## xymondboard output wanted (i.e. _no_ "clientlog"): if [ "$FIELDS" != "" ]; then FIELDS="fields=$FIELDS" fi ## volume-mode take2: ## Implicit aproach: _if_ `-q xymondboard` _and_ no `-S` then there is no ## point in building an intermediate HOSTLIST w/ _build_hostlist(), looping ## the hosts and connecting ${#HOSTLIST} to `xymond`. ## Instead, we just return the requested FIELDS. if [ "$QUERYTYPE" = "xymondboard" ]; then if [ "$TEST" != "info" ]; then TEST="$TEST" fi if [ $PRINT_HOST -eq 0 ] && [ $PREFIX_HOSTNAME -eq 0 ]; then ## go volume mode ... _debug "entering large-volume-mode" _print_xymondboard_volume | _parse_xymondboard_volume ## TODO: ## - filter output of the above (`|`-delimitted and various escaped chars (\\n, \\|, ...) ## - maybe we can even make `-S` work by filtering the hostname? ## This would make "volume-mode" the default for ## `-q xymondboard` turning it into a general optimization for ## this query! ## In this case `hostname` has to be present in $FIELDS! ## we are done here, so exit: exit 0 fi fi ## ghostlist, config, ping are "global" xymon querys, no host loop required if [[ "$QUERYTYPE" =~ ghost.* ]]; then _print_ghostlist return fi if [ "$QUERYTYPE" = "config" ]; then _print_config return fi if [ "$QUERYTYPE" = "ping" ] || [ "$QUERYTYPE" = "version" ]; then _print_ping return fi ## fill the global $HOSTLIST: _build_hostlist for my_host in $HOSTLIST do case "$QUERYTYPE" in clientlog) _debug "_print_clientlog \"$my_host\" \"$SECTION\"" _print_clientlog "$my_host" "$SECTION" | _prefix_hostname "$my_host" ;; xymondlog) if [ "$TEST" = "info" ] && [ "$LIST_FLAG" = "0" ]; then ## if no TEST was specified _and_ no test-listing is requested (no `-l`) echo "Missing option: Need -T TEST! The default test \"info\" does not contain any data." _usage exit 1 fi _debug "_print_xymondlog \"$my_host\" \"$TEST\"" _print_xymondlog "$my_host" "$TEST" | _prefix_hostname "$my_host" ;; xymondboard) #_xymon_cmd "xymondboard host=$my_host $FILTER $TEST $FIELDS" _print_xymondboard "$my_host" | _prefix_hostname "$my_host" ;; hostinfo) _print_hostinfo "$my_host" ;; *) echo "ERROR: unknown query-type." _usage exit 10 ;; esac done } ## of _main() ###################################################################### ## MAIN ###################################################################### _cmd_parse "$@" _main exit ## vim:sw=4:ts=4 xymonq-0.8/xymonq.1000066400000000000000000000177241323256771000143520ustar00rootroot00000000000000.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.4. .TH XYMONQ "1" "January 2018" "IT-Eckert" "User Commands" .SH NAME xymonq \- manual page for xymonq 0.8 A frontend to query the Xymon network- and systems-monitor. .SH SYNOPSIS .B xymonq [ \fI\,-c conf-file\/\fR] \fI\,-q QUERYTYPE \/\fR[\fI\,-P PAGEPATH\/\fR] [\fI\,-H HOSTNAME\/\fR] [\fI\,-T TEST\/\fR] [\fI\,-C COLOR\/\fR[\fI\,,COLOR,\/\fR...]] [\fI\,-X CRITS\/\fR] [\fI\,-f FIELD\/\fR[\fI\,,FIELD,\/\fR...]] [\fI\,-s SECTION\/\fR[\fI\,,SECTION,\/\fR...]] \fI\,| -l \/\fR] [\fI\,-S|-p\/\fR] [\fI\,-h | -V\/\fR] [\fI\,-d\/\fR] .br .B xymonq \fI\,-q clientlog \/\fR[\fI\,-P PAGEPATH\/\fR] [\fI\,-H HOSTNAME\/\fR] [\fI\,-T TEST\/\fR] [\fI\,-C COLOR\/\fR[\fI\,,COLOR,\/\fR...]] [\fI\,-X CRITS\/\fR] [\fI\,-s SECTION\/\fR[\fI\,,SECTION,\/\fR...]] \fI\,| -l \/\fR] .br .B xymonq \fI\,-q xymondboard \/\fR[\fI\,-P PAGEPATH\/\fR] [\fI\,-H HOSTNAME\/\fR] [\fI\,-T TEST\/\fR] [\fI\,-C COLOR\/\fR[\fI\,,COLOR,\/\fR...]] [\fI\,-X CRITS\/\fR] [\fI\,-f FIELD,\/\fR[\fI\,FIELD,\/\fR...]] .br .B xymonq \fI\,-q hostinfo \/\fR[\fI\,-P PAGEPATH\/\fR] [\fI\,-H HOSTNAME\/\fR] [\fI\,-T TEST\/\fR] [\fI\,-C COLOR\/\fR[\fI\,,COLOR,\/\fR...]] [\fI\,-X CRITS\/\fR] .br .B xymonq \fI\,-q xymondlog \/\fR[\fI\,-P PAGEPATH\/\fR] [\fI\,-H HOSTNAME\/\fR] \fI\,{-T TEST | -l} \/\fR[\fI\,-C COLOR\/\fR[\fI\,,COLOR,\/\fR...]] [\fI\,-X CRITS\/\fR] .br .B xymonq \fI\,-q ghostlist \/\fR[\fI\,-a \/\fR[\fI\,-\/\fR]\fI\,AGE\/\fR] [\fI\,-l\/\fR] .br .B xymonq \fI\,-q config \/\fR[\fI\,-f file\/\fR] .br .B xymonq \fI\,-q {ping|version}\/\fR .SH DESCRIPTION \fBxymonq\fR is a frontend to send various query-messages via \fBxymon(1)\fR to a Xymon server \fBxymond(8)\fR. All test- (column) information for one or more hosts/tests and internal status information of Xymon can be retrieved. .PP xymonq \- A frontend to query the Xymon network\- and systems\-monitor. .SS "OPTIONS TO SELECT DISPLAYED DATA FOR THE HOSTS:" .TP \fB\-q\fR QUERYTYPE Query to perform to Xymon [clientlog | xymondboard | hostinfo | xymondlog | ghost[list] | config | ping] .PP See section \fBQUERYTYPES\fR for details. .SS "OPTIONS TO SELECT HOSTS:" .TP \fB\-P\fR PAGEPATH A PAGEPATH specification from hosts.cfg(*). .TP \fB\-H\fR HOSTNAME A hostname from hosts.cfg(*). To read the hosts from stdin use "\-" (all other filters inactive). .TP \fB\-T\fR TEST The name of a TEST, defaults to "info"(*). .PP (*) interpreted as a REGEX .TP \fB\-C\fR COLOR only tests with COLOR, may be coma\-separated list like "clear,green", default: empty=all colors .TP \fB\-X\fR CRITS eXtra CRITERIA, like "ip=", "net=" or "tag=", CRITS are passed as\-is to xymondboard .PP This is to provide support for new or less often used filter CRITERIA. `-X` may be used multiple times (`-X ip=172.33 -X tag=test`) or have multiple quoted criteria (`-X "ip=172.33 tag=test`). Since Xymon v4.3.19 filtering on the whole message (`msg=PCRE`), various timestamps and XMH-values (`XMH_string=VALUE`, e.g. `XHM_CLASS=linux` -- see `xymon-xmh(5)`) is possible too. .PP An empty (or missing) option matches every item of that criterium. .TP \fB\-L\fR print evaluated hostlist to stdout and exit .TP \fB\-S\fR print "HOST=hostname" separator\-lines above data (deprecated) .TP \fB\-p\fR prefix each line of output w/ "hostname: ", valid for queries: clientlog, xymondboard, xymondlog .SS "Options for clientlog:" .TP \fB\-f\fR FIELD fields to print, defaults to "hostname" .TP \fB\-s\fR SECTION one or more section\-names, coma separated If empty the whole clientlog is printed .TP \fB\-l\fR list available sections only (as they occur) .SS "Options for xymondboard:" .TP \fB\-f\fR FIELD fields to print, defaults to empty, thus using xymon\-defaults .SS "Options for xymondlog:" .TP \fB\-l\fR just list available tests for selected host(s) .SS "Options for ghostlist:" .TP \fB\-a\fR [\-]AGE print only host with report AGE; AGE is a GNU\-date "\-s"\-compatible string) The "\-" prefix inverts the selection. .TP \fB\-l\fR only print the hostnames instead of the default full "ghostline" .SS "Options for client:" .TP \fB\-f\fR file The file to retrieve, e.g. "hosts.cfg", "analysis.cfg". Only files ending with ".cfg" can be fetched. Defaults to "hosts.cfg". .SS "Global options:" .TP \fB\-c\fR conf\-file use specified config\-file, this prevents searching default locations; default\-values apply if not specified. Has to be 1st cmdline option in order to allow selectively override values from cmdline. .TP \fB\-v\fR verbose output, print the "xymon"\-commandlines .TP \fB\-V\fR print version info .TP \fB\-d\fR enable debug output .TP \fB\-h\fR this help message .SH QUERYTYPES This is only a short description of the query types possible. For more detailed information see xymon(1). clientlog Get the raw-data transmitted to the xymon-server. This contains the data gathered by the `xymonclient*`-scripts. xymondboard Obtain status for one or more hosts w/ extensive filtering on the host-selection side as well as the output-side (-f FIELDS). hostinfo Retrieve the config from `hosts.cfg` about one or more hosts (host-selection like xymondboard). xymondlog Print full of status-columns as dispayed on the web interface. config Retrieve a config-file (only ".cfg"-files) from the `server/etc/`-dir of the xymon-server. ghostlist Get information about hosts sending data without being present in the xymon-server configuration. ping|version Get version of the xymon-server, this uses the `ping`-command. .SH "CONFIG FILE" The default configuration and some query-settings can be adjusted with a configuration file. The file has to conform to bash(1) syntax as it is sourced as-is. Possible settings (default values shown): XYMON_CMD="xymon" Path and command name for `xymon` binary. XYMON_SRV="127.0.0.1:1984" Where to find the Xymon server: IP:PORT (recommended) or HOSTNAME:PORT. QUERYTYPE="" The default query to execute. TEST="info" The test to use for selecting hosts or printing w/ xymondlog. FIELDS="..." The fields to print for xymondboard, defaults to xymon(1)-defaults. SECTION="" Section(s) to print for clientlog. Multiple sections are comma separated. The config file can be specified via `-c conf-file`. If no config-file is specified `xymonq` searches the following locations in order, using the first one found: 1. ./.xymonq.cfg 2. ~/.xymonq.cfg 3. /etc/xymon/xymonq.cfg 4. if no file is found: use default values .SH EXAMPLES Print a list of all hosts known to xymon (i.e. defined in hosts.cfg) xymonq -L Examples for clientlog: Print the 'clientlog' for all hosts xymonq -q clientlog List all sections in 'clientlog' for all hosts on page 'dc1', print "HOST="-separator xymonq -q clientlog -P dc1 -lS Print the 'osversion' section for hosts whole hostname matches the regex "bb.*com" xymonq -q clientlog -H "bb.*com" -s osversion Examples for xymondlog: List all tests for all hosts on page 'dc1' whose hostname contain 'mx' xymonq -q xymondlog -P dc1 -H mx -l Print the 'disk'-status of hosts whose hostname match the PCRE 'bb' xymonq -q xymondlog -H bb -T disk Examples for xymondboard: Identical host-selection as above but show the first line of the 'cpu'-status xymonq -q xymondboard -H bb -T cpu -f line1 Examples for ghostlist: Get the "hosts.cfg"-file: xymonq -q config xymonq -q config -f hosts.cfg Get "analysis.cfg"-file: xymonq -q config -f analysis.cfg Examples for ghostlist: Print the full ghostlist: xymonq -q ghostlist Print the hosts from ghostlist that reported within the last 5 minutes: xymonq -q ghostlist -a "5 minutes ago" Print the hostnames only from ghostlist that reported at least 24 hours ago: xymonq -q ghostlist -a "-yesterday" -l Examples for config: Fetch `hosts.cfg`: xymonq -q config -f hosts.cfg .SH AUTHOR Written by Thomas Eckert .SH COPYRIGHT Copyright \(co 2015\-2018 Thomas Eckert, http://www.it\-eckert.com/ .SH "SEE ALSO" xymon(1), xymon-xmh(5), xymond(8) xymonq-0.8/xymonq.cfg000066400000000000000000000011621323256771000147360ustar00rootroot00000000000000## sample config for xymonq(1) ## where to find the `xymon`-binary: XYMON_CMD="xymon" ## how to connect to the Xymon server (IP:PORT recommended): XYMON_SRV="127.0.0.1:1984" ## default-query-type (optional): #QUERYTYPE="clientlog" ## default TEST to search for (optional): ## Note: The default "info" ensures _all_ entries from `hosts.cfg` match. #TEST="info" ## fields to print for xymondboard (the defaults below are used by xymon v4.3.28): #FIELDS="hostname,testname,color,flags,lastchange,logtime,validtime,acktime,disable-time,sender,cookie,line1" ## section(s) for print for clientlog (defaults to ""): #SECTION=""