Module: check_mk
Branch: master
Commit: 79478c8f0658e9fc8c5b301524c80ccaeb4b778d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79478c8f0658e9…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 3 21:23:53 2016 +0200
Moved livedump from treasures directly into bin/
Conflicts:
bin/.f12
---
bin/.f12 | 2 +-
{doc/treasures/livedump => bin}/livedump | 23 ++++++++++++++---------
doc/treasures/livedump/README | 12 +++---------
3 files changed, 18 insertions(+), 19 deletions(-)
diff --git a/bin/.f12 b/bin/.f12
index f9f022e..208a079 100644
--- a/bin/.f12
+++ b/bin/.f12
@@ -4,7 +4,7 @@ SITE=${SITE:-$(omd sites --bare | head -n 1)}
OMD_ROOT=/omd/sites/${SITE}
make
-sudo install -m 755 mkeventd mkeventd_open514 mkevent mkbackup $OMD_ROOT/bin/
+sudo install -m 755 livedump mkeventd mkeventd_open514 mkevent mkbackup $OMD_ROOT/bin/
sudo chown root.omd $OMD_ROOT/bin/mkeventd_open514
sudo chmod 4750 $OMD_ROOT/bin/mkeventd_open514
echo "Installed to $OMD_ROOT/bin"
diff --git a/doc/treasures/livedump/livedump b/bin/livedump
similarity index 99%
rename from doc/treasures/livedump/livedump
rename to bin/livedump
index b5cfc61..bfcd5f1 100755
--- a/doc/treasures/livedump/livedump
+++ b/bin/livedump
@@ -257,25 +257,27 @@ def bail_out(x):
sys.exit(1)
def usage():
- sys.stderr.write("""
-Usage: %s [OPTION]...
+ sys.stderr.write("""Usage: %s [OPTION]...
+
+ -s, --socket S Connect to Livestatus-socket at S
+ -s tcp:10.11.0.55:6557
+ -s unix:/var/run/nagios/rw/live
-C, --config Dump configuration (instead of state)
- -h, --help Show this help
- -V, --version Show version and exit
-T, --dump-templates Also dump host/service templates
+
-M, --mark-mode Puts the mode (state/configuration dump) in the first
line for use with livedump-ssh-recv and similar scripts
+
-p, --prefix P Add a prefix P to hostnames. Use this option to dump live
data from multiple sites with duplicated hostnames
- -s, --socket S Connect to Livestatus-socket at S
- -s tcp:10.11.0.55:6557
- -s unix:/var/run/nagios/rw/live
-O, --host-only-header H Add header H to host queries only (usually Filter: ...)
+
-H, --host-header H Add header H to host queries (usually Filter: ...)
This header is also used in service queries
+
-S, --service-header H Add header H to service queries (usually Filter: ...)
-i, --interval I Assume this check interval for hosts/services. This is
@@ -284,11 +286,14 @@ Usage: %s [OPTION]...
option is only used when dumping the config together
with templates (-C -T)
- -v, --verbose Output debug information on stderr
-G, --include-groups Use contact groups instead of contacts on dumping config
+
--include-host-icon Add host icon_image to config
- --debug Do not catch Python exceptions
+ -V, --version Show version and exit
+ -h, --help Show this help
+ -v, --verbose Output debug information on stderr
+ --debug Do not catch Python exceptions
""" % os.path.split(sys.argv[0])[1])
def print_version():
diff --git a/doc/treasures/livedump/README b/doc/treasures/livedump/README
index eac5c43..574402a 100644
--- a/doc/treasures/livedump/README
+++ b/doc/treasures/livedump/README
@@ -15,19 +15,13 @@ Advantages:
Disadvantages:
- Introduces some latency
-How to setup livedump
----------------------
-Copy the file livedump to a convenient place. Make sure that
-../livestatus/api/python/livestatus.py is either in the same
-directory as livedump or somewhere in the Python path.
-
Using livedump
--------------
The first step is to extract the configuration from the source system using. This step
is needed whenever your configuration of hosts or services changes.
NSCA users will now this. This is easily done by:
-./livedump -TC > some_file.cfg
+livedump -TC > some_file.cfg
and then copying that file to your objects or conf.d directory on
your target nagios. Note: The option -T will add some templates
@@ -41,7 +35,7 @@ and be in pending state.
Now create a cronjob that does the following every 1 or 5 minutes:
-1. ./livedump > ca1b2c3
+1. livedump > ca1b2c3
2. copy that file to the target system into the checkresults directory
(in OMD this is ~/tmp/nagios/checkresults)
3. After a correct copy touch the file ca1b2c3.ok in that
@@ -59,7 +53,7 @@ and service livestatus headers. The following example will only dump
hosts and services of the host group "foo". Please make sure that
all hosts that are needed by the dumped services are also dumped:
-./livedump -H "Filter: host_groups > foo"
+livedump -H "Filter: host_groups > foo"
Note: The -H headers will also be added to the service queries.
Make sure that all columns are prefixed with host_ in these.