XYMONQ(1)

🌸 XYMONQ(1) β€” the xymon query bestie 🌸

ok so first things first, this is part of the User Commands section of the manual, and it's all about xymonq. Hi. Welcome. You're gonna love her. πŸ’–

✨ NAME ✨

xymonq β€” a frontend to query the Xymon network- and systems-monitor. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

xymonq [ -c conf-file] -q QUERYTYPE [-P PAGEPATH] [-H HOSTNAME] [-T
TEST] [-C COLOR[,COLOR,...]] [-X CRITS] [-f FIELD[,FIELD,...]] [-s
SECTION[,SECTION,...]] | -l ] [-S|-p] [-h | -V] [-d]
xymonq -q clientlog   [-P PAGEPATH] [-H HOSTNAME] [-T TEST] [-C
COLOR[,COLOR,...]] [-X CRITS] [-s SECTION[,SECTION,...]] | -l ]
xymonq -q xymondboard [-P PAGEPATH] [-H HOSTNAME] [-T TEST] [-C
COLOR[,COLOR,...]] [-X CRITS] [-f FIELD,[FIELD,...]]
xymonq -q hostinfo    [-P PAGEPATH] [-H HOSTNAME] [-T TEST] [-C
COLOR[,COLOR,...]] [-X CRITS]
xymonq -q xymondlog   [-P PAGEPATH] [-H HOSTNAME] {-T TEST | -l} [-C
COLOR[,COLOR,...]] [-X CRITS]
xymonq -q ghostlist [-a [-]AGE] [-l]
xymonq -q config [-f file]
xymonq -q {ping|version}

like, she has range, and she's not afraid to use it πŸ’…


🌈 DESCRIPTION 🌈

xymonq is a frontend that sends all kinds of query-messages over to a Xymon server's xymond(8), and it does it by way of xymon(1). So basically: you get all the test- (column) info for one or more hosts/tests, plus the internal status info of Xymon itself. Everything. All of it. Obsessed. πŸ¦‹

xymonq β€” A frontend to query the Xymon network- and systems-monitor.

πŸ‘‘ OPTIONS TO SELECT DISPLAYED DATA FOR THE HOSTS πŸ‘‘

  • -q QUERYTYPE β€” the query you wanna throw at Xymon. Your choices are clientlog, xymondboard, hostinfo, xymondlog, ghost[list], config, ping.

Scroll down to the QUERYTYPES section for the tea on each one. β˜•

🧚 OPTIONS TO SELECT HOSTS 🧚

  • -P PAGEPATH β€” a PAGEPATH spec, the kind you'd find in hosts.cfg(*).
  • -H HOSTNAME β€” a hostname from hosts.cfg(*). And hey, if you wanna read the hosts from stdin, just use "-" β€” that shuts all the other filters off, no cap.
  • -T TEST β€” the name of a TEST, and it defaults to "info"(*).

(*) and yes bestie, all of these get interpreted as a REGEX. slay.

  • -C COLOR β€” only show tests with that COLOR. You can comma-separate a whole list, like "clear,green". Default: empty, which means all the colors. 🌈
  • -X CRITS β€” eXtra CRITERIA, like "ip=", "net=" or "tag=". The CRITS get passed to xymondboard exactly as-is.

This exists to give you support for new or less-often-used filter CRITERIA. You can stack -X multiple times (-X ip=172.33 -X tag=test) or shove multiple quoted criteria into one (-X "ip=172.33 tag=test).

And ever since Xymon v4.3.19, you can filter on the whole message (msg=PCRE), on various timestamps, and on XMH-values (XMH_string=VALUE, e.g. XHM_CLASS=linux β€” peep xymon-xmh(5) for that one). πŸ’«

An empty (or missing) option matches every single item of that criterium. generous queen.

  • -L β€” print the evaluated hostlist to stdout and dip. bye. ✌️
  • -S β€” print "HOST=hostname" separator-lines above the data. (deprecated, just so you know, bestie β€” it's giving legacy)
  • -p β€” prefix every line of output with "hostname: ". Valid for these queries: clientlog, xymondboard, xymondlog.

πŸ’… Options for clientlog:

  • -f FIELD β€” which fields to print. defaults to "hostname".
  • -s SECTION β€” one or more section-names, coma separated. If it's empty, the whole clientlog gets printed. all of it. 😌
  • -l β€” list the available sections only (as they occur).

πŸ“ Options for xymondboard:

  • -f FIELD β€” the fields to print. defaults to empty, which means it falls back to the xymon-defaults.

πŸŽ€ Options for xymondlog:

  • -l β€” just list the available tests for the selected host(s).

πŸ¦‹ Options for ghostlist:

  • -a [-]AGE β€” print only hosts with report AGE; AGE is a GNU-date "-s"-compatible string. and the "-" prefix inverts the selection, sneaky.
  • -l β€” only print the hostnames instead of the default full "ghostline".

⭐ Options for client:

  • -f file β€” the file to retrieve, e.g. "hosts.cfg", "analysis.cfg". Only files ending in .cfg can be fetched, so don't even try it with anything else. Defaults to "hosts.cfg".

🌟 Global options:

  • -c conf-file β€” use the config-file you specify. This stops her from searching the default locations; and if you don't specify, the default-values apply. Important: this has to be the 1st cmdline option, so that you can selectively override values from the cmdline afterwards. order matters, bestie. 😭
  • -v β€” verbose output, it prints the "xymon"-commandlines.
  • -V β€” print version info.
  • -d β€” enable debug output.
  • -h β€” this help message. (hi, this is the help message 🫢)

πŸ’œ QUERYTYPES πŸ’œ

Okay so this is only a short lil description of the query types possible β€” for the full deep dive, go read xymon(1). iykyk.

  • 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. spooky. πŸ‘»
  • ping|version β€” Get version of the xymon-server, this uses the ping-command.

🌸 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, because it gets sourced as-is. no filter, just vibes.

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. And if you don't specify one, xymonq searches these 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

πŸ”₯ 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

🫢 AUTHOR 🫢

Written by Thomas Eckert. legend behavior, honestly.

Copyright Β© 2015-2018 Thomas Eckert, http://www.it-eckert.com/

πŸ’€ SEE ALSO πŸ’€

xymon(1), xymon-xmh(5), xymond(8)


and that's the whole page bestie!! this one came from IT-Eckert, dated January 2018, and it's page XYMONQ(1) of the manual. go query something gorgeous. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from