Module: check_mk
Branch: master
Commit: 766bdd9a06c4b474a60708b90d21f22a6fc9f34b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=766bdd9a06c4b4…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 24 13:55:00 2014 +0200
Added option -f,--force for agent bakery
---
modules/check_mk.py | 12 ++++++++----
modules/check_mk_base.py | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index fbff765..70815fc 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4740,7 +4740,7 @@ def usage():
cmk --create-rrd [--keepalive|SPEC] create round robin database
cmk -i, --inventory [HOST1 HOST2...] Do a HW/SW-Inventory of some ar all hosts
cmk --inventory-as-check HOST Do HW/SW-Inventory, behave like check plugin
- cmk -A, --bake-agents [H1 H2 ..] Bake agents for hosts (no in all versions)
+ cmk -A, --bake-agents [-f] [H1 H2..] Bake agents for hosts (not in all versions)
cmk -V, --version print version
cmk -h, --help print this help
@@ -4852,7 +4852,9 @@ NOTES:
defines gateway hosts and parent declarations.
-A, --bake-agents creates RPM/DEB/MSI packages with host-specific
- monitoring agents. Note: this feature is only contained in the
+ monitoring agents. If you add the option -f, --force then all
+ agents are renewed, even if an uptodate version for a configuration
+ already exists. Note: baking agents is only contained in the
subscription version of Check_MK.
@@ -5941,11 +5943,11 @@ def output_profile():
# Do option parsing and execute main function -
# if check_mk is not called as module
if __name__ == "__main__":
- short_options = 'ASHVLCURODMmd:Ic:nhvpXPNBil'
+ short_options = 'ASHVLCURODMmd:Ic:nhvpXPNBilf'
long_options = [ "help", "version", "verbose",
"compile", "debug", "interactive",
"list-checks", "list-hosts",
"list-tag", "no-tcp", "cache",
"flush", "package", "localize",
"donate", "snmpwalk", "oid=", "extraoid=",
- "snmptranslate", "bake-agents",
+ "snmptranslate", "bake-agents",
"force",
"usewalk", "scan-parents", "procs=",
"automation=", "notify",
"snmpget=", "profile", "keepalive",
"keepalive-fd=", "create-rrd",
"no-cache", "update", "restart",
"reload", "dump", "fake-dns=",
@@ -5976,6 +5978,8 @@ if __name__ == "__main__":
for o,a in opts:
if o in [ '-v', '--verbose' ]:
opt_verbose = True
+ elif o in [ '-f', '--force' ]:
+ opt_force = True
elif o == '-c':
check_mk_configfile = a
elif o == '--cache':
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 868b929..dfa1d03 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -108,6 +108,7 @@ opt_cmc_relfilename = "config"
opt_keepalive_fd = None
opt_oids = []
opt_extra_oids = []
+opt_force = False
# register SIGINT handler for consistenct CTRL+C handling
def interrupt_handler(signum, frame):