From 924495bb2d732548083de9e54bf93eebe7f0d910 Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Tue, 12 Jan 2010 19:58:47 +0100 Subject: make rrdtool executable configurable --- inc/html.inc.php | 2 +- inc/rrdtool.class.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/html.inc.php b/inc/html.inc.php index e38ca8e..6ab84d9 100644 --- a/inc/html.inc.php +++ b/inc/html.inc.php @@ -62,7 +62,7 @@ function plugin_header($host, $plugin, $status) { function host_summary($hosts) { global $CONFIG; - $rrd = new RRDTool; + $rrd = new RRDTool($CONFIG['rrdtool']); echo "\n"; diff --git a/inc/rrdtool.class.php b/inc/rrdtool.class.php index 7dcbc2a..f7907ec 100644 --- a/inc/rrdtool.class.php +++ b/inc/rrdtool.class.php @@ -1,9 +1,20 @@ rrdtool = $rrdtool; + } else { + printf('

Error: RRDTool (%s) is not executable. Please install RRDTool it and configure $CONFIG[\'rrdtool\'].

', $rrdtool); + die(); + } + } + function rrd_info($rrdfile) { if (file_exists($rrdfile)) { - $raw_info = shell_exec('/usr/bin/rrdtool info '.$rrdfile); + $raw_info = shell_exec($this->rrdtool.' info '.$rrdfile); $raw_array = explode("\n", $raw_info); foreach ($raw_array as $key => $info) { if ($info != "") { -- cgit v1.1