From c8f105a6633e38dc09ac20ad04dcd07808a5fd67 Mon Sep 17 00:00:00 2001 From: Larry Adams Date: Thu, 16 Sep 2004 22:00:02 +0000 Subject: [PATCH] output of RRD output to logfile git-svn-id: svn+ssh://repo.cacti.net/var/data/svnroot/cacti/trunk/cacti@2076 860744bd-22fc-0310-8c96-e9fe5004b5ca --- lib/rrd.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/rrd.php b/lib/rrd.php index 319332ecda..040580e71c 100644 --- a/lib/rrd.php +++ b/lib/rrd.php @@ -132,6 +132,10 @@ function rrdtool_execute($command_line, $log_to_stdout, $output_flag, $rrd_struc $line .= fgets($fp, 4096); } + if (read_config_option("log_verbosity") >= POLLER_VERBOSITY_HIGH) { + cacti_log("RRDTOOL: " . $line); + } + return $line; /* stdin rrdtool pipe; read 1024 bytes and stop */ }else{ @@ -139,7 +143,14 @@ function rrdtool_execute($command_line, $log_to_stdout, $output_flag, $rrd_struc $fp = rrd_get_fd($rrd_struc, RRDTOOL_PIPE_CHILD_WRITE); } - return fgets($fp, 1024); + $line = fgets($fp, 1024); + fflush(rrd_get_fd($rrd_struc, RRDTOOL_PIPE_CHILD_WRITE)); + + if (read_config_option("log_verbosity") >= POLLER_VERBOSITY_HIGH) { + cacti_log("RRDTOOL: " . $line); + } + + return $line; } break;