Module: check_mk
Branch: master
Commit: 7f5287f79ebe8873b4dce44c3bff8e8b05ce20be
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7f5287f79ebe88…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Aug 19 21:06:12 2011 +0200
direct RRD updates have been removed completely
---
.bugs/130 | 10 +++++++---
ChangeLog | 2 ++
modules/check_mk.py | 25 ++-----------------------
modules/check_mk_base.py | 18 +-----------------
scripts/setup.sh | 12 ------------
5 files changed, 12 insertions(+), 55 deletions(-)
diff --git a/.bugs/130 b/.bugs/130
index 83aeae7..5ebac9b 100644
--- a/.bugs/130
+++ b/.bugs/130
@@ -1,10 +1,14 @@
Title: Edit button and Add Bookmark button to much left
Component: multisite
+State: done
+Class: cleanup
+Date: 2011-02-11 09:45:12
Benefit: 1
-State: open
Cost: 1
-Date: 2011-02-11 09:45:12
-Class: cleanup
+Fun: 0
The Buttons in the snapins are too left. This looks
ugly.
+
+2011-08-19 20:50:53: changed state open -> done
+Had been fixed a while ago already.
diff --git a/ChangeLog b/ChangeLog
index 8a73476..db6d107 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
* FIX: allow host names to have spaces
* --snmpwalk: fix missing space in case of HEX strings
* cmk --restore: be aware of counters and cache being symbolic links
+ * do_rrd_update: direct RRD updates have completely been removed.
+ Please use rrdcached in case of performance problems.
Checks & Agents:
* FIX: printer_pages: workaround for trailing-zero bug in HP Jetdirect
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 9b63256..c999f3c 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -100,7 +100,6 @@ snmpwalks_dir = var_dir + '/snmpwalks'
precompiled_hostchecks_dir = var_dir + '/precompiled'
counters_directory = var_dir + '/counters'
tcp_cache_dir = var_dir + '/cache'
-rrd_path = var_dir + '/rrd'
logwatch_dir = var_dir + '/logwatch'
nagios_objects_file = var_dir + '/check_mk_objects.cfg'
nagios_command_pipe_path = '/usr/local/nagios/var/rw/nagios.cmd'
@@ -213,7 +212,6 @@ agent_port = 6556
agent_ports = []
snmp_ports = [] # UDP ports used for SNMP
tcp_connect_timeout = 5.0
-do_rrd_update = False
delay_precompile = False # delay Python compilation to Nagios
execution
check_submission = "pipe" # alternative: "file"
aggr_summary_hostname = "%s-s"
@@ -2259,14 +2257,6 @@ no_inventory_possible = None
if opt_verbose:
sys.stderr.write(" %s%s%s" % (tty_green,
filename.split('/')[-1], tty_normal))
- # direct update of RRD databases by check_mk
- if do_rrd_update:
- output.write("do_rrd_update = True\n" +
- "import rrdtool\n" +
- "rrd_path = %r\n" % rrd_path)
- else:
- output.write("do_rrd_update = False\n")
-
# handling of clusters
if is_cluster(hostname):
output.write("clusters = { %r : %r }\n" %
@@ -3061,7 +3051,6 @@ def show_paths():
( tcp_cache_dir, dir, data, "Cached output from
agents"),
( logwatch_dir, dir, data, "Unacknowledged logfiles of
logwatch extension"),
( nagios_objects_file, fil, data, "File into which Nagios
configuration is written"),
- ( rrd_path, dir, data, "Base directory of round robin
databases"),
( nagios_status_file, fil, data, "Path to Nagios
status.dat"),
( nagios_command_pipe_path, fil, pipe, "Nagios' command pipe"),
@@ -3820,16 +3809,6 @@ for hostname in strip_tags(all_hosts + clusters.keys()):
sys.exit(4)
seen_hostnames.add(hostname)
-# Load python-rrd if available and not switched off.
-if do_rrd_update:
- try:
- import rrdtool
- except:
- sys.stderr.write("ERROR: Cannot do direct rrd updates since the Python
module\n"+
- "'rrdtool' could not be loaded. Please install
python-rrdtool\n"+
- "or set do_rrd_update to False in main.mk.\n")
- sys.exit(3)
-
# Load agent simulator if enabled
if agent_simulator:
execfile(modules_dir + "/agent_simulator.py")
@@ -3901,8 +3880,8 @@ if __name__ == "__main__":
checks = autochecks + checks
vars_after_config = all_nonfunction_vars()
-ignored_variables = set(['vars_before_config', 'rrdtool',
'autochecks',
- 'parts' ,'hosttags' ,'seen_hostnames'
,'all_hosts_untagged' ,'taggedhost' ,'hostname'])
+ignored_variables = set(['vars_before_config', 'autochecks',
'parts' ,'hosttags' ,'seen_hostnames',
+ 'all_hosts_untagged' ,'taggedhost'
,'hostname'])
errors = 0
for name in vars_after_config:
if name not in ignored_variables and name not in vars_before_config:
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 22d5c76..c9e1059 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -909,7 +909,7 @@ def submit_check_result(host, servicedesc, result, sa):
for p in perfdata:
perftexts.append(convert_perf_data(p))
- if perftexts != [] and not direct_rrd_update(host, servicedesc, perfdata):
+ if perftexts != []:
if check_command and perfdata_format == "pnp":
perftexts.append("[%s]" % check_command)
perftext = "|" + (" ".join(perftexts))
@@ -925,22 +925,6 @@ def submit_check_result(host, servicedesc, result, sa):
color = { 0: tty_green, 1: tty_yellow, 2: tty_red, 3: tty_magenta }[result[0]]
print "%-20s %s%s%-56s%s%s" % (servicedesc, tty_bold, color, result[1],
tty_normal, p)
-def direct_rrd_update(host, servicedesc, perfdata):
- if do_rrd_update:
- path = rrd_path + "/" + host.replace(":", "_") +
"/" + servicedesc.replace("/", "_").replace(" ",
"_")
- # check existance and age of xml file
- try:
- xml_age = os.stat(path + ".xml").st_mtime
- if time.time() - xml_age > (3600 + os.getpid() % 1800):
- return False # XML file too old
- numbers = [
str(p[1]).rstrip("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_ ") for p
in perfdata ]
- # sys.stderr.write("Schreibe rrdtool.update(" + path +
".rrd" + ", N:" + ":".join(numbers))
- rrdtool.update(path + ".rrd", "N:" +
":".join(numbers))
- except:
- return False # Update not successfull or XML file missing or too old
- return True
- return False
-
def submit_to_nagios(host, service, state, output):
if check_submission == "pipe":
diff --git a/scripts/setup.sh b/scripts/setup.sh
index 74ab21b..9ca8160 100755
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -388,11 +388,6 @@ have to log in twice"
ask_title "Integration with PNP4Nagios 0.6"
# -------------------------------------------------------------------
-ask_dir rrddir $vardir/rrd $vardir/rrd $OMD_ROOT/var/pnp4nagios/perfdata "round
robin databases" \
- "Base directory for round robin databases. If you use PNP4Nagios as
-graphing tool check_mk can directly write into the exsting databases.
-This saves CPU and disk IO"
-
ask_dir pnptemplates /usr/share/$NAME/pnp-templates $HOMEBASEDIR/pnp-templates
$OMD_ROOT/local/share/check_mk/pnp-templates "PNP4Nagios templates" \
"Check_MK ships templates for PNP4Nagios for most of its checks.
Those templates make the history graphs look nice. PNP4Nagios
@@ -481,7 +476,6 @@ counters_directory = '$vardir/counters'
tcp_cache_dir = '$vardir/cache'
logwatch_dir = '$vardir/logwatch'
nagios_objects_file = '$nagconfdir/check_mk_objects.cfg'
-rrd_path = '$rrddir'
nagios_command_pipe_path = '$nagpipe'
check_result_path = '$check_result_path'
nagios_status_file = '$nagios_status_file'
@@ -689,12 +683,6 @@ do
mkdir -p $DESTDIR$confdir/multisite.d &&
mkdir -p $DESTDIR$confdir/conf.d &&
echo 'All files in this directory that end with .mk will be read in after
main.mk' > $DESTDIR$confdir/conf.d/README &&
- if [ ! -d $DESTDIR$rrddir ] ; then
- mkdir -p $DESTDIR$rrddir &&
- if [ -z "$DESTDIR" ] && id "$nagiosuser" >
/dev/null 2>&1 && [ $UID = 0 ] ; then
- chown $nagiosuser $DESTDIR$rrddir
- fi
- fi &&
mkdir -p $DESTDIR$bindir &&
rm -f $DESTDIR$bindir/check_mk &&
echo -e "#!/bin/sh\nexec python $modulesdir/check_mk.py
"'"$@"' > $DESTDIR$bindir/check_mk &&