NAME
xymongrep - pick out lines in hosts.cfgSYNOPSIS
xymongrep --helpDESCRIPTION
is for use by extension scripts that need to pick out the entries in a hosts.cfg file that are relevant to the script.OPTIONS
- --noextras
- Remove the "testip", "dialup", "INSIDESLA" and "OUTSIDESLA" tags from the output.
- --test-untagged
- When using the XYMONNETWORK environment variable to test
only hosts on a particular network segment, xymonnet will ignore hosts
that do not have any "NET:x" tag. So only hosts that have a
NET:$XYMONNETWORK tag will be tested.
- --no-down[=TESTNAME]
- xymongrep will query the Xymon server for the current status of the "conn" test, and if TESTNAME is specified also for the current state of the specified test. If the status of the "conn" test for a host is non-green, or the status of the TESTNAME test is disabled, then this host is ignored and will not be included in the output. This can be used to ignore hosts that are down, or hosts where the custom test is disabled.
- --web
- Search the hosts.cfg file following include statements as a Xymon web-server would.
- --net
- Search the hosts.cfg file following include statements as when running xymonnet.
- --loadhostsfromxymond
- xymongrep will normally attempt to load the HOSTSCFG file by itself when searching for lines to transmit. If the file is unreadable, it will exit out. With this option, it will query the xymond server (set via the XYMONSERVER environment) for the hosts file. This can be used if you're running this on a client or remote system and can't or don't want to have the hosts.cfg file synchronized across your servers.
EXAMPLE
If your hosts.cfg file looks like this192.168.1.1 www.test.com # ftp telnet !oracle
192.168.1.2 db1.test.com # oracle
192.168.1.3 mail.test.com # smtp
192.168.1.1 www.test.com # !oracle
192.168.1.2 db1.test.com # oracle
USE IN EXTENSION SCRIPTS
To integrate xymongrep into an existing script, look for the line in the script that grep's in the $HOSTSCFG file. Typically it will look somewhat like this:$GREP -i "^[0-9].*#.*TESTNAME" $HOSTSCFG | ... code to handle test
$XYMONHOME/bin/xymongrep TESTNAME | ... code to handle test
ENVIRONMENT VARIABLES
- XYMONNETWORK
- If set, xymongrep outputs only lines from hosts.cfg that have a matching NET:$XYMONNETWORK setting.
- HOSTSCFG
- Filename for the Xymon hosts.cfg(5) file.
FILES
- $HOSTSCFG
- The Xymon hosts.cfg file
SEE ALSO
hosts.cfg(5), xymonserver.cfg(5)Version 4.3.30: 4 Sep 2019 | Xymon |