XYMONQ(1) | User Commands | XYMONQ(1) |
xymonq - a frontend to query the Xymon network- and systems-monitor.
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}
xymonq is a frontend to send various query-messages via xymon(1) to a Xymon server xymond(8). All test- (column) information for one or more hosts/tests and internal status information of Xymon can be retrieved.
xymonq - A frontend to query the Xymon network- and systems-monitor.
See section QUERYTYPES for details.
(*) interpreted as a REGEX
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.
An empty (or missing) option matches every item of that criterium.
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.
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
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
Written by Thomas Eckert
Copyright © 2015-2018 Thomas Eckert, http://www.it-eckert.com/
January 2018 | IT-Eckert |