Module: check_mk
Branch: master
Commit: d140b8f5c58ee07fa84b380fb146dd4152e11aee
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d140b8f5c58ee0…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Oct 15 15:37:15 2014 +0200
Handle new option --split-rrds needed for CMC
---
modules/check_mk.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index e8f3164..1fd6522 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3572,8 +3572,6 @@ no_inventory_possible = None
# | that is used by the official Check_MK documentation ("nowiki"). |
# '----------------------------------------------------------------------'
-opt_nowiki = False
-
def get_tty_size():
import termios,struct,fcntl
try:
@@ -4735,7 +4733,7 @@ def usage():
cmk --localize COMMAND do localization operations
cmk --notify used to send notifications from core
cmk --create-rrd [--keepalive|SPEC] create round robin database (only CMC)
- cmk --convert-rrds [HOST1 HOST2...] convert exiting RRD to new format (only CMC)
+ cmk --convert-rrds [--split] [H...] convert exiting RRD to new format (only CMC)
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 [-f] [H1 H2..] Bake agents for hosts (not in all versions)
@@ -4859,7 +4857,8 @@ NOTES:
to the new structure as configured via the rulesets cmc_host_rrd_config
and cmc_service_rrd_config. If you do not specify hosts, then all
RRDs will be converted. Conversion just takes place if the configuration
- of the RRDs has changed.
+ of the RRDs has changed. The option --split will activate conversion
+ from exising RRDs in PNP storage type SINGLE to MULTIPLE.
""" % (check_mk_configfile,
@@ -5949,6 +5948,10 @@ def output_profile():
# | Main entry point and option parsing. Here is where all begins. |
# '----------------------------------------------------------------------'
+opt_nowiki = False
+opt_split_rrds = False
+
+
# Do option parsing and execute main function -
# if check_mk is not called as module
if __name__ == "__main__":
@@ -5959,7 +5962,7 @@ if __name__ == "__main__":
"snmptranslate", "bake-agents", "force",
"usewalk", "scan-parents", "procs=", "automation=", "notify",
"snmpget=", "profile", "keepalive", "keepalive-fd=", "create-rrd",
- "convert-rrds",
+ "convert-rrds", "split-rrds",
"no-cache", "update", "restart", "reload", "dump", "fake-dns=",
"man", "nowiki", "config-check", "backup=", "restore=",
"check-inventory=", "paths", "checks=", "inventory", "inventory-as-check=",
@@ -6030,6 +6033,8 @@ if __name__ == "__main__":
check_types = a.split(",")
elif o == "--cmc-file":
opt_cmc_relfilename = a
+ elif o == "--split-rrds":
+ opt_split_rrds = True
# Perform actions (major modes)
try:
Module: check_mk
Branch: master
Commit: a2d065679b4b6bfe4cab4553deddb279f1d655fc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a2d065679b4b6b…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Oct 14 18:47:00 2014 +0200
ps.include: make common inventory function more robust if inventory rule parameters are missing
---
checks/ps.include | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/checks/ps.include b/checks/ps.include
index 47608b4..995bef3 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -69,8 +69,15 @@ def inventory_ps_common(invdata, invrules, info, with_perfdata = False):
v = rule[0]
+ # set values for user und perfdata to None if they dont exist
+ d_user = v.get('user')
+ v['user'] = d_user
+ d_perfdata = v.get('perfdata')
+ v['perfdata'] = d_perfdata
+
# Make ps skip rules for ps.perf and vice versa
- if with_perfdata != v['perfdata']:
+ # Ignore if perfdata key is not set
+ if v.get('perfdata') and with_perfdata != v.get('perfdata'):
continue
extra_options = []
Module: check_mk
Branch: master
Commit: 7b07d2598dc4c6a5ff022acbcca73e99ec90b15f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b07d2598dc4c6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Oct 14 17:48:20 2014 +0200
Handle new option --convert-rrds, needed for CMC
---
modules/check_mk.py | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 40acf4b..e8f3164 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4734,7 +4734,8 @@ def usage():
cmk -P, --package COMMAND do package operations
cmk --localize COMMAND do localization operations
cmk --notify used to send notifications from core
- cmk --create-rrd [--keepalive|SPEC] create round robin database
+ cmk --create-rrd [--keepalive|SPEC] create round robin database (only CMC)
+ cmk --convert-rrds [HOST1 HOST2...] convert exiting RRD to new format (only CMC)
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 [-f] [H1 H2..] Bake agents for hosts (not in all versions)
@@ -4854,6 +4855,12 @@ NOTES:
already exists. Note: baking agents is only contained in the
subscription version of Check_MK.
+ --convert-rrds converts the internal structure of existing RRDs
+ to the new structure as configured via the rulesets cmc_host_rrd_config
+ and cmc_service_rrd_config. If you do not specify hosts, then all
+ RRDs will be converted. Conversion just takes place if the configuration
+ of the RRDs has changed.
+
""" % (check_mk_configfile,
precompiled_hostchecks_dir,
@@ -5952,6 +5959,7 @@ if __name__ == "__main__":
"snmptranslate", "bake-agents", "force",
"usewalk", "scan-parents", "procs=", "automation=", "notify",
"snmpget=", "profile", "keepalive", "keepalive-fd=", "create-rrd",
+ "convert-rrds",
"no-cache", "update", "restart", "reload", "dump", "fake-dns=",
"man", "nowiki", "config-check", "backup=", "restore=",
"check-inventory=", "paths", "checks=", "inventory", "inventory-as-check=",
@@ -5959,7 +5967,7 @@ if __name__ == "__main__":
non_config_options = ['-L', '--list-checks', '-P', '--package', '-M', '--notify',
'--man', '-V', '--version' ,'-h', '--help', '--automation',
- '--create-rrd' ]
+ '--create-rrd', '--convert-rrds' ]
try:
opts, args = getopt.getopt(sys.argv[1:], short_options, long_options)
@@ -6157,6 +6165,11 @@ if __name__ == "__main__":
execfile(modules_dir + "/rrd.py")
do_create_rrd(args)
done = True
+ elif o == '--convert-rrds':
+ read_config_files(False, True)
+ execfile(modules_dir + "/rrd.py")
+ do_convert_rrds(args)
+ done = True
elif o in [ '-A', '--bake-agents' ]:
if 'do_bake_agents' not in globals():
sys.stderr.write("Agent baking is not implemented in your version of Check_MK. Sorry.\n")