table of contents
other versions
- wheezy 4.3.0~beta2.dfsg-9.1
BBHOSTGREP(1) | General Commands Manual | BBHOSTGREP(1) |
NAME¶
bbhostgrep - pick out lines in bb-hostsSYNOPSIS¶
bbhostgrep --helpDESCRIPTION¶
bbhostgrep(1) is for use by extension scripts that need to pick out the entries in a bb-hosts 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 BBLOCATION environment variable to test only
hosts on a particular network segment, bbtest-net will ignore hosts that
do not have any "NET:x" tag. So only hosts that have a
NET:$BBLOCATION tag will be tested.
- --no-down[=TESTNAME]
- bbhostgrep 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.
- --bbdisp
- Search the bb-hosts file following include statements as a
BBDISPLAY server would.
- --bbnet
- Search the bb-hosts file following include statements as a
BBNET server would.
EXAMPLE¶
If your bb-hosts 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 bbhostgrep into an existing script, look for the line in the script that grep's in the $BBHOSTS file. Typically it will look somewhat like this:$GREP -i "^[0-9].*#.*TESTNAME" $BBHOSTS | ... code to handle test
$BBHOME/bin/bbhostgrep TESTNAME | ... code to handle test
ENVIRONMENT VARIABLES¶
- BBLOCATION
- If set, bbhostgrep outputs only lines from bb-hosts that
have a matching NET:$BBLOCATION setting.
- BBHOSTS
- Filename for the Xymon bb-hosts(5) file.
FILES¶
- $BBHOSTS
- The Xymon bb-hosts file
SEE ALSO¶
bb-hosts(5), hobbitserver.cfg(5)Version 4.2.3: 4 Feb 2009 | Xymon |